Skip to content
  • Auto
  • Light
  • Dark

List

List project branches
client.Projects.Branches.List(ctx, params) (*Page[BranchstringConfigCommitCommitLatestBuildIDstringObjectstringOrgstringProjectstringProjectBranchListResponse], error)
get/v0/projects/{project}/branches

List project branches

Parameters
paramsProjectfieldCursorfieldLimitfieldProjectBranchListParams
Hide ParametersShow Parameters
Projectfield
optional
param.Field[string]

Path param:

Cursorfield
optional
param.Field[string]

Query param: Pagination cursor from a previous response

Limitfield
optional
param.Field[float64]

Query param: Maximum number of items to return, defaults to 10 (maximum: 100)

exclusiveMinimum0
maximum100
Returns
ProjectBranchListResponsestruct
Hide ParametersShow Parameters
Branchstring
ConfigCommitRepoCommitRepoShastringCommit
LatestBuildIDstring
Objectstring
Hide ParametersShow Parameters
ProjectBranchListResponseObjectProjectBranchconst
ProjectBranchListResponseObjectProjectBranchProjectBranchListResponseObjectProjectBranchListResponseObject
"project_branch"
Orgstring
Projectstring
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"),
  )
  page, err := client.Projects.Branches.List(context.TODO(), stainless.ProjectBranchListParams{
    Project: stainless.String("project"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
200 Example
{
  "data": [
    {
      "branch": "branch",
      "config_commit": {
        "repo": {
          "branch": "branch",
          "name": "name",
          "owner": "owner"
        },
        "sha": "sha"
      },
      "latest_build_id": "latest_build_id",
      "object": "project_branch",
      "org": "org",
      "project": "project"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}