# Builds ## List project builds **get** `/v0/builds` List user-triggered builds for a given project. An optional revision can be specified to filter by config commit SHA, or hashes of file contents. ### Query Parameters - `project: optional string` Project name - `branch: optional string` Branch name - `cursor: optional string` Pagination cursor from a previous response. - `limit: optional number` Maximum number of builds to return, defaults to 10 (maximum: 100). - `revision: optional string or map[object { hash } ]` A config commit SHA used for the build - `string` A config commit SHA used for the build - `map[object { hash } ]` Hash of the files used for the build - `hash: string` File content hash ### Returns - `data: array of Build` - `id: string` Build ID - `config_commit: string` - `created_at: string` - `documented_spec: object { content, type } or object { expires, type, url }` - `object { content, type }` - `content: string` - `type: "content"` - `"content"` - `object { expires, type, url }` - `expires: string` - `type: "url"` - `"url"` - `url: string` - `object: "build"` - `"build"` - `org: string` - `project: string` - `targets: object { cli, csharp, go, 10 more }` - `cli: optional BuildTarget` - `commit: object { status } or object { status } or object { status } or object { commit, completed, completed_at, 3 more }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status }` - `status: "queued"` - `"queued"` - `InProgress = object { status }` - `status: "in_progress"` - `"in_progress"` - `Completed = object { commit, completed, completed_at, 3 more }` - `commit: Commit` - `repo: object { branch, host, name, owner }` - `branch: string` - `host: string` - `name: string` - `owner: string` - `sha: string` - `stats: object { additions, deletions, total }` - `additions: number` - `deletions: number` - `total: number` - `tree_oid: string` - `completed: object { commit, completed_at, conclusion, merge_conflict_pr }` deprecated - `commit: Commit` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `status: "completed"` - `"completed"` - `install_url: string` - `object: "build_target"` - `"build_target"` - `status: "not_started" or "codegen" or "postgen" or "completed"` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: optional CheckStep` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` - `lint: optional CheckStep` - `test: optional CheckStep` - `csharp: optional BuildTarget` - `go: optional BuildTarget` - `java: optional BuildTarget` - `kotlin: optional BuildTarget` - `node: optional BuildTarget` - `openapi: optional BuildTarget` - `php: optional BuildTarget` - `python: optional BuildTarget` - `ruby: optional BuildTarget` - `sql: optional BuildTarget` - `terraform: optional BuildTarget` - `typescript: optional BuildTarget` - `updated_at: string` - `has_more: boolean` - `next_cursor: optional string` ### Example ```http curl https://api.stainless.com/v0/builds \ -H "Authorization: Bearer $STAINLESS_API_KEY" ``` #### Response ```json { "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" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Create build **post** `/v0/builds` Create a build, on top of a project branch, against a given input revision. The project branch will be modified so that its latest set of config files points to the one specified by the input revision. ### Body Parameters - `project: optional string` Project name - `revision: string or map[FileInput]` Specifies what to build: a branch name, commit SHA, merge command ("base..head"), or file contents. - `string` A branch name, commit SHA, or merge command in the format "base..head" - `map[FileInput]` File contents to commit directly - `Content = object { content }` - `content: string` File content - `URL = object { url }` - `url: string` URL to fetch file content from - `allow_empty: optional boolean` Whether to allow empty commits (no changes). Defaults to false. - `branch: optional string` The project branch to use for the build. If not specified, the branch is inferred from the `revision`, and will 400 when that is not possible. - `commit_message: optional string` Optional commit message to use when creating a new commit. - `enable_ai_commit_message: optional boolean` Whether to generate AI-powered commit messages for the build. Cannot be combined with `commit_message` or `target_commit_messages`. - `target_commit_messages: optional object { cli, csharp, go, 10 more }` Optional commit messages to use for each SDK when making a new commit. SDKs not represented in this object will fallback to the optional `commit_message` parameter, or will fallback further to the default commit message. - `cli: optional string` - `csharp: optional string` - `go: optional string` - `java: optional string` - `kotlin: optional string` - `node: optional string` - `openapi: optional string` - `php: optional string` - `python: optional string` - `ruby: optional string` - `sql: optional string` - `terraform: optional string` - `typescript: optional string` - `targets: optional array of Target` Optional list of SDK targets to build. If not specified, all configured targets will be built. - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` ### Returns - `Build = object { id, config_commit, created_at, 6 more }` - `id: string` Build ID - `config_commit: string` - `created_at: string` - `documented_spec: object { content, type } or object { expires, type, url }` - `object { content, type }` - `content: string` - `type: "content"` - `"content"` - `object { expires, type, url }` - `expires: string` - `type: "url"` - `"url"` - `url: string` - `object: "build"` - `"build"` - `org: string` - `project: string` - `targets: object { cli, csharp, go, 10 more }` - `cli: optional BuildTarget` - `commit: object { status } or object { status } or object { status } or object { commit, completed, completed_at, 3 more }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status }` - `status: "queued"` - `"queued"` - `InProgress = object { status }` - `status: "in_progress"` - `"in_progress"` - `Completed = object { commit, completed, completed_at, 3 more }` - `commit: Commit` - `repo: object { branch, host, name, owner }` - `branch: string` - `host: string` - `name: string` - `owner: string` - `sha: string` - `stats: object { additions, deletions, total }` - `additions: number` - `deletions: number` - `total: number` - `tree_oid: string` - `completed: object { commit, completed_at, conclusion, merge_conflict_pr }` deprecated - `commit: Commit` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `status: "completed"` - `"completed"` - `install_url: string` - `object: "build_target"` - `"build_target"` - `status: "not_started" or "codegen" or "postgen" or "completed"` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: optional CheckStep` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` - `lint: optional CheckStep` - `test: optional CheckStep` - `csharp: optional BuildTarget` - `go: optional BuildTarget` - `java: optional BuildTarget` - `kotlin: optional BuildTarget` - `node: optional BuildTarget` - `openapi: optional BuildTarget` - `php: optional BuildTarget` - `python: optional BuildTarget` - `ruby: optional BuildTarget` - `sql: optional BuildTarget` - `terraform: optional BuildTarget` - `typescript: optional BuildTarget` - `updated_at: string` ### Example ```http curl https://api.stainless.com/v0/builds \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $STAINLESS_API_KEY" \ -d '{ "project": "project", "revision": "string" }' ``` #### Response ```json { "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" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Retrieve build **get** `/v0/builds/{buildId}` Retrieve a build by its ID. ### Path Parameters - `buildId: string` Build ID ### Returns - `Build = object { id, config_commit, created_at, 6 more }` - `id: string` Build ID - `config_commit: string` - `created_at: string` - `documented_spec: object { content, type } or object { expires, type, url }` - `object { content, type }` - `content: string` - `type: "content"` - `"content"` - `object { expires, type, url }` - `expires: string` - `type: "url"` - `"url"` - `url: string` - `object: "build"` - `"build"` - `org: string` - `project: string` - `targets: object { cli, csharp, go, 10 more }` - `cli: optional BuildTarget` - `commit: object { status } or object { status } or object { status } or object { commit, completed, completed_at, 3 more }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status }` - `status: "queued"` - `"queued"` - `InProgress = object { status }` - `status: "in_progress"` - `"in_progress"` - `Completed = object { commit, completed, completed_at, 3 more }` - `commit: Commit` - `repo: object { branch, host, name, owner }` - `branch: string` - `host: string` - `name: string` - `owner: string` - `sha: string` - `stats: object { additions, deletions, total }` - `additions: number` - `deletions: number` - `total: number` - `tree_oid: string` - `completed: object { commit, completed_at, conclusion, merge_conflict_pr }` deprecated - `commit: Commit` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `status: "completed"` - `"completed"` - `install_url: string` - `object: "build_target"` - `"build_target"` - `status: "not_started" or "codegen" or "postgen" or "completed"` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: optional CheckStep` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` - `lint: optional CheckStep` - `test: optional CheckStep` - `csharp: optional BuildTarget` - `go: optional BuildTarget` - `java: optional BuildTarget` - `kotlin: optional BuildTarget` - `node: optional BuildTarget` - `openapi: optional BuildTarget` - `php: optional BuildTarget` - `python: optional BuildTarget` - `ruby: optional BuildTarget` - `sql: optional BuildTarget` - `terraform: optional BuildTarget` - `typescript: optional BuildTarget` - `updated_at: string` ### Example ```http curl https://api.stainless.com/v0/builds/$BUILD_ID \ -H "Authorization: Bearer $STAINLESS_API_KEY" ``` #### Response ```json { "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" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" } ``` ## Creates two comparable builds **post** `/v0/builds/compare` Create two builds whose outputs can be directly compared with each other. Created builds _modify_ their project branches so that their latest sets of config files point to the ones specified by the input revision. This endpoint is useful because a build has more inputs than the set of config files it uses, so comparing two builds directly may return spurious differences. Builds made via this endpoint are guaranteed to have differences arising from the set of config files, and any custom code. ### Body Parameters - `base: object { branch, revision, commit_message }` Parameters for the base build - `branch: string` Branch to use. When using a branch name as revision, this must match or be omitted. - `revision: string or map[FileInput]` Specifies what to build: a branch name, a commit SHA, or file contents. - `string` A branch name, commit SHA, or merge command in the format "base..head" - `map[FileInput]` File contents to commit directly - `Content = object { content }` - `content: string` File content - `URL = object { url }` - `url: string` URL to fetch file content from - `commit_message: optional string` Optional commit message to use when creating a new commit. - `head: object { branch, revision, commit_message }` Parameters for the head build - `branch: string` Branch to use. When using a branch name as revision, this must match or be omitted. - `revision: string or map[FileInput]` Specifies what to build: a branch name, a commit SHA, or file contents. - `string` A branch name, commit SHA, or merge command in the format "base..head" - `map[FileInput]` File contents to commit directly - `Content = object { content }` - `URL = object { url }` - `commit_message: optional string` Optional commit message to use when creating a new commit. - `project: optional string` Project name - `targets: optional array of Target` Optional list of SDK targets to build. If not specified, all configured targets will be built. - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` ### Returns - `base: Build` - `id: string` Build ID - `config_commit: string` - `created_at: string` - `documented_spec: object { content, type } or object { expires, type, url }` - `object { content, type }` - `content: string` - `type: "content"` - `"content"` - `object { expires, type, url }` - `expires: string` - `type: "url"` - `"url"` - `url: string` - `object: "build"` - `"build"` - `org: string` - `project: string` - `targets: object { cli, csharp, go, 10 more }` - `cli: optional BuildTarget` - `commit: object { status } or object { status } or object { status } or object { commit, completed, completed_at, 3 more }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status }` - `status: "queued"` - `"queued"` - `InProgress = object { status }` - `status: "in_progress"` - `"in_progress"` - `Completed = object { commit, completed, completed_at, 3 more }` - `commit: Commit` - `repo: object { branch, host, name, owner }` - `branch: string` - `host: string` - `name: string` - `owner: string` - `sha: string` - `stats: object { additions, deletions, total }` - `additions: number` - `deletions: number` - `total: number` - `tree_oid: string` - `completed: object { commit, completed_at, conclusion, merge_conflict_pr }` deprecated - `commit: Commit` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `status: "completed"` - `"completed"` - `install_url: string` - `object: "build_target"` - `"build_target"` - `status: "not_started" or "codegen" or "postgen" or "completed"` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: optional CheckStep` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` - `lint: optional CheckStep` - `test: optional CheckStep` - `csharp: optional BuildTarget` - `go: optional BuildTarget` - `java: optional BuildTarget` - `kotlin: optional BuildTarget` - `node: optional BuildTarget` - `openapi: optional BuildTarget` - `php: optional BuildTarget` - `python: optional BuildTarget` - `ruby: optional BuildTarget` - `sql: optional BuildTarget` - `terraform: optional BuildTarget` - `typescript: optional BuildTarget` - `updated_at: string` - `head: Build` ### Example ```http curl https://api.stainless.com/v0/builds/compare \ -H 'Content-Type: application/json' \ -H "Authorization: Bearer $STAINLESS_API_KEY" \ -d '{ "base": { "branch": "branch", "revision": "string" }, "head": { "branch": "branch", "revision": "string" }, "project": "project" }' ``` #### Response ```json { "base": { "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" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" }, "head": { "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" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "csharp": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "go": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "java": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "kotlin": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "node": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "openapi": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "php": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "python": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "ruby": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "sql": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "terraform": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } }, "typescript": { "commit": { "status": "not_started" }, "install_url": "install_url", "object": "build_target", "status": "not_started", "build": { "status": "not_started" }, "lint": { "status": "not_started" }, "test": { "status": "not_started" } } }, "updated_at": "2019-12-27T18:11:19.117Z" } } ``` ## Domain Types ### Build - `Build = object { id, config_commit, created_at, 6 more }` - `id: string` Build ID - `config_commit: string` - `created_at: string` - `documented_spec: object { content, type } or object { expires, type, url }` - `object { content, type }` - `content: string` - `type: "content"` - `"content"` - `object { expires, type, url }` - `expires: string` - `type: "url"` - `"url"` - `url: string` - `object: "build"` - `"build"` - `org: string` - `project: string` - `targets: object { cli, csharp, go, 10 more }` - `cli: optional BuildTarget` - `commit: object { status } or object { status } or object { status } or object { commit, completed, completed_at, 3 more }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status }` - `status: "queued"` - `"queued"` - `InProgress = object { status }` - `status: "in_progress"` - `"in_progress"` - `Completed = object { commit, completed, completed_at, 3 more }` - `commit: Commit` - `repo: object { branch, host, name, owner }` - `branch: string` - `host: string` - `name: string` - `owner: string` - `sha: string` - `stats: object { additions, deletions, total }` - `additions: number` - `deletions: number` - `total: number` - `tree_oid: string` - `completed: object { commit, completed_at, conclusion, merge_conflict_pr }` deprecated - `commit: Commit` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `status: "completed"` - `"completed"` - `install_url: string` - `object: "build_target"` - `"build_target"` - `status: "not_started" or "codegen" or "postgen" or "completed"` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: optional CheckStep` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` - `lint: optional CheckStep` - `test: optional CheckStep` - `csharp: optional BuildTarget` - `go: optional BuildTarget` - `java: optional BuildTarget` - `kotlin: optional BuildTarget` - `node: optional BuildTarget` - `openapi: optional BuildTarget` - `php: optional BuildTarget` - `python: optional BuildTarget` - `ruby: optional BuildTarget` - `sql: optional BuildTarget` - `terraform: optional BuildTarget` - `typescript: optional BuildTarget` - `updated_at: string` ### Build Target - `BuildTarget = object { commit, install_url, object, 4 more }` - `commit: object { status } or object { status } or object { status } or object { commit, completed, completed_at, 3 more }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status }` - `status: "queued"` - `"queued"` - `InProgress = object { status }` - `status: "in_progress"` - `"in_progress"` - `Completed = object { commit, completed, completed_at, 3 more }` - `commit: Commit` - `repo: object { branch, host, name, owner }` - `branch: string` - `host: string` - `name: string` - `owner: string` - `sha: string` - `stats: object { additions, deletions, total }` - `additions: number` - `deletions: number` - `total: number` - `tree_oid: string` - `completed: object { commit, completed_at, conclusion, merge_conflict_pr }` deprecated - `commit: Commit` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `status: "completed"` - `"completed"` - `install_url: string` - `object: "build_target"` - `"build_target"` - `status: "not_started" or "codegen" or "postgen" or "completed"` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: optional CheckStep` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` - `lint: optional CheckStep` - `test: optional CheckStep` ### Check Step - `CheckStep = object { status } or object { status, url } or object { status, url } or object { completed, conclusion, status, url }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` ### Build Compare Response - `BuildCompareResponse = object { base, head }` - `base: Build` - `id: string` Build ID - `config_commit: string` - `created_at: string` - `documented_spec: object { content, type } or object { expires, type, url }` - `object { content, type }` - `content: string` - `type: "content"` - `"content"` - `object { expires, type, url }` - `expires: string` - `type: "url"` - `"url"` - `url: string` - `object: "build"` - `"build"` - `org: string` - `project: string` - `targets: object { cli, csharp, go, 10 more }` - `cli: optional BuildTarget` - `commit: object { status } or object { status } or object { status } or object { commit, completed, completed_at, 3 more }` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status }` - `status: "queued"` - `"queued"` - `InProgress = object { status }` - `status: "in_progress"` - `"in_progress"` - `Completed = object { commit, completed, completed_at, 3 more }` - `commit: Commit` - `repo: object { branch, host, name, owner }` - `branch: string` - `host: string` - `name: string` - `owner: string` - `sha: string` - `stats: object { additions, deletions, total }` - `additions: number` - `deletions: number` - `total: number` - `tree_oid: string` - `completed: object { commit, completed_at, conclusion, merge_conflict_pr }` deprecated - `commit: Commit` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `completed_at: string` - `conclusion: "error" or "warning" or "note" or 9 more` - `"error"` - `"warning"` - `"note"` - `"success"` - `"merge_conflict"` - `"upstream_merge_conflict"` - `"fatal"` - `"payment_required"` - `"cancelled"` - `"timed_out"` - `"noop"` - `"version_bump"` - `merge_conflict_pr: object { number, repo }` - `number: number` - `repo: object { host, name, owner }` - `host: string` - `name: string` - `owner: string` - `status: "completed"` - `"completed"` - `install_url: string` - `object: "build_target"` - `"build_target"` - `status: "not_started" or "codegen" or "postgen" or "completed"` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: optional CheckStep` - `NotStarted = object { status }` - `status: "not_started"` - `"not_started"` - `Queued = object { status, url }` - `status: "queued"` - `"queued"` - `url: string` - `InProgress = object { status, url }` - `status: "in_progress"` - `"in_progress"` - `url: string` - `Completed = object { completed, conclusion, status, url }` - `completed: object { conclusion, url }` deprecated - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: string` - `conclusion: "success" or "failure" or "skipped" or 4 more` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: "completed"` - `"completed"` - `url: string` - `lint: optional CheckStep` - `test: optional CheckStep` - `csharp: optional BuildTarget` - `go: optional BuildTarget` - `java: optional BuildTarget` - `kotlin: optional BuildTarget` - `node: optional BuildTarget` - `openapi: optional BuildTarget` - `php: optional BuildTarget` - `python: optional BuildTarget` - `ruby: optional BuildTarget` - `sql: optional BuildTarget` - `terraform: optional BuildTarget` - `typescript: optional BuildTarget` - `updated_at: string` - `head: Build` # Diagnostics ## Get diagnostics for a build **get** `/v0/builds/{buildId}/diagnostics` Get the list of diagnostics for a given build. If no language targets are specified, diagnostics for all languages are returned. ### Path Parameters - `buildId: string` Build ID ### Query Parameters - `cursor: optional string` Pagination cursor from a previous response - `limit: optional number` Maximum number of diagnostics to return, defaults to 100 (maximum: 100) - `severity: optional "fatal" or "error" or "warning" or "note"` Includes the given severity and above (fatal > error > warning > note). - `"fatal"` - `"error"` - `"warning"` - `"note"` - `targets: optional string` Optional comma-delimited list of language targets to filter diagnostics by ### Returns - `data: array of BuildDiagnostic` - `code: string` The kind of diagnostic. - `ignored: boolean` Whether the diagnostic is ignored in the Stainless config. - `level: "fatal" or "error" or "warning" or "note"` The severity of the diagnostic. - `"fatal"` - `"error"` - `"warning"` - `"note"` - `message: string` A description of the diagnostic. - `more: BuildDiagnosticMore` - `Markdown = object { markdown, type }` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw = object { raw, type }` - `raw: string` - `type: "raw"` - `"raw"` - `config_ref: optional string` A JSON pointer to a relevant field in the Stainless config. - `oas_ref: optional string` A JSON pointer to a relevant field in the OpenAPI spec. - `has_more: boolean` - `next_cursor: optional string` ### Example ```http curl https://api.stainless.com/v0/builds/$BUILD_ID/diagnostics \ -H "Authorization: Bearer $STAINLESS_API_KEY" ``` #### Response ```json { "data": [ { "code": "code", "ignored": true, "level": "fatal", "message": "message", "more": { "markdown": "markdown", "type": "markdown" }, "config_ref": "config_ref", "oas_ref": "oas_ref" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Domain Types ### Build Diagnostic - `BuildDiagnostic = object { code, ignored, level, 4 more }` - `code: string` The kind of diagnostic. - `ignored: boolean` Whether the diagnostic is ignored in the Stainless config. - `level: "fatal" or "error" or "warning" or "note"` The severity of the diagnostic. - `"fatal"` - `"error"` - `"warning"` - `"note"` - `message: string` A description of the diagnostic. - `more: BuildDiagnosticMore` - `Markdown = object { markdown, type }` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw = object { raw, type }` - `raw: string` - `type: "raw"` - `"raw"` - `config_ref: optional string` A JSON pointer to a relevant field in the Stainless config. - `oas_ref: optional string` A JSON pointer to a relevant field in the OpenAPI spec. ### Build Diagnostic More - `BuildDiagnosticMore = object { markdown, type } or object { raw, type }` - `Markdown = object { markdown, type }` - `markdown: string` - `type: "markdown"` - `"markdown"` - `Raw = object { raw, type }` - `raw: string` - `type: "raw"` - `"raw"` # Target Outputs ## Download build target output **get** `/v0/build_target_outputs` Retrieve a method to download an output for a given build target. If the requested type of output is `source`, and the requested output method is `url`, a download link to a tarball of the source files is returned. If the requested output method is `git`, a Git remote, ref, and access token (if necessary) is returned. Otherwise, the possible types of outputs are specific to the requested target, and the output method _must_ be `url`. See the documentation for `type` for more information. ### Query Parameters - `build_id: string` Build ID - `target: "node" or "typescript" or "python" or 10 more` SDK language target name - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` - `type: "source" or "dist" or "wheel" or 4 more` - `"source"` - `"dist"` - `"wheel"` - `"openapi-with-transforms"` - `"openapi-with-code-samples"` - `"openapi-sdk-spec"` - `"file"` - `output: optional "url" or "git"` Output format: url (download URL) or git (temporary access token). - `"url"` - `"git"` - `path: optional string` The path of the file to get when used with "type": "file". ### Returns - `URL = object { output, target, type, 2 more }` - `output: "url"` - `"url"` - `target: Target` - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` - `type: "source" or "dist" or "wheel" or 4 more` - `"source"` - `"dist"` - `"wheel"` - `"openapi-with-transforms"` - `"openapi-with-code-samples"` - `"openapi-sdk-spec"` - `"file"` - `url: string` URL for direct download - `path: optional string` The path of the file, which is only present when using with the type "file" option. - `Git = object { token, output, ref, 3 more }` - `token: string` Temporary GitHub access token - `output: "git"` - `"git"` - `ref: string` Git reference (commit SHA, branch, or tag) - `target: Target` - `type: "source" or "dist" or "wheel" or 4 more` - `"source"` - `"dist"` - `"wheel"` - `"openapi-with-transforms"` - `"openapi-with-code-samples"` - `"openapi-sdk-spec"` - `"file"` - `url: string` URL to git remote ### Example ```http curl https://api.stainless.com/v0/build_target_outputs \ -H "Authorization: Bearer $STAINLESS_API_KEY" ``` #### Response ```json { "output": "url", "target": "node", "type": "source", "url": "url", "path": "path" } ``` ## Domain Types ### Target Output Retrieve Response - `TargetOutputRetrieveResponse = object { output, target, type, 2 more } or object { token, output, ref, 3 more }` - `URL = object { output, target, type, 2 more }` - `output: "url"` - `"url"` - `target: Target` - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` - `type: "source" or "dist" or "wheel" or 4 more` - `"source"` - `"dist"` - `"wheel"` - `"openapi-with-transforms"` - `"openapi-with-code-samples"` - `"openapi-sdk-spec"` - `"file"` - `url: string` URL for direct download - `path: optional string` The path of the file, which is only present when using with the type "file" option. - `Git = object { token, output, ref, 3 more }` - `token: string` Temporary GitHub access token - `output: "git"` - `"git"` - `ref: string` Git reference (commit SHA, branch, or tag) - `target: Target` - `type: "source" or "dist" or "wheel" or 4 more` - `"source"` - `"dist"` - `"wheel"` - `"openapi-with-transforms"` - `"openapi-with-code-samples"` - `"openapi-sdk-spec"` - `"file"` - `url: string` URL to git remote