#[non_exhaustive]pub struct BranchRule {Show 16 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_code_owner_approval: bool,
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: StringIdentifier. 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_code_owner_approval: boolOptional. Determines if code owners must approve before merging to the branch.
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
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.
§Example
use wkt::Timestamp;
let x = BranchRule::new().set_create_time(Timestamp::default()/* use setters */);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.
§Example
use wkt::Timestamp;
let x = BranchRule::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = BranchRule::new().set_or_clear_create_time(None::<Timestamp>);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.
§Example
use wkt::Timestamp;
let x = BranchRule::new().set_update_time(Timestamp::default()/* use setters */);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.
§Example
use wkt::Timestamp;
let x = BranchRule::new().set_or_clear_update_time(Some(Timestamp::default()/* use setters */));
let x = BranchRule::new().set_or_clear_update_time(None::<Timestamp>);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.
§Example
let x = BranchRule::new().set_annotations([
("key0", "abc"),
("key1", "xyz"),
]);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.
§Example
let x = BranchRule::new().set_include_pattern("example");Sourcepub fn set_disabled<T: Into<bool>>(self, v: T) -> Self
pub fn set_disabled<T: Into<bool>>(self, v: T) -> Self
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.
§Example
let x = BranchRule::new().set_require_pull_request(true);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.
§Example
let x = BranchRule::new().set_minimum_reviews_count(42);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.
§Example
let x = BranchRule::new().set_minimum_approvals_count(42);Sourcepub fn set_require_code_owner_approval<T: Into<bool>>(self, v: T) -> Self
pub fn set_require_code_owner_approval<T: Into<bool>>(self, v: T) -> Self
Sets the value of require_code_owner_approval.
§Example
let x = BranchRule::new().set_require_code_owner_approval(true);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.
§Example
let x = BranchRule::new().set_require_comments_resolved(true);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.
§Example
let x = BranchRule::new().set_allow_stale_reviews(true);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.
§Example
let x = BranchRule::new().set_require_linear_history(true);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.
§Example
use google_cloud_securesourcemanager_v1::model::branch_rule::Check;
let x = BranchRule::new()
.set_required_status_checks([
Check::default()/* use setters */,
Check::default()/* use (different) setters */,
]);Trait Implementations§
Source§impl Clone for BranchRule
impl Clone for BranchRule
Source§fn clone(&self) -> BranchRule
fn clone(&self) -> BranchRule
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BranchRule
impl Debug for BranchRule
Source§impl Default for BranchRule
impl Default for BranchRule
Source§fn default() -> BranchRule
fn default() -> BranchRule
Source§impl PartialEq for BranchRule
impl PartialEq for BranchRule
impl StructuralPartialEq for BranchRule
Auto Trait Implementations§
impl Freeze for BranchRule
impl RefUnwindSafe for BranchRule
impl Send for BranchRule
impl Sync for BranchRule
impl Unpin for BranchRule
impl UnsafeUnpin for BranchRule
impl UnwindSafe for BranchRule
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request