Skip to content
FeedbackDashboard

Retrieve project

client.Projects.Get(ctx, query) (*Project, error)
get/v0/projects/{project}

Retrieve a project by name.

ParametersExpand Collapse
query ProjectGetParams
Project param.Field[string]optional
ReturnsExpand Collapse
type Project struct{…}

A project is a collection of SDKs generated from the same set of config files.

ConfigRepo string
DisplayName string
Object ProjectObject
Org string
Slug string
Targets []Target
Accepts one of the following:
const TargetNode Target = "node"
const TargetTypescript Target = "typescript"
const TargetPython Target = "python"
const TargetGo Target = "go"
const TargetJava Target = "java"
const TargetKotlin Target = "kotlin"
const TargetRuby Target = "ruby"
const TargetTerraform Target = "terraform"
const TargetCli Target = "cli"
const TargetPhp Target = "php"
const TargetCsharp Target = "csharp"
const TargetOpenAPI Target = "openapi"
Retrieve project
package main

import (
  "context"
  "fmt"

  "github.com/stainless-api/stainless-api-go"
  "github.com/stainless-api/stainless-api-go/option"
)

func main() {
  client := stainless.NewClient(
    option.WithAPIKey("My API Key"),
  )
  project, err := client.Projects.Get(context.TODO(), stainless.ProjectGetParams{
    Project: stainless.String("project"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", project.ConfigRepo)
}
{
  "config_repo": "config_repo",
  "display_name": "display_name",
  "object": "project",
  "org": "org",
  "slug": "slug",
  "targets": [
    "node"
  ]
}
Returns Examples
{
  "config_repo": "config_repo",
  "display_name": "display_name",
  "object": "project",
  "org": "org",
  "slug": "slug",
  "targets": [
    "node"
  ]
}