v1

latestOpenAPI 3.0.0Creative Commons Attribution 3.02026-07-133566112.5 KB
projects

CreateBranchRule creates a branch rule in a given repository.

post/v1/{+parent}/branchRules

Path parameters

parentstring required

Query parameters

branchRuleIdstring

Request body

requirePullRequestboolean

Optional. Determines if the branch rule requires a pull request or not.

requireCodeOwnerApprovalboolean

Optional. Determines if code owners must approve before merging to the branch.

annotationsobject

Optional. User annotations. These attributes can only be set and used by the user. See https://google.aip.dev/128#annotations for more details such as format and size limitations.

includePatternstring

Optional. The pattern of the branch that can match to this BranchRule. Specified as regex. .* for all branches. Examples: main, (main|release.*). Current MVP phase only support .* for wildcard.

minimumApprovalsCountinteger

Optional. The minimum number of approvals required for the branch rule to be matched.

disabledboolean

Optional. Determines if the branch rule is disabled or not.

allowStaleReviewsboolean

Optional. Determines if allow stale reviews or approvals before merging to the branch.

minimumReviewsCountinteger

Optional. The minimum number of reviews required for the branch rule to be matched.

uidstring

Output only. Unique identifier of the repository.

requireLinearHistoryboolean

Optional. Determines if require linear history before merging to the branch.

createTimestring google-datetime

Output only. Create timestamp.

updateTimestring google-datetime

Output only. Update timestamp.

etagstring

Optional. This checksum is computed by the server based on the value of other fields, and may be sent on update and delete requests to ensure the client has an up-to-date value before proceeding.

namestring

Identifier. A unique identifier for a BranchRule. The name should be of the format: projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}

requireCommentsResolvedboolean

Optional. Determines if require comments resolved before merging to the branch.

Response

Successful response