# Branches ## Create a new project branch `ProjectBranch Projects.Branches.Create(BranchCreateParamsparameters, CancellationTokencancellationToken = default)` **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 - `BranchCreateParams parameters` - `required string project` Path param - `required string branch` Body param: Branch name - `required string branchFrom` Body param: Branch or commit SHA to branch from - `Boolean force` Body param: 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. - `required string Branch` Branch name - `required ConfigCommit ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Build? LatestBuild` - `required string ID` Build ID - `required string ConfigCommit` - `required DateTimeOffset CreatedAt` - `required DocumentedSpec? DocumentedSpec` - `class UnionMember0:` - `required string Content` - `required Type Type` - `"content"Content` - `class UnionMember1:` - `required DateTimeOffset Expires` - `required Type Type` - `"url"Url` - `required string Url` - `required Object Object` - `"build"Build` - `required string Org` - `required string Project` - `required Targets Targets` - `BuildTarget Cli` - `required Commit Commit` - `class NotStarted:` - `class Queued:` - `class InProgress:` - `class Completed:` - `required Commit? Commit` - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Completed Completed` deprecated - `required Commit? Commit` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `JsonElement Status "completed"constant` - `required string? InstallUrl` - `required Object Object` - `"build_target"BuildTarget` - `required Status Status` - `"not_started"NotStarted` - `"codegen"Codegen` - `"postgen"Postgen` - `"completed"Completed` - `CheckStep Build` - `JsonElement` - `Queued` - `JsonElement Status "queued"constant` - `required string? Url` - `InProgress` - `JsonElement Status "in_progress"constant` - `required string? Url` - `Completed` - `required Completed Completed` deprecated - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `required string? Url` - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `JsonElement Status "completed"constant` - `required string? Url` - `CheckStep Lint` - `CheckStep Test` - `BuildTarget Csharp` - `BuildTarget Go` - `BuildTarget Java` - `BuildTarget Kotlin` - `BuildTarget Node` - `BuildTarget OpenAPI` - `BuildTarget Php` - `BuildTarget Python` - `BuildTarget Ruby` - `BuildTarget Sql` - `BuildTarget Terraform` - `BuildTarget Typescript` - `required DateTimeOffset UpdatedAt` - `required Object Object` - `"project_branch"ProjectBranch` - `required string Org` - `required string Project` Project name ### Example ```csharp BranchCreateParams parameters = new() { Project = "project", Branch = "branch", BranchFrom = "branch_from", }; var projectBranch = await client.Projects.Branches.Create(parameters); Console.WriteLine(projectBranch); ``` #### 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 `ProjectBranch Projects.Branches.Retrieve(BranchRetrieveParamsparameters, CancellationTokencancellationToken = default)` **get** `/v0/projects/{project}/branches/{branch}` Retrieve a project branch by name. ### Parameters - `BranchRetrieveParams parameters` - `required string project` - `required string branch` ### 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. - `required string Branch` Branch name - `required ConfigCommit ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Build? LatestBuild` - `required string ID` Build ID - `required string ConfigCommit` - `required DateTimeOffset CreatedAt` - `required DocumentedSpec? DocumentedSpec` - `class UnionMember0:` - `required string Content` - `required Type Type` - `"content"Content` - `class UnionMember1:` - `required DateTimeOffset Expires` - `required Type Type` - `"url"Url` - `required string Url` - `required Object Object` - `"build"Build` - `required string Org` - `required string Project` - `required Targets Targets` - `BuildTarget Cli` - `required Commit Commit` - `class NotStarted:` - `class Queued:` - `class InProgress:` - `class Completed:` - `required Commit? Commit` - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Completed Completed` deprecated - `required Commit? Commit` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `JsonElement Status "completed"constant` - `required string? InstallUrl` - `required Object Object` - `"build_target"BuildTarget` - `required Status Status` - `"not_started"NotStarted` - `"codegen"Codegen` - `"postgen"Postgen` - `"completed"Completed` - `CheckStep Build` - `JsonElement` - `Queued` - `JsonElement Status "queued"constant` - `required string? Url` - `InProgress` - `JsonElement Status "in_progress"constant` - `required string? Url` - `Completed` - `required Completed Completed` deprecated - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `required string? Url` - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `JsonElement Status "completed"constant` - `required string? Url` - `CheckStep Lint` - `CheckStep Test` - `BuildTarget Csharp` - `BuildTarget Go` - `BuildTarget Java` - `BuildTarget Kotlin` - `BuildTarget Node` - `BuildTarget OpenAPI` - `BuildTarget Php` - `BuildTarget Python` - `BuildTarget Ruby` - `BuildTarget Sql` - `BuildTarget Terraform` - `BuildTarget Typescript` - `required DateTimeOffset UpdatedAt` - `required Object Object` - `"project_branch"ProjectBranch` - `required string Org` - `required string Project` Project name ### Example ```csharp BranchRetrieveParams parameters = new() { Project = "project", Branch = "branch", }; var projectBranch = await client.Projects.Branches.Retrieve(parameters); Console.WriteLine(projectBranch); ``` #### 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 `BranchListPageResponse Projects.Branches.List(BranchListParamsparameters, CancellationTokencancellationToken = default)` **get** `/v0/projects/{project}/branches` Retrieve a project branch by name. ### Parameters - `BranchListParams parameters` - `required string project` Path param - `string cursor` Query param: Pagination cursor from a previous response - `Double limit` Query param: Maximum number of items to return, defaults to 10 (maximum: 100). ### Returns - `class BranchListPageResponse:` - `required IReadOnlyList Data` - `required string Branch` Branch name - `required ConfigCommit ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required string LatestBuildID` - `required Object Object` - `"project_branch"ProjectBranch` - `required string Org` - `required string Project` Project name - `required Boolean HasMore` - `string NextCursor` ### Example ```csharp BranchListParams parameters = new() { Project = "project" }; var page = await client.Projects.Branches.List(parameters); await foreach (var item in page.Paginate()) { Console.WriteLine(item); } ``` #### 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 `JsonElement Projects.Branches.Delete(BranchDeleteParamsparameters, CancellationTokencancellationToken = default)` **delete** `/v0/projects/{project}/branches/{branch}` Delete a project branch by name. ### Parameters - `BranchDeleteParams parameters` - `required string project` - `required string branch` ### Example ```csharp BranchDeleteParams parameters = new() { Project = "project", Branch = "branch", }; var branch = await client.Projects.Branches.Delete(parameters); Console.WriteLine(branch); ``` #### Response ```json {} ``` ## Rebase a project branch `ProjectBranch Projects.Branches.Rebase(BranchRebaseParamsparameters, CancellationTokencancellationToken = default)` **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 - `BranchRebaseParams parameters` - `required string project` Path param - `required string branch` Path param - `string base` Query param: 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. - `required string Branch` Branch name - `required ConfigCommit ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Build? LatestBuild` - `required string ID` Build ID - `required string ConfigCommit` - `required DateTimeOffset CreatedAt` - `required DocumentedSpec? DocumentedSpec` - `class UnionMember0:` - `required string Content` - `required Type Type` - `"content"Content` - `class UnionMember1:` - `required DateTimeOffset Expires` - `required Type Type` - `"url"Url` - `required string Url` - `required Object Object` - `"build"Build` - `required string Org` - `required string Project` - `required Targets Targets` - `BuildTarget Cli` - `required Commit Commit` - `class NotStarted:` - `class Queued:` - `class InProgress:` - `class Completed:` - `required Commit? Commit` - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Completed Completed` deprecated - `required Commit? Commit` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `JsonElement Status "completed"constant` - `required string? InstallUrl` - `required Object Object` - `"build_target"BuildTarget` - `required Status Status` - `"not_started"NotStarted` - `"codegen"Codegen` - `"postgen"Postgen` - `"completed"Completed` - `CheckStep Build` - `JsonElement` - `Queued` - `JsonElement Status "queued"constant` - `required string? Url` - `InProgress` - `JsonElement Status "in_progress"constant` - `required string? Url` - `Completed` - `required Completed Completed` deprecated - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `required string? Url` - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `JsonElement Status "completed"constant` - `required string? Url` - `CheckStep Lint` - `CheckStep Test` - `BuildTarget Csharp` - `BuildTarget Go` - `BuildTarget Java` - `BuildTarget Kotlin` - `BuildTarget Node` - `BuildTarget OpenAPI` - `BuildTarget Php` - `BuildTarget Python` - `BuildTarget Ruby` - `BuildTarget Sql` - `BuildTarget Terraform` - `BuildTarget Typescript` - `required DateTimeOffset UpdatedAt` - `required Object Object` - `"project_branch"ProjectBranch` - `required string Org` - `required string Project` Project name ### Example ```csharp BranchRebaseParams parameters = new() { Project = "project", Branch = "branch", }; var projectBranch = await client.Projects.Branches.Rebase(parameters); Console.WriteLine(projectBranch); ``` #### 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 `ProjectBranch Projects.Branches.Reset(BranchResetParamsparameters, CancellationTokencancellationToken = default)` **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 - `BranchResetParams parameters` - `required string project` Path param - `required string branch` Path param - `string targetConfigSha` Query param: 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. - `required string Branch` Branch name - `required ConfigCommit ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Build? LatestBuild` - `required string ID` Build ID - `required string ConfigCommit` - `required DateTimeOffset CreatedAt` - `required DocumentedSpec? DocumentedSpec` - `class UnionMember0:` - `required string Content` - `required Type Type` - `"content"Content` - `class UnionMember1:` - `required DateTimeOffset Expires` - `required Type Type` - `"url"Url` - `required string Url` - `required Object Object` - `"build"Build` - `required string Org` - `required string Project` - `required Targets Targets` - `BuildTarget Cli` - `required Commit Commit` - `class NotStarted:` - `class Queued:` - `class InProgress:` - `class Completed:` - `required Commit? Commit` - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Completed Completed` deprecated - `required Commit? Commit` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `JsonElement Status "completed"constant` - `required string? InstallUrl` - `required Object Object` - `"build_target"BuildTarget` - `required Status Status` - `"not_started"NotStarted` - `"codegen"Codegen` - `"postgen"Postgen` - `"completed"Completed` - `CheckStep Build` - `JsonElement` - `Queued` - `JsonElement Status "queued"constant` - `required string? Url` - `InProgress` - `JsonElement Status "in_progress"constant` - `required string? Url` - `Completed` - `required Completed Completed` deprecated - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `required string? Url` - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `JsonElement Status "completed"constant` - `required string? Url` - `CheckStep Lint` - `CheckStep Test` - `BuildTarget Csharp` - `BuildTarget Go` - `BuildTarget Java` - `BuildTarget Kotlin` - `BuildTarget Node` - `BuildTarget OpenAPI` - `BuildTarget Php` - `BuildTarget Python` - `BuildTarget Ruby` - `BuildTarget Sql` - `BuildTarget Terraform` - `BuildTarget Typescript` - `required DateTimeOffset UpdatedAt` - `required Object Object` - `"project_branch"ProjectBranch` - `required string Org` - `required string Project` Project name ### Example ```csharp BranchResetParams parameters = new() { Project = "project", Branch = "branch", }; var projectBranch = await client.Projects.Branches.Reset(parameters); Console.WriteLine(projectBranch); ``` #### 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. - `required string Branch` Branch name - `required ConfigCommit ConfigCommit` A Git commit that points to the latest set of config files on a given branch. - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Build? LatestBuild` - `required string ID` Build ID - `required string ConfigCommit` - `required DateTimeOffset CreatedAt` - `required DocumentedSpec? DocumentedSpec` - `class UnionMember0:` - `required string Content` - `required Type Type` - `"content"Content` - `class UnionMember1:` - `required DateTimeOffset Expires` - `required Type Type` - `"url"Url` - `required string Url` - `required Object Object` - `"build"Build` - `required string Org` - `required string Project` - `required Targets Targets` - `BuildTarget Cli` - `required Commit Commit` - `class NotStarted:` - `class Queued:` - `class InProgress:` - `class Completed:` - `required Commit? Commit` - `required Repo Repo` - `required string Branch` - `required string Host` - `required string Name` - `required string Owner` - `required string Sha` - `required Stats? Stats` - `required Long Additions` - `required Long Deletions` - `required Long Total` - `required string? TreeOid` - `required Completed Completed` deprecated - `required Commit? Commit` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `required DateTimeOffset CompletedAt` - `required Conclusion Conclusion` - `"error"Error` - `"warning"Warning` - `"note"Note` - `"success"Success` - `"merge_conflict"MergeConflict` - `"upstream_merge_conflict"UpstreamMergeConflict` - `"fatal"Fatal` - `"payment_required"PaymentRequired` - `"cancelled"Cancelled` - `"timed_out"TimedOut` - `"noop"Noop` - `"version_bump"VersionBump` - `required MergeConflictPr? MergeConflictPr` - `required Double Number` - `required Repo Repo` - `required string Host` - `required string Name` - `required string Owner` - `JsonElement Status "completed"constant` - `required string? InstallUrl` - `required Object Object` - `"build_target"BuildTarget` - `required Status Status` - `"not_started"NotStarted` - `"codegen"Codegen` - `"postgen"Postgen` - `"completed"Completed` - `CheckStep Build` - `JsonElement` - `Queued` - `JsonElement Status "queued"constant` - `required string? Url` - `InProgress` - `JsonElement Status "in_progress"constant` - `required string? Url` - `Completed` - `required Completed Completed` deprecated - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `required string? Url` - `required Conclusion Conclusion` - `"success"Success` - `"failure"Failure` - `"skipped"Skipped` - `"cancelled"Cancelled` - `"action_required"ActionRequired` - `"neutral"Neutral` - `"timed_out"TimedOut` - `JsonElement Status "completed"constant` - `required string? Url` - `CheckStep Lint` - `CheckStep Test` - `BuildTarget Csharp` - `BuildTarget Go` - `BuildTarget Java` - `BuildTarget Kotlin` - `BuildTarget Node` - `BuildTarget OpenAPI` - `BuildTarget Php` - `BuildTarget Python` - `BuildTarget Ruby` - `BuildTarget Sql` - `BuildTarget Terraform` - `BuildTarget Typescript` - `required DateTimeOffset UpdatedAt` - `required Object Object` - `"project_branch"ProjectBranch` - `required string Org` - `required string Project` Project name