# Projects ## Retrieve project `projects.retrieve(**kwargs) -> Project` **get** `/v0/projects/{project}` Retrieve a project by name. ### Parameters - `project: String` ### Returns - `class Project` A project is a collection of SDKs generated from the same set of config files. - `config_repo: String` - `display_name: String` - `object: :project` - `:project` - `org: String` - `slug: String` - `targets: Array[Target]` - `:node` - `:typescript` - `:python` - `:go` - `:java` - `:kotlin` - `:ruby` - `:terraform` - `:cli` - `:php` - `:csharp` - `:sql` - `:openapi` ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) project = stainless.projects.retrieve(project: "project") puts(project) ``` #### Response ```json { "config_repo": "config_repo", "display_name": "display_name", "object": "project", "org": "org", "slug": "slug", "targets": [ "node" ] } ``` ## Update project `projects.update(**kwargs) -> Project` **patch** `/v0/projects/{project}` Update a project's properties. ### Parameters - `project: String` - `display_name: String` ### Returns - `class Project` A project is a collection of SDKs generated from the same set of config files. - `config_repo: String` - `display_name: String` - `object: :project` - `:project` - `org: String` - `slug: String` - `targets: Array[Target]` - `:node` - `:typescript` - `:python` - `:go` - `:java` - `:kotlin` - `:ruby` - `:terraform` - `:cli` - `:php` - `:csharp` - `:sql` - `:openapi` ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) project = stainless.projects.update(project: "project") puts(project) ``` #### Response ```json { "config_repo": "config_repo", "display_name": "display_name", "object": "project", "org": "org", "slug": "slug", "targets": [ "node" ] } ``` ## List projects `projects.list(**kwargs) -> Page` **get** `/v0/projects` List projects in an organization, from oldest to newest. ### Parameters - `cursor: String` Pagination cursor from a previous response - `limit: Float` Maximum number of projects to return, defaults to 10 (maximum: 100). - `org: String` ### Returns - `class Project` A project is a collection of SDKs generated from the same set of config files. - `config_repo: String` - `display_name: String` - `object: :project` - `:project` - `org: String` - `slug: String` - `targets: Array[Target]` - `:node` - `:typescript` - `:python` - `:go` - `:java` - `:kotlin` - `:ruby` - `:terraform` - `:cli` - `:php` - `:csharp` - `:sql` - `:openapi` ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) page = stainless.projects.list puts(page) ``` #### Response ```json { "data": [ { "config_repo": "config_repo", "display_name": "display_name", "object": "project", "org": "org", "slug": "slug", "targets": [ "node" ] } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Create project `projects.create(**kwargs) -> Project` **post** `/v0/projects` Create a new project. ### Parameters - `display_name: String` Human-readable project name - `org: String` Organization name - `revision: Hash[Symbol, FileInput]` File contents to commit - `class Content` - `content: String` File content - `class URL` - `url: String` URL to fetch file content from - `slug: String` Project name/slug - `targets: Array[Target]` Targets to generate for - `:node` - `:typescript` - `:python` - `:go` - `:java` - `:kotlin` - `:ruby` - `:terraform` - `:cli` - `:php` - `:csharp` - `:sql` - `:openapi` ### Returns - `class Project` A project is a collection of SDKs generated from the same set of config files. - `config_repo: String` - `display_name: String` - `object: :project` - `:project` - `org: String` - `slug: String` - `targets: Array[Target]` - `:node` - `:typescript` - `:python` - `:go` - `:java` - `:kotlin` - `:ruby` - `:terraform` - `:cli` - `:php` - `:csharp` - `:sql` - `:openapi` ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) project = stainless.projects.create( display_name: "display_name", org: "org", revision: {foo: {content: "content"}}, slug: "slug", targets: [:node] ) puts(project) ``` #### Response ```json { "config_repo": "config_repo", "display_name": "display_name", "object": "project", "org": "org", "slug": "slug", "targets": [ "node" ] } ``` ## Generate an AI commit message for a specific SDK `projects.generate_commit_message(**kwargs) -> ProjectGenerateCommitMessageResponse` **post** `/v0/projects/{project}/generate_commit_message` Generates an AI commit message by comparing two git refs in the SDK repository. ### Parameters - `project: String` - `target: :python | :node | :typescript | 10 more` Language target - `:python` - `:node` - `:typescript` - `:java` - `:kotlin` - `:go` - `:ruby` - `:terraform` - `:cli` - `:csharp` - `:php` - `:openapi` - `:sql` - `base_ref: String` Base ref for comparison - `head_ref: String` Head ref for comparison ### Returns - `class ProjectGenerateCommitMessageResponse` - `ai_commit_message: String` ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) response = stainless.projects.generate_commit_message( project: "project", target: :python, base_ref: "base_ref", head_ref: "head_ref" ) puts(response) ``` #### Response ```json { "ai_commit_message": "ai_commit_message" } ``` ## Domain Types ### Project - `class Project` A project is a collection of SDKs generated from the same set of config files. - `config_repo: String` - `display_name: String` - `object: :project` - `:project` - `org: String` - `slug: String` - `targets: Array[Target]` - `:node` - `:typescript` - `:python` - `:go` - `:java` - `:kotlin` - `:ruby` - `:terraform` - `:cli` - `:php` - `:csharp` - `:sql` - `:openapi` ### Project Generate Commit Message Response - `class ProjectGenerateCommitMessageResponse` - `ai_commit_message: String` # Branches ## Create a new project branch `projects.branches.create(**kwargs) -> ProjectBranch` **post** `/v0/projects/{project}/branches` Create a new branch for a project. The branch inherits the config files from the revision pointed to by the `branch_from` parameter. In addition, if the revision is a branch name, the branch will also inherit custom code changes from that branch. ### Parameters - `project: String` - `branch: String` Branch name - `branch_from: String` Branch or commit SHA to branch from - `force: bool` Whether to throw an error if the branch already exists. Defaults to false. ### Returns - `class ProjectBranch` A project branch names a line of development for a project. Like a Git branch, it points to a Git commit with a set of config files. In addition, a project branch also points to a set of custom code changes, corresponding to Git branches in the staging repos. - `branch: String` Branch name - `config_commit: { repo, sha, stats, tree_oid}` A Git commit that points to the latest set of config files on a given branch. - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `latest_build: Build` - `id: String` Build ID - `config_commit: String` - `created_at: Time` - `documented_spec: { content, type} | { expires, type, url}` - `class UnionMember0` - `content: String` - `type: :content` - `:content` - `class UnionMember1` - `expires: Time` - `type: :url` - `:url` - `url: String` - `object: :build` - `:build` - `org: String` - `project: String` - `targets: { cli, csharp, go, 10 more}` - `cli: BuildTarget` - `commit: { status} | { status} | { status} | { commit, completed, completed_at, 3 more}` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `class InProgress` - `status: :in_progress` - `:in_progress` - `class Completed` - `commit: Commit` - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `completed: { commit, completed_at, conclusion, merge_conflict_pr}` deprecated - `commit: Commit` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `status: :completed` - `:completed` - `install_url: String` - `object: :build_target` - `:build_target` - `status: :not_started | :codegen | :postgen | :completed` - `:not_started` - `:codegen` - `:postgen` - `:completed` - `build: CheckStep` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `url: String` - `class InProgress` - `status: :in_progress` - `:in_progress` - `url: String` - `class Completed` - `completed: { conclusion, url}` deprecated - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `url: String` - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `status: :completed` - `:completed` - `url: String` - `lint: CheckStep` - `test_: CheckStep` - `csharp: BuildTarget` - `go: BuildTarget` - `java: BuildTarget` - `kotlin: BuildTarget` - `node: BuildTarget` - `openapi: BuildTarget` - `php: BuildTarget` - `python: BuildTarget` - `ruby: BuildTarget` - `sql: BuildTarget` - `terraform: BuildTarget` - `typescript: BuildTarget` - `updated_at: Time` - `object: :project_branch` - `:project_branch` - `org: String` - `project: String` Project name ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) project_branch = stainless.projects.branches.create(project: "project", branch: "branch", branch_from: "branch_from") puts(project_branch) ``` #### Response ```json { "branch": "branch", "config_commit": { "repo": { "branch": "branch", "host": "host", "name": "name", "owner": "owner" }, "sha": "sha", "stats": { "additions": 0, "deletions": 0, "total": 0 }, "tree_oid": "tree_oid" }, "latest_build": { "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" }, "object": "project_branch", "org": "org", "project": "project" } ``` ## Retrieve a project branch `projects.branches.retrieve(branch, **kwargs) -> ProjectBranch` **get** `/v0/projects/{project}/branches/{branch}` Retrieve a project branch by name. ### Parameters - `project: String` - `branch: String` ### Returns - `class ProjectBranch` A project branch names a line of development for a project. Like a Git branch, it points to a Git commit with a set of config files. In addition, a project branch also points to a set of custom code changes, corresponding to Git branches in the staging repos. - `branch: String` Branch name - `config_commit: { repo, sha, stats, tree_oid}` A Git commit that points to the latest set of config files on a given branch. - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `latest_build: Build` - `id: String` Build ID - `config_commit: String` - `created_at: Time` - `documented_spec: { content, type} | { expires, type, url}` - `class UnionMember0` - `content: String` - `type: :content` - `:content` - `class UnionMember1` - `expires: Time` - `type: :url` - `:url` - `url: String` - `object: :build` - `:build` - `org: String` - `project: String` - `targets: { cli, csharp, go, 10 more}` - `cli: BuildTarget` - `commit: { status} | { status} | { status} | { commit, completed, completed_at, 3 more}` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `class InProgress` - `status: :in_progress` - `:in_progress` - `class Completed` - `commit: Commit` - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `completed: { commit, completed_at, conclusion, merge_conflict_pr}` deprecated - `commit: Commit` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `status: :completed` - `:completed` - `install_url: String` - `object: :build_target` - `:build_target` - `status: :not_started | :codegen | :postgen | :completed` - `:not_started` - `:codegen` - `:postgen` - `:completed` - `build: CheckStep` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `url: String` - `class InProgress` - `status: :in_progress` - `:in_progress` - `url: String` - `class Completed` - `completed: { conclusion, url}` deprecated - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `url: String` - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `status: :completed` - `:completed` - `url: String` - `lint: CheckStep` - `test_: CheckStep` - `csharp: BuildTarget` - `go: BuildTarget` - `java: BuildTarget` - `kotlin: BuildTarget` - `node: BuildTarget` - `openapi: BuildTarget` - `php: BuildTarget` - `python: BuildTarget` - `ruby: BuildTarget` - `sql: BuildTarget` - `terraform: BuildTarget` - `typescript: BuildTarget` - `updated_at: Time` - `object: :project_branch` - `:project_branch` - `org: String` - `project: String` Project name ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) project_branch = stainless.projects.branches.retrieve("branch", project: "project") puts(project_branch) ``` #### Response ```json { "branch": "branch", "config_commit": { "repo": { "branch": "branch", "host": "host", "name": "name", "owner": "owner" }, "sha": "sha", "stats": { "additions": 0, "deletions": 0, "total": 0 }, "tree_oid": "tree_oid" }, "latest_build": { "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" }, "object": "project_branch", "org": "org", "project": "project" } ``` ## List project branches `projects.branches.list(**kwargs) -> Page` **get** `/v0/projects/{project}/branches` Retrieve a project branch by name. ### Parameters - `project: String` - `cursor: String` Pagination cursor from a previous response - `limit: Float` Maximum number of items to return, defaults to 10 (maximum: 100). ### Returns - `class BranchListResponse` A project branch names a line of development for a project. Like a Git branch, it points to a Git commit with a set of config files. In addition, a project branch also points to a set of custom code changes, corresponding to Git branches in the staging repos. - `branch: String` Branch name - `config_commit: { repo, sha, stats, tree_oid}` A Git commit that points to the latest set of config files on a given branch. - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `latest_build_id: String` - `object: :project_branch` - `:project_branch` - `org: String` - `project: String` Project name ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) page = stainless.projects.branches.list(project: "project") puts(page) ``` #### Response ```json { "data": [ { "branch": "branch", "config_commit": { "repo": { "branch": "branch", "host": "host", "name": "name", "owner": "owner" }, "sha": "sha", "stats": { "additions": 0, "deletions": 0, "total": 0 }, "tree_oid": "tree_oid" }, "latest_build_id": "latest_build_id", "object": "project_branch", "org": "org", "project": "project" } ], "has_more": true, "next_cursor": "next_cursor" } ``` ## Delete a project branch `projects.branches.delete(branch, **kwargs) -> BranchDeleteResponse` **delete** `/v0/projects/{project}/branches/{branch}` Delete a project branch by name. ### Parameters - `project: String` - `branch: String` ### Returns - `untyped` ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) branch = stainless.projects.branches.delete("branch", project: "project") puts(branch) ``` #### Response ```json {} ``` ## Rebase a project branch `projects.branches.rebase(branch, **kwargs) -> ProjectBranch` **put** `/v0/projects/{project}/branches/{branch}/rebase` Rebase a project branch. The branch is rebased onto the `base` branch or commit SHA, inheriting any config and custom code changes. ### Parameters - `project: String` - `branch: String` - `base: String` The branch or commit SHA to rebase onto. Defaults to "main". ### Returns - `class ProjectBranch` A project branch names a line of development for a project. Like a Git branch, it points to a Git commit with a set of config files. In addition, a project branch also points to a set of custom code changes, corresponding to Git branches in the staging repos. - `branch: String` Branch name - `config_commit: { repo, sha, stats, tree_oid}` A Git commit that points to the latest set of config files on a given branch. - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `latest_build: Build` - `id: String` Build ID - `config_commit: String` - `created_at: Time` - `documented_spec: { content, type} | { expires, type, url}` - `class UnionMember0` - `content: String` - `type: :content` - `:content` - `class UnionMember1` - `expires: Time` - `type: :url` - `:url` - `url: String` - `object: :build` - `:build` - `org: String` - `project: String` - `targets: { cli, csharp, go, 10 more}` - `cli: BuildTarget` - `commit: { status} | { status} | { status} | { commit, completed, completed_at, 3 more}` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `class InProgress` - `status: :in_progress` - `:in_progress` - `class Completed` - `commit: Commit` - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `completed: { commit, completed_at, conclusion, merge_conflict_pr}` deprecated - `commit: Commit` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `status: :completed` - `:completed` - `install_url: String` - `object: :build_target` - `:build_target` - `status: :not_started | :codegen | :postgen | :completed` - `:not_started` - `:codegen` - `:postgen` - `:completed` - `build: CheckStep` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `url: String` - `class InProgress` - `status: :in_progress` - `:in_progress` - `url: String` - `class Completed` - `completed: { conclusion, url}` deprecated - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `url: String` - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `status: :completed` - `:completed` - `url: String` - `lint: CheckStep` - `test_: CheckStep` - `csharp: BuildTarget` - `go: BuildTarget` - `java: BuildTarget` - `kotlin: BuildTarget` - `node: BuildTarget` - `openapi: BuildTarget` - `php: BuildTarget` - `python: BuildTarget` - `ruby: BuildTarget` - `sql: BuildTarget` - `terraform: BuildTarget` - `typescript: BuildTarget` - `updated_at: Time` - `object: :project_branch` - `:project_branch` - `org: String` - `project: String` Project name ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) project_branch = stainless.projects.branches.rebase("branch", project: "project") puts(project_branch) ``` #### Response ```json { "branch": "branch", "config_commit": { "repo": { "branch": "branch", "host": "host", "name": "name", "owner": "owner" }, "sha": "sha", "stats": { "additions": 0, "deletions": 0, "total": 0 }, "tree_oid": "tree_oid" }, "latest_build": { "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" }, "object": "project_branch", "org": "org", "project": "project" } ``` ## Reset `projects.branches.reset(branch, **kwargs) -> ProjectBranch` **put** `/v0/projects/{project}/branches/{branch}/reset` Reset a project branch. If `branch` === `main`, the branch is reset to `target_config_sha`. Otherwise, the branch is reset to `main`. ### Parameters - `project: String` - `branch: String` - `target_config_sha: String` The commit SHA to reset the main branch to. Required if resetting the main branch; disallowed otherwise. ### Returns - `class ProjectBranch` A project branch names a line of development for a project. Like a Git branch, it points to a Git commit with a set of config files. In addition, a project branch also points to a set of custom code changes, corresponding to Git branches in the staging repos. - `branch: String` Branch name - `config_commit: { repo, sha, stats, tree_oid}` A Git commit that points to the latest set of config files on a given branch. - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `latest_build: Build` - `id: String` Build ID - `config_commit: String` - `created_at: Time` - `documented_spec: { content, type} | { expires, type, url}` - `class UnionMember0` - `content: String` - `type: :content` - `:content` - `class UnionMember1` - `expires: Time` - `type: :url` - `:url` - `url: String` - `object: :build` - `:build` - `org: String` - `project: String` - `targets: { cli, csharp, go, 10 more}` - `cli: BuildTarget` - `commit: { status} | { status} | { status} | { commit, completed, completed_at, 3 more}` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `class InProgress` - `status: :in_progress` - `:in_progress` - `class Completed` - `commit: Commit` - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `completed: { commit, completed_at, conclusion, merge_conflict_pr}` deprecated - `commit: Commit` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `status: :completed` - `:completed` - `install_url: String` - `object: :build_target` - `:build_target` - `status: :not_started | :codegen | :postgen | :completed` - `:not_started` - `:codegen` - `:postgen` - `:completed` - `build: CheckStep` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `url: String` - `class InProgress` - `status: :in_progress` - `:in_progress` - `url: String` - `class Completed` - `completed: { conclusion, url}` deprecated - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `url: String` - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `status: :completed` - `:completed` - `url: String` - `lint: CheckStep` - `test_: CheckStep` - `csharp: BuildTarget` - `go: BuildTarget` - `java: BuildTarget` - `kotlin: BuildTarget` - `node: BuildTarget` - `openapi: BuildTarget` - `php: BuildTarget` - `python: BuildTarget` - `ruby: BuildTarget` - `sql: BuildTarget` - `terraform: BuildTarget` - `typescript: BuildTarget` - `updated_at: Time` - `object: :project_branch` - `:project_branch` - `org: String` - `project: String` Project name ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) project_branch = stainless.projects.branches.reset("branch", project: "project") puts(project_branch) ``` #### Response ```json { "branch": "branch", "config_commit": { "repo": { "branch": "branch", "host": "host", "name": "name", "owner": "owner" }, "sha": "sha", "stats": { "additions": 0, "deletions": 0, "total": 0 }, "tree_oid": "tree_oid" }, "latest_build": { "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" }, "object": "project_branch", "org": "org", "project": "project" } ``` ## Domain Types ### Project Branch - `class ProjectBranch` A project branch names a line of development for a project. Like a Git branch, it points to a Git commit with a set of config files. In addition, a project branch also points to a set of custom code changes, corresponding to Git branches in the staging repos. - `branch: String` Branch name - `config_commit: { repo, sha, stats, tree_oid}` A Git commit that points to the latest set of config files on a given branch. - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `latest_build: Build` - `id: String` Build ID - `config_commit: String` - `created_at: Time` - `documented_spec: { content, type} | { expires, type, url}` - `class UnionMember0` - `content: String` - `type: :content` - `:content` - `class UnionMember1` - `expires: Time` - `type: :url` - `:url` - `url: String` - `object: :build` - `:build` - `org: String` - `project: String` - `targets: { cli, csharp, go, 10 more}` - `cli: BuildTarget` - `commit: { status} | { status} | { status} | { commit, completed, completed_at, 3 more}` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `class InProgress` - `status: :in_progress` - `:in_progress` - `class Completed` - `commit: Commit` - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `completed: { commit, completed_at, conclusion, merge_conflict_pr}` deprecated - `commit: Commit` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `completed_at: Time` - `conclusion: :error | :warning | :note | 9 more` - `:error` - `:warning` - `:note` - `:success` - `:merge_conflict` - `:upstream_merge_conflict` - `:fatal` - `:payment_required` - `:cancelled` - `:timed_out` - `:noop` - `:version_bump` - `merge_conflict_pr: { number, repo}` - `number: Float` - `repo: { host, name, owner}` - `host: String` - `name: String` - `owner: String` - `status: :completed` - `:completed` - `install_url: String` - `object: :build_target` - `:build_target` - `status: :not_started | :codegen | :postgen | :completed` - `:not_started` - `:codegen` - `:postgen` - `:completed` - `build: CheckStep` - `class NotStarted` - `status: :not_started` - `:not_started` - `class Queued` - `status: :queued` - `:queued` - `url: String` - `class InProgress` - `status: :in_progress` - `:in_progress` - `url: String` - `class Completed` - `completed: { conclusion, url}` deprecated - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `url: String` - `conclusion: :success | :failure | :skipped | 4 more` - `:success` - `:failure` - `:skipped` - `:cancelled` - `:action_required` - `:neutral` - `:timed_out` - `status: :completed` - `:completed` - `url: String` - `lint: CheckStep` - `test_: CheckStep` - `csharp: BuildTarget` - `go: BuildTarget` - `java: BuildTarget` - `kotlin: BuildTarget` - `node: BuildTarget` - `openapi: BuildTarget` - `php: BuildTarget` - `python: BuildTarget` - `ruby: BuildTarget` - `sql: BuildTarget` - `terraform: BuildTarget` - `typescript: BuildTarget` - `updated_at: Time` - `object: :project_branch` - `:project_branch` - `org: String` - `project: String` Project name ### Branch List Response - `class BranchListResponse` A project branch names a line of development for a project. Like a Git branch, it points to a Git commit with a set of config files. In addition, a project branch also points to a set of custom code changes, corresponding to Git branches in the staging repos. - `branch: String` Branch name - `config_commit: { repo, sha, stats, tree_oid}` A Git commit that points to the latest set of config files on a given branch. - `repo: { branch, host, name, owner}` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: { additions, deletions, total}` - `additions: Integer` - `deletions: Integer` - `total: Integer` - `tree_oid: String` - `latest_build_id: String` - `object: :project_branch` - `:project_branch` - `org: String` - `project: String` Project name ### Branch Delete Response - `untyped` # Configs ## Retrieve configuration files `projects.configs.retrieve(**kwargs) -> ConfigRetrieveResponse` **get** `/v0/projects/{project}/configs` Retrieve the configuration files for a given project. ### Parameters - `project: String` - `branch: String` Branch name, defaults to "main". - `include: String` ### Returns - `Hash[Symbol, { content}]` Config files contents - `content: String` The file content ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) config = stainless.projects.configs.retrieve(project: "project") puts(config) ``` #### Response ```json { "foo": { "content": "content" } } ``` ## Generate config suggestions `projects.configs.guess(**kwargs) -> ConfigGuessResponse` **post** `/v0/projects/{project}/configs/guess` Generate suggestions for changes to config files based on an OpenAPI spec. ### Parameters - `project: String` - `spec: String` OpenAPI spec - `branch: String` Branch name ### Returns - `Hash[Symbol, { content}]` Config files contents - `content: String` The file content ### Example ```ruby require "stainless_v0" stainless = StainlessV0::Client.new( api_key: "My API Key", environment: "staging" # defaults to "production" ) response = stainless.projects.configs.guess(project: "project", spec: "spec") puts(response) ``` #### Response ```json { "foo": { "content": "content" } } ``` ## Domain Types ### Config Retrieve Response - `Hash[Symbol, { content}]` Config files contents - `content: String` The file content ### Config Guess Response - `Hash[Symbol, { content}]` Config files contents - `content: String` The file content