# Branches ## Create a new project branch `projects().branches().create(BranchCreateParamsparams, RequestOptionsrequestOptions = RequestOptions.none()) : 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 - `params: BranchCreateParams` - `project: Optional` - `branch: String` Branch name - `branchFrom: String` Branch or commit SHA to branch from - `force: Optional` 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 - `configCommit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `latestBuild: Optional` - `id: String` Build ID - `configCommit: String` - `createdAt: LocalDateTime` - `documentedSpec: Optional` - `class UnionMember0:` - `content: String` - `type: Type` - `CONTENT("content")` - `class UnionMember1:` - `expires: LocalDateTime` - `type: Type` - `URL("url")` - `url: String` - `object_: Object` - `BUILD("build")` - `org: String` - `project: String` - `targets: Targets` - `cli: Optional` - `commit: Commit` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `JsonValue;` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `JsonValue;` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `class Completed:` - `commit: Optional` - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `completed: InnerCompleted` deprecated - `commit: Optional` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `installUrl: Optional` - `object_: Object` - `BUILD_TARGET("build_target")` - `status: Status` - `NOT_STARTED("not_started")` - `CODEGEN("codegen")` - `POSTGEN("postgen")` - `COMPLETED("completed")` - `build: Optional` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `Queued` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `url: Optional` - `InProgress` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `url: Optional` - `Completed` - `completed: InnerCompleted` deprecated - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `url: Optional` - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `url: Optional` - `lint: Optional` - `test: Optional` - `csharp: Optional` - `go: Optional` - `java: Optional` - `kotlin: Optional` - `node: Optional` - `openAPI: Optional` - `php: Optional` - `python: Optional` - `ruby: Optional` - `sql: Optional` - `terraform: Optional` - `typescript: Optional` - `updatedAt: LocalDateTime` - `object_: Object` - `PROJECT_BRANCH("project_branch")` - `org: String` - `project: String` Project name ### Example ```kotlin package com.configure_me_stainless_v0.api.example import com.configure_me_stainless_v0.api.client.StainlessClient import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient import com.configure_me_stainless_v0.api.models.projects.branches.BranchCreateParams import com.configure_me_stainless_v0.api.models.projects.branches.ProjectBranch fun main() { val client: StainlessClient = StainlessOkHttpClient.builder() .fromEnv() .project("example-project") .build() val params: BranchCreateParams = BranchCreateParams.builder() .branch("branch") .branchFrom("branch_from") .build() val projectBranch: ProjectBranch = client.projects().branches().create(params) } ``` #### 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(BranchRetrieveParamsparams = BranchRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : ProjectBranch` **get** `/v0/projects/{project}/branches/{branch}` Retrieve a project branch by name. ### Parameters - `params: BranchRetrieveParams` - `project: Optional` - `branch: Optional` ### 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 - `configCommit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `latestBuild: Optional` - `id: String` Build ID - `configCommit: String` - `createdAt: LocalDateTime` - `documentedSpec: Optional` - `class UnionMember0:` - `content: String` - `type: Type` - `CONTENT("content")` - `class UnionMember1:` - `expires: LocalDateTime` - `type: Type` - `URL("url")` - `url: String` - `object_: Object` - `BUILD("build")` - `org: String` - `project: String` - `targets: Targets` - `cli: Optional` - `commit: Commit` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `JsonValue;` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `JsonValue;` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `class Completed:` - `commit: Optional` - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `completed: InnerCompleted` deprecated - `commit: Optional` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `installUrl: Optional` - `object_: Object` - `BUILD_TARGET("build_target")` - `status: Status` - `NOT_STARTED("not_started")` - `CODEGEN("codegen")` - `POSTGEN("postgen")` - `COMPLETED("completed")` - `build: Optional` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `Queued` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `url: Optional` - `InProgress` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `url: Optional` - `Completed` - `completed: InnerCompleted` deprecated - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `url: Optional` - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `url: Optional` - `lint: Optional` - `test: Optional` - `csharp: Optional` - `go: Optional` - `java: Optional` - `kotlin: Optional` - `node: Optional` - `openAPI: Optional` - `php: Optional` - `python: Optional` - `ruby: Optional` - `sql: Optional` - `terraform: Optional` - `typescript: Optional` - `updatedAt: LocalDateTime` - `object_: Object` - `PROJECT_BRANCH("project_branch")` - `org: String` - `project: String` Project name ### Example ```kotlin package com.configure_me_stainless_v0.api.example import com.configure_me_stainless_v0.api.client.StainlessClient import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient import com.configure_me_stainless_v0.api.models.projects.branches.BranchRetrieveParams import com.configure_me_stainless_v0.api.models.projects.branches.ProjectBranch fun main() { val client: StainlessClient = StainlessOkHttpClient.builder() .fromEnv() .project("example-project") .build() val projectBranch: ProjectBranch = client.projects().branches().retrieve("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(BranchListParamsparams = BranchListParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : BranchListPage` **get** `/v0/projects/{project}/branches` Retrieve a project branch by name. ### Parameters - `params: BranchListParams` - `project: Optional` - `cursor: Optional` Pagination cursor from a previous response - `limit: Optional` 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 - `configCommit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `latestBuildId: String` - `object_: Object` - `PROJECT_BRANCH("project_branch")` - `org: String` - `project: String` Project name ### Example ```kotlin package com.configure_me_stainless_v0.api.example import com.configure_me_stainless_v0.api.client.StainlessClient import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient import com.configure_me_stainless_v0.api.models.projects.branches.BranchListPage import com.configure_me_stainless_v0.api.models.projects.branches.BranchListParams fun main() { val client: StainlessClient = StainlessOkHttpClient.builder() .fromEnv() .project("example-project") .build() val page: BranchListPage = client.projects().branches().list() } ``` #### 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(BranchDeleteParamsparams = BranchDeleteParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : JsonValue` **delete** `/v0/projects/{project}/branches/{branch}` Delete a project branch by name. ### Parameters - `params: BranchDeleteParams` - `project: Optional` - `branch: Optional` ### Returns - `class BranchDeleteResponse:` ### Example ```kotlin package com.configure_me_stainless_v0.api.example import com.configure_me_stainless_v0.api.client.StainlessClient import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient import com.configure_me_stainless_v0.api.models.projects.branches.BranchDeleteParams import com.configure_me_stainless_v0.api.models.projects.branches.BranchDeleteResponse fun main() { val client: StainlessClient = StainlessOkHttpClient.builder() .fromEnv() .project("example-project") .build() val branch: BranchDeleteResponse = client.projects().branches().delete("branch") } ``` #### Response ```json {} ``` ## Rebase a project branch `projects().branches().rebase(BranchRebaseParamsparams = BranchRebaseParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : 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 - `params: BranchRebaseParams` - `project: Optional` - `branch: Optional` - `base: Optional` 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 - `configCommit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `latestBuild: Optional` - `id: String` Build ID - `configCommit: String` - `createdAt: LocalDateTime` - `documentedSpec: Optional` - `class UnionMember0:` - `content: String` - `type: Type` - `CONTENT("content")` - `class UnionMember1:` - `expires: LocalDateTime` - `type: Type` - `URL("url")` - `url: String` - `object_: Object` - `BUILD("build")` - `org: String` - `project: String` - `targets: Targets` - `cli: Optional` - `commit: Commit` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `JsonValue;` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `JsonValue;` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `class Completed:` - `commit: Optional` - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `completed: InnerCompleted` deprecated - `commit: Optional` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `installUrl: Optional` - `object_: Object` - `BUILD_TARGET("build_target")` - `status: Status` - `NOT_STARTED("not_started")` - `CODEGEN("codegen")` - `POSTGEN("postgen")` - `COMPLETED("completed")` - `build: Optional` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `Queued` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `url: Optional` - `InProgress` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `url: Optional` - `Completed` - `completed: InnerCompleted` deprecated - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `url: Optional` - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `url: Optional` - `lint: Optional` - `test: Optional` - `csharp: Optional` - `go: Optional` - `java: Optional` - `kotlin: Optional` - `node: Optional` - `openAPI: Optional` - `php: Optional` - `python: Optional` - `ruby: Optional` - `sql: Optional` - `terraform: Optional` - `typescript: Optional` - `updatedAt: LocalDateTime` - `object_: Object` - `PROJECT_BRANCH("project_branch")` - `org: String` - `project: String` Project name ### Example ```kotlin package com.configure_me_stainless_v0.api.example import com.configure_me_stainless_v0.api.client.StainlessClient import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient import com.configure_me_stainless_v0.api.models.projects.branches.BranchRebaseParams import com.configure_me_stainless_v0.api.models.projects.branches.ProjectBranch fun main() { val client: StainlessClient = StainlessOkHttpClient.builder() .fromEnv() .project("example-project") .build() val projectBranch: ProjectBranch = client.projects().branches().rebase("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(BranchResetParamsparams = BranchResetParams.none(), RequestOptionsrequestOptions = RequestOptions.none()) : 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 - `params: BranchResetParams` - `project: Optional` - `branch: Optional` - `targetConfigSha: Optional` 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 - `configCommit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `latestBuild: Optional` - `id: String` Build ID - `configCommit: String` - `createdAt: LocalDateTime` - `documentedSpec: Optional` - `class UnionMember0:` - `content: String` - `type: Type` - `CONTENT("content")` - `class UnionMember1:` - `expires: LocalDateTime` - `type: Type` - `URL("url")` - `url: String` - `object_: Object` - `BUILD("build")` - `org: String` - `project: String` - `targets: Targets` - `cli: Optional` - `commit: Commit` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `JsonValue;` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `JsonValue;` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `class Completed:` - `commit: Optional` - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `completed: InnerCompleted` deprecated - `commit: Optional` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `installUrl: Optional` - `object_: Object` - `BUILD_TARGET("build_target")` - `status: Status` - `NOT_STARTED("not_started")` - `CODEGEN("codegen")` - `POSTGEN("postgen")` - `COMPLETED("completed")` - `build: Optional` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `Queued` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `url: Optional` - `InProgress` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `url: Optional` - `Completed` - `completed: InnerCompleted` deprecated - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `url: Optional` - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `url: Optional` - `lint: Optional` - `test: Optional` - `csharp: Optional` - `go: Optional` - `java: Optional` - `kotlin: Optional` - `node: Optional` - `openAPI: Optional` - `php: Optional` - `python: Optional` - `ruby: Optional` - `sql: Optional` - `terraform: Optional` - `typescript: Optional` - `updatedAt: LocalDateTime` - `object_: Object` - `PROJECT_BRANCH("project_branch")` - `org: String` - `project: String` Project name ### Example ```kotlin package com.configure_me_stainless_v0.api.example import com.configure_me_stainless_v0.api.client.StainlessClient import com.configure_me_stainless_v0.api.client.okhttp.StainlessOkHttpClient import com.configure_me_stainless_v0.api.models.projects.branches.BranchResetParams import com.configure_me_stainless_v0.api.models.projects.branches.ProjectBranch fun main() { val client: StainlessClient = StainlessOkHttpClient.builder() .fromEnv() .project("example-project") .build() val projectBranch: ProjectBranch = client.projects().branches().reset("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 - `configCommit: ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `latestBuild: Optional` - `id: String` Build ID - `configCommit: String` - `createdAt: LocalDateTime` - `documentedSpec: Optional` - `class UnionMember0:` - `content: String` - `type: Type` - `CONTENT("content")` - `class UnionMember1:` - `expires: LocalDateTime` - `type: Type` - `URL("url")` - `url: String` - `object_: Object` - `BUILD("build")` - `org: String` - `project: String` - `targets: Targets` - `cli: Optional` - `commit: Commit` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `JsonValue;` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `JsonValue;` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `class Completed:` - `commit: Optional` - `repo: Repo` - `branch: String` - `host: String` - `name: String` - `owner: String` - `sha: String` - `stats: Optional` - `additions: Long` - `deletions: Long` - `total: Long` - `treeOid: Optional` - `completed: InnerCompleted` deprecated - `commit: Optional` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `completedAt: LocalDateTime` - `conclusion: Conclusion` - `ERROR("error")` - `WARNING("warning")` - `NOTE("note")` - `SUCCESS("success")` - `MERGE_CONFLICT("merge_conflict")` - `UPSTREAM_MERGE_CONFLICT("upstream_merge_conflict")` - `FATAL("fatal")` - `PAYMENT_REQUIRED("payment_required")` - `CANCELLED("cancelled")` - `TIMED_OUT("timed_out")` - `NOOP("noop")` - `VERSION_BUMP("version_bump")` - `mergeConflictPr: Optional` - `number: Double` - `repo: Repo` - `host: String` - `name: String` - `owner: String` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `installUrl: Optional` - `object_: Object` - `BUILD_TARGET("build_target")` - `status: Status` - `NOT_STARTED("not_started")` - `CODEGEN("codegen")` - `POSTGEN("postgen")` - `COMPLETED("completed")` - `build: Optional` - `JsonValue;` - `status: JsonValue; "not_started"constant` - `NOT_STARTED("not_started")` - `Queued` - `status: JsonValue; "queued"constant` - `QUEUED("queued")` - `url: Optional` - `InProgress` - `status: JsonValue; "in_progress"constant` - `IN_PROGRESS("in_progress")` - `url: Optional` - `Completed` - `completed: InnerCompleted` deprecated - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `url: Optional` - `conclusion: Conclusion` - `SUCCESS("success")` - `FAILURE("failure")` - `SKIPPED("skipped")` - `CANCELLED("cancelled")` - `ACTION_REQUIRED("action_required")` - `NEUTRAL("neutral")` - `TIMED_OUT("timed_out")` - `status: JsonValue; "completed"constant` - `COMPLETED("completed")` - `url: Optional` - `lint: Optional` - `test: Optional` - `csharp: Optional` - `go: Optional` - `java: Optional` - `kotlin: Optional` - `node: Optional` - `openAPI: Optional` - `php: Optional` - `python: Optional` - `ruby: Optional` - `sql: Optional` - `terraform: Optional` - `typescript: Optional` - `updatedAt: LocalDateTime` - `object_: Object` - `PROJECT_BRANCH("project_branch")` - `org: String` - `project: String` Project name