# Projects ## Retrieve project `projects.retrieve(ProjectRetrieveParams**kwargs) -> Project` **get** `/v0/projects/{project}` Retrieve a project by name. ### Parameters - `project: Optional[str]` ### Returns - `class Project: …` A project is a collection of SDKs generated from the same set of config files. - `config_repo: str` - `display_name: Optional[str]` - `object: Literal["project"]` - `"project"` - `org: str` - `slug: str` - `targets: List[Target]` - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) project = client.projects.retrieve( project="project", ) print(project.config_repo) ``` #### Response ```json { "config_repo": "config_repo", "display_name": "display_name", "object": "project", "org": "org", "slug": "slug", "targets": [ "node" ] } ``` ## Update project `projects.update(ProjectUpdateParams**kwargs) -> Project` **patch** `/v0/projects/{project}` Update a project's properties. ### Parameters - `project: Optional[str]` - `display_name: Optional[str]` ### Returns - `class Project: …` A project is a collection of SDKs generated from the same set of config files. - `config_repo: str` - `display_name: Optional[str]` - `object: Literal["project"]` - `"project"` - `org: str` - `slug: str` - `targets: List[Target]` - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) project = client.projects.update( project="project", ) print(project.config_repo) ``` #### Response ```json { "config_repo": "config_repo", "display_name": "display_name", "object": "project", "org": "org", "slug": "slug", "targets": [ "node" ] } ``` ## List projects `projects.list(ProjectListParams**kwargs) -> SyncPage[Project]` **get** `/v0/projects` List projects in an organization, from oldest to newest. ### Parameters - `cursor: Optional[str]` Pagination cursor from a previous response - `limit: Optional[float]` Maximum number of projects to return, defaults to 10 (maximum: 100). - `org: Optional[str]` ### Returns - `class Project: …` A project is a collection of SDKs generated from the same set of config files. - `config_repo: str` - `display_name: Optional[str]` - `object: Literal["project"]` - `"project"` - `org: str` - `slug: str` - `targets: List[Target]` - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) page = client.projects.list() page = page.data[0] print(page.config_repo) ``` #### 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(ProjectCreateParams**kwargs) -> Project` **post** `/v0/projects` Create a new project. ### Parameters - `display_name: str` Human-readable project name - `org: str` Organization name - `revision: Dict[str, FileInput]` File contents to commit - `class Content: …` - `content: str` File content - `class URL: …` - `url: str` URL to fetch file content from - `slug: str` Project name/slug - `targets: List[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: str` - `display_name: Optional[str]` - `object: Literal["project"]` - `"project"` - `org: str` - `slug: str` - `targets: List[Target]` - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) project = client.projects.create( display_name="display_name", org="org", revision={ "foo": { "content": "content" } }, slug="slug", targets=["node"], ) print(project.config_repo) ``` #### 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(ProjectGenerateCommitMessageParams**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: Optional[str]` - `target: Literal["python", "node", "typescript", 10 more]` Language target - `"python"` - `"node"` - `"typescript"` - `"java"` - `"kotlin"` - `"go"` - `"ruby"` - `"terraform"` - `"cli"` - `"csharp"` - `"php"` - `"openapi"` - `"sql"` - `base_ref: str` Base ref for comparison - `head_ref: str` Head ref for comparison ### Returns - `class ProjectGenerateCommitMessageResponse: …` - `ai_commit_message: str` ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) response = client.projects.generate_commit_message( project="project", target="python", base_ref="base_ref", head_ref="head_ref", ) print(response.ai_commit_message) ``` #### 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: str` - `display_name: Optional[str]` - `object: Literal["project"]` - `"project"` - `org: str` - `slug: str` - `targets: List[Target]` - `"node"` - `"typescript"` - `"python"` - `"go"` - `"java"` - `"kotlin"` - `"ruby"` - `"terraform"` - `"cli"` - `"php"` - `"csharp"` - `"sql"` - `"openapi"` ### Project Generate Commit Message Response - `class ProjectGenerateCommitMessageResponse: …` - `ai_commit_message: str` # Branches ## Create a new project branch `projects.branches.create(BranchCreateParams**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: Optional[str]` - `branch: str` Branch name - `branch_from: str` Branch or commit SHA to branch from - `force: Optional[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: str` Branch name - `config_commit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: ConfigCommitRepo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[ConfigCommitStats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `latest_build: Optional[Build]` - `id: str` Build ID - `config_commit: str` - `created_at: datetime` - `documented_spec: Optional[DocumentedSpec]` - `class DocumentedSpecUnionMember0: …` - `content: str` - `type: Literal["content"]` - `"content"` - `class DocumentedSpecUnionMember1: …` - `expires: datetime` - `type: Literal["url"]` - `"url"` - `url: str` - `object: Literal["build"]` - `"build"` - `org: str` - `project: str` - `targets: Targets` - `cli: Optional[BuildTarget]` - `commit: Commit` - `class CommitNotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class CommitQueued: …` - `status: Literal["queued"]` - `"queued"` - `class CommitInProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `class CommitCompleted: …` - `commit: Optional[Commit]` - `repo: Repo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[Stats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `completed: CommitCompletedCompleted` deprecated - `commit: Optional[Commit]` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `status: Literal["completed"]` - `"completed"` - `install_url: Optional[str]` - `object: Literal["build_target"]` - `"build_target"` - `status: Literal["not_started", "codegen", "postgen", "completed"]` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: Optional[CheckStep]` - `class NotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class Queued: …` - `status: Literal["queued"]` - `"queued"` - `url: Optional[str]` - `class InProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `url: Optional[str]` - `class Completed: …` - `completed: CompletedCompleted` deprecated - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: Optional[str]` - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: Literal["completed"]` - `"completed"` - `url: Optional[str]` - `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: datetime` - `object: Literal["project_branch"]` - `"project_branch"` - `org: str` - `project: str` Project name ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) project_branch = client.projects.branches.create( project="project", branch="branch", branch_from="branch_from", ) print(project_branch.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(strbranch, BranchRetrieveParams**kwargs) -> ProjectBranch` **get** `/v0/projects/{project}/branches/{branch}` Retrieve a project branch by name. ### Parameters - `project: Optional[str]` - `branch: str` ### 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: str` Branch name - `config_commit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: ConfigCommitRepo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[ConfigCommitStats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `latest_build: Optional[Build]` - `id: str` Build ID - `config_commit: str` - `created_at: datetime` - `documented_spec: Optional[DocumentedSpec]` - `class DocumentedSpecUnionMember0: …` - `content: str` - `type: Literal["content"]` - `"content"` - `class DocumentedSpecUnionMember1: …` - `expires: datetime` - `type: Literal["url"]` - `"url"` - `url: str` - `object: Literal["build"]` - `"build"` - `org: str` - `project: str` - `targets: Targets` - `cli: Optional[BuildTarget]` - `commit: Commit` - `class CommitNotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class CommitQueued: …` - `status: Literal["queued"]` - `"queued"` - `class CommitInProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `class CommitCompleted: …` - `commit: Optional[Commit]` - `repo: Repo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[Stats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `completed: CommitCompletedCompleted` deprecated - `commit: Optional[Commit]` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `status: Literal["completed"]` - `"completed"` - `install_url: Optional[str]` - `object: Literal["build_target"]` - `"build_target"` - `status: Literal["not_started", "codegen", "postgen", "completed"]` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: Optional[CheckStep]` - `class NotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class Queued: …` - `status: Literal["queued"]` - `"queued"` - `url: Optional[str]` - `class InProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `url: Optional[str]` - `class Completed: …` - `completed: CompletedCompleted` deprecated - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: Optional[str]` - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: Literal["completed"]` - `"completed"` - `url: Optional[str]` - `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: datetime` - `object: Literal["project_branch"]` - `"project_branch"` - `org: str` - `project: str` Project name ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) project_branch = client.projects.branches.retrieve( branch="branch", project="project", ) print(project_branch.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(BranchListParams**kwargs) -> SyncPage[BranchListResponse]` **get** `/v0/projects/{project}/branches` Retrieve a project branch by name. ### Parameters - `project: Optional[str]` - `cursor: Optional[str]` Pagination cursor from a previous response - `limit: Optional[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: str` Branch name - `config_commit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: ConfigCommitRepo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[ConfigCommitStats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `latest_build_id: str` - `object: Literal["project_branch"]` - `"project_branch"` - `org: str` - `project: str` Project name ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) page = client.projects.branches.list( project="project", ) page = page.data[0] print(page.latest_build_id) ``` #### 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(strbranch, BranchDeleteParams**kwargs) -> object` **delete** `/v0/projects/{project}/branches/{branch}` Delete a project branch by name. ### Parameters - `project: Optional[str]` - `branch: str` ### Returns - `object` ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) branch = client.projects.branches.delete( branch="branch", project="project", ) print(branch) ``` #### Response ```json {} ``` ## Rebase a project branch `projects.branches.rebase(strbranch, BranchRebaseParams**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: Optional[str]` - `branch: str` - `base: Optional[str]` 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: str` Branch name - `config_commit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: ConfigCommitRepo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[ConfigCommitStats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `latest_build: Optional[Build]` - `id: str` Build ID - `config_commit: str` - `created_at: datetime` - `documented_spec: Optional[DocumentedSpec]` - `class DocumentedSpecUnionMember0: …` - `content: str` - `type: Literal["content"]` - `"content"` - `class DocumentedSpecUnionMember1: …` - `expires: datetime` - `type: Literal["url"]` - `"url"` - `url: str` - `object: Literal["build"]` - `"build"` - `org: str` - `project: str` - `targets: Targets` - `cli: Optional[BuildTarget]` - `commit: Commit` - `class CommitNotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class CommitQueued: …` - `status: Literal["queued"]` - `"queued"` - `class CommitInProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `class CommitCompleted: …` - `commit: Optional[Commit]` - `repo: Repo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[Stats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `completed: CommitCompletedCompleted` deprecated - `commit: Optional[Commit]` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `status: Literal["completed"]` - `"completed"` - `install_url: Optional[str]` - `object: Literal["build_target"]` - `"build_target"` - `status: Literal["not_started", "codegen", "postgen", "completed"]` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: Optional[CheckStep]` - `class NotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class Queued: …` - `status: Literal["queued"]` - `"queued"` - `url: Optional[str]` - `class InProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `url: Optional[str]` - `class Completed: …` - `completed: CompletedCompleted` deprecated - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: Optional[str]` - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: Literal["completed"]` - `"completed"` - `url: Optional[str]` - `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: datetime` - `object: Literal["project_branch"]` - `"project_branch"` - `org: str` - `project: str` Project name ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) project_branch = client.projects.branches.rebase( branch="branch", project="project", ) print(project_branch.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(strbranch, BranchResetParams**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: Optional[str]` - `branch: str` - `target_config_sha: Optional[str]` 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: str` Branch name - `config_commit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: ConfigCommitRepo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[ConfigCommitStats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `latest_build: Optional[Build]` - `id: str` Build ID - `config_commit: str` - `created_at: datetime` - `documented_spec: Optional[DocumentedSpec]` - `class DocumentedSpecUnionMember0: …` - `content: str` - `type: Literal["content"]` - `"content"` - `class DocumentedSpecUnionMember1: …` - `expires: datetime` - `type: Literal["url"]` - `"url"` - `url: str` - `object: Literal["build"]` - `"build"` - `org: str` - `project: str` - `targets: Targets` - `cli: Optional[BuildTarget]` - `commit: Commit` - `class CommitNotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class CommitQueued: …` - `status: Literal["queued"]` - `"queued"` - `class CommitInProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `class CommitCompleted: …` - `commit: Optional[Commit]` - `repo: Repo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[Stats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `completed: CommitCompletedCompleted` deprecated - `commit: Optional[Commit]` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `status: Literal["completed"]` - `"completed"` - `install_url: Optional[str]` - `object: Literal["build_target"]` - `"build_target"` - `status: Literal["not_started", "codegen", "postgen", "completed"]` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: Optional[CheckStep]` - `class NotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class Queued: …` - `status: Literal["queued"]` - `"queued"` - `url: Optional[str]` - `class InProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `url: Optional[str]` - `class Completed: …` - `completed: CompletedCompleted` deprecated - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: Optional[str]` - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: Literal["completed"]` - `"completed"` - `url: Optional[str]` - `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: datetime` - `object: Literal["project_branch"]` - `"project_branch"` - `org: str` - `project: str` Project name ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) project_branch = client.projects.branches.reset( branch="branch", project="project", ) print(project_branch.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: str` Branch name - `config_commit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: ConfigCommitRepo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[ConfigCommitStats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `latest_build: Optional[Build]` - `id: str` Build ID - `config_commit: str` - `created_at: datetime` - `documented_spec: Optional[DocumentedSpec]` - `class DocumentedSpecUnionMember0: …` - `content: str` - `type: Literal["content"]` - `"content"` - `class DocumentedSpecUnionMember1: …` - `expires: datetime` - `type: Literal["url"]` - `"url"` - `url: str` - `object: Literal["build"]` - `"build"` - `org: str` - `project: str` - `targets: Targets` - `cli: Optional[BuildTarget]` - `commit: Commit` - `class CommitNotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class CommitQueued: …` - `status: Literal["queued"]` - `"queued"` - `class CommitInProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `class CommitCompleted: …` - `commit: Optional[Commit]` - `repo: Repo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[Stats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `completed: CommitCompletedCompleted` deprecated - `commit: Optional[Commit]` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `completed_at: datetime` - `conclusion: Literal["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: Optional[CommitCompletedMergeConflictPr]` - `number: float` - `repo: CommitCompletedMergeConflictPrRepo` - `host: str` - `name: str` - `owner: str` - `status: Literal["completed"]` - `"completed"` - `install_url: Optional[str]` - `object: Literal["build_target"]` - `"build_target"` - `status: Literal["not_started", "codegen", "postgen", "completed"]` - `"not_started"` - `"codegen"` - `"postgen"` - `"completed"` - `build: Optional[CheckStep]` - `class NotStarted: …` - `status: Literal["not_started"]` - `"not_started"` - `class Queued: …` - `status: Literal["queued"]` - `"queued"` - `url: Optional[str]` - `class InProgress: …` - `status: Literal["in_progress"]` - `"in_progress"` - `url: Optional[str]` - `class Completed: …` - `completed: CompletedCompleted` deprecated - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `url: Optional[str]` - `conclusion: Literal["success", "failure", "skipped", 4 more]` - `"success"` - `"failure"` - `"skipped"` - `"cancelled"` - `"action_required"` - `"neutral"` - `"timed_out"` - `status: Literal["completed"]` - `"completed"` - `url: Optional[str]` - `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: datetime` - `object: Literal["project_branch"]` - `"project_branch"` - `org: str` - `project: str` 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: str` Branch name - `config_commit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: ConfigCommitRepo` - `branch: str` - `host: str` - `name: str` - `owner: str` - `sha: str` - `stats: Optional[ConfigCommitStats]` - `additions: int` - `deletions: int` - `total: int` - `tree_oid: Optional[str]` - `latest_build_id: str` - `object: Literal["project_branch"]` - `"project_branch"` - `org: str` - `project: str` Project name # Configs ## Retrieve configuration files `projects.configs.retrieve(ConfigRetrieveParams**kwargs) -> ConfigRetrieveResponse` **get** `/v0/projects/{project}/configs` Retrieve the configuration files for a given project. ### Parameters - `project: Optional[str]` - `branch: Optional[str]` Branch name, defaults to "main". - `include: Optional[str]` ### Returns - `Dict[str, ConfigRetrieveResponseItem]` Config files contents - `content: str` The file content ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) config = client.projects.configs.retrieve( project="project", ) print(config) ``` #### Response ```json { "foo": { "content": "content" } } ``` ## Generate config suggestions `projects.configs.guess(ConfigGuessParams**kwargs) -> ConfigGuessResponse` **post** `/v0/projects/{project}/configs/guess` Generate suggestions for changes to config files based on an OpenAPI spec. ### Parameters - `project: Optional[str]` - `spec: str` OpenAPI spec - `branch: Optional[str]` Branch name ### Returns - `Dict[str, ConfigGuessResponseItem]` Config files contents - `content: str` The file content ### Example ```python import os from stainless_v0 import Stainless client = Stainless( api_key=os.environ.get("STAINLESS_API_KEY"), # This is the default and can be omitted ) response = client.projects.configs.guess( project="project", spec="spec", ) print(response) ``` #### Response ```json { "foo": { "content": "content" } } ``` ## Domain Types ### Config Retrieve Response - `Dict[str, ConfigRetrieveResponseItem]` Config files contents - `content: str` The file content ### Config Guess Response - `Dict[str, ConfigGuessResponseItem]` Config files contents - `content: str` The file content