Skip to content
  • Auto
  • Light
  • Dark

List

List builds for a project
client.Builds.List(ctx, query) (*Page[IDstringConfigCommitstringCreatedAtTimeDocumentedSpecBuildObjectDocumentedSpecUnionObjectBuildObjectObjectOrgstringProjectstringTargetsBuildObjectTargetsUpdatedAtTimeBuildObject], error)
get/v0/builds

List builds for a project

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

Project name

Branchfield
optional
param.Field[string]

Branch name

Cursorfield
optional
param.Field[string]

Pagination cursor from a previous response

Limitfield
optional
param.Field[float64]

Maximum number of builds to return, defaults to 10 (maximum: 100)

exclusiveMinimum0
maximum100
Revisionfield
optional

A config commit SHA used for the build

Hide ParametersShow Parameters
string
BuildListParamsRevisionMaptype

Hash of the files used for the build

Hide ParametersShow Parameters
Hashstring

File content hash

Returns
IDstringConfigCommitstringCreatedAtTimeDocumentedSpecBuildObjectDocumentedSpecUnionObjectBuildObjectObjectOrgstringProjectstringTargetsBuildObjectTargetsUpdatedAtTimeBuildObject
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.Builds.List(context.TODO(), stainless.BuildListParams{
    Project: stainless.String("project"),
  })
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", page)
}
200 Example
{
  "data": [
    {
      "id": "id",
      "config_commit": "config_commit",
      "created_at": "2019-12-27T18:11:19.117Z",
      "documented_spec": {
        "content": "content",
        "type": "content"
      },
      "object": "build",
      "org": "org",
      "project": "project",
      "targets": {
        "cli": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "csharp": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "go": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "java": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "kotlin": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "node": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "php": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "python": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "ruby": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "terraform": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        },
        "typescript": {
          "commit": {
            "status": "not_started"
          },
          "lint": {
            "status": "not_started"
          },
          "object": "build_target",
          "status": "not_started",
          "test": {
            "status": "not_started"
          },
          "build": {
            "status": "not_started"
          },
          "upload": {
            "status": "not_started"
          }
        }
      },
      "updated_at": "2019-12-27T18:11:19.117Z"
    }
  ],
  "has_more": true,
  "next_cursor": "next_cursor"
}