#[non_exhaustive]pub struct BranchRule {Show 15 fields
pub name: String,
pub uid: String,
pub create_time: Option<Timestamp>,
pub update_time: Option<Timestamp>,
pub annotations: HashMap<String, String>,
pub etag: String,
pub include_pattern: String,
pub disabled: bool,
pub require_pull_request: bool,
pub minimum_reviews_count: i32,
pub minimum_approvals_count: i32,
pub require_comments_resolved: bool,
pub allow_stale_reviews: bool,
pub require_linear_history: bool,
pub required_status_checks: Vec<Check>,
/* private fields */
}Expand description
Metadata of a BranchRule. BranchRule is the protection rule to enforce pre-defined rules on designated branches within a repository.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.name: StringOptional. A unique identifier for a BranchRule. The name should be of the
format:
projects/{project}/locations/{location}/repositories/{repository}/branchRules/{branch_rule}
uid: StringOutput only. Unique identifier of the repository.
create_time: Option<Timestamp>Output only. Create timestamp.
update_time: Option<Timestamp>Output only. Update timestamp.
annotations: HashMap<String, String>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.
etag: StringOptional. 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.
include_pattern: StringOptional. 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.
disabled: boolOptional. Determines if the branch rule is disabled or not.
require_pull_request: boolOptional. Determines if the branch rule requires a pull request or not.
minimum_reviews_count: i32Optional. The minimum number of reviews required for the branch rule to be matched.
minimum_approvals_count: i32Optional. The minimum number of approvals required for the branch rule to be matched.
require_comments_resolved: boolOptional. Determines if require comments resolved before merging to the branch.
allow_stale_reviews: boolOptional. Determines if allow stale reviews or approvals before merging to the branch.
require_linear_history: boolOptional. Determines if require linear history before merging to the branch.
required_status_checks: Vec<Check>Optional. List of required status checks before merging to the branch.
Implementations§
Source§impl BranchRule
impl BranchRule
pub fn new() -> Self
Sourcepub fn set_create_time<T>(self, v: T) -> Self
pub fn set_create_time<T>(self, v: T) -> Self
Sets the value of create_time.
Sourcepub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of create_time.
Sourcepub fn set_update_time<T>(self, v: T) -> Self
pub fn set_update_time<T>(self, v: T) -> Self
Sets the value of update_time.
Sourcepub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_update_time<T>(self, v: Option<T>) -> Self
Sets or clears the value of update_time.
Sourcepub fn set_annotations<T, K, V>(self, v: T) -> Self
pub fn set_annotations<T, K, V>(self, v: T) -> Self
Sets the value of annotations.
Sourcepub fn set_include_pattern<T: Into<String>>(self, v: T) -> Self
pub fn set_include_pattern<T: Into<String>>(self, v: T) -> Self
Sets the value of include_pattern.
Sourcepub fn set_disabled<T: Into<bool>>(self, v: T) -> Self
pub fn set_disabled<T: Into<bool>>(self, v: T) -> Self
Sets the value of disabled.
Sourcepub fn set_require_pull_request<T: Into<bool>>(self, v: T) -> Self
pub fn set_require_pull_request<T: Into<bool>>(self, v: T) -> Self
Sets the value of require_pull_request.
Sourcepub fn set_minimum_reviews_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_minimum_reviews_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of minimum_reviews_count.
Sourcepub fn set_minimum_approvals_count<T: Into<i32>>(self, v: T) -> Self
pub fn set_minimum_approvals_count<T: Into<i32>>(self, v: T) -> Self
Sets the value of minimum_approvals_count.
Sourcepub fn set_require_comments_resolved<T: Into<bool>>(self, v: T) -> Self
pub fn set_require_comments_resolved<T: Into<bool>>(self, v: T) -> Self
Sets the value of require_comments_resolved.
Sourcepub fn set_allow_stale_reviews<T: Into<bool>>(self, v: T) -> Self
pub fn set_allow_stale_reviews<T: Into<bool>>(self, v: T) -> Self
Sets the value of allow_stale_reviews.
Sourcepub fn set_require_linear_history<T: Into<bool>>(self, v: T) -> Self
pub fn set_require_linear_history<T: Into<bool>>(self, v: T) -> Self
Sets the value of require_linear_history.
Sourcepub fn set_required_status_checks<T, V>(self, v: T) -> Self
pub fn set_required_status_checks<T, V>(self, v: T) -> Self
Sets the value of required_status_checks.
Trait Implementations§
Source§impl Clone for BranchRule
impl Clone for BranchRule
Source§fn clone(&self) -> BranchRule
fn clone(&self) -> BranchRule
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more