Struct gitlab::api::projects::protected_branches::ProtectBranchBuilder
source · pub struct ProtectBranchBuilder<'a> { /* private fields */ }
Expand description
Builder for ProtectBranch
.
Implementations§
source§impl<'a> ProtectBranchBuilder<'a>
impl<'a> ProtectBranchBuilder<'a>
sourcepub fn project<VALUE: Into<NameOrId<'a>>>(&mut self, value: VALUE) -> &mut Self
pub fn project<VALUE: Into<NameOrId<'a>>>(&mut self, value: VALUE) -> &mut Self
The project to protect a branch within.
sourcepub fn name<VALUE: Into<Cow<'a, str>>>(&mut self, value: VALUE) -> &mut Self
pub fn name<VALUE: Into<Cow<'a, str>>>(&mut self, value: VALUE) -> &mut Self
The name or glob of the branch to protect.
sourcepub fn push_access_level(&mut self, value: ProtectedAccessLevel) -> &mut Self
pub fn push_access_level(&mut self, value: ProtectedAccessLevel) -> &mut Self
The minimum access level required to push to the branch.
sourcepub fn merge_access_level(&mut self, value: ProtectedAccessLevel) -> &mut Self
pub fn merge_access_level(&mut self, value: ProtectedAccessLevel) -> &mut Self
The minimum access level required to merge into the branch.
sourcepub fn unprotect_access_level(
&mut self,
value: ProtectedAccessLevel
) -> &mut Self
pub fn unprotect_access_level( &mut self, value: ProtectedAccessLevel ) -> &mut Self
The minimum access level required to unprotect the branch.
sourcepub fn allow_force_push(&mut self, value: bool) -> &mut Self
pub fn allow_force_push(&mut self, value: bool) -> &mut Self
Allow all users with push access to force push.
sourcepub fn code_owner_approval_required(&mut self, value: bool) -> &mut Self
pub fn code_owner_approval_required(&mut self, value: bool) -> &mut Self
Whether code owner approval is required to merge.
sourcepub fn build(&self) -> Result<ProtectBranch<'a>, ProtectBranchBuilderError>
pub fn build(&self) -> Result<ProtectBranch<'a>, ProtectBranchBuilderError>
source§impl<'a> ProtectBranchBuilder<'a>
impl<'a> ProtectBranchBuilder<'a>
sourcepub fn allowed_to_push(
&mut self,
access: ProtectedAccess<ProtectedAccessLevel>
) -> &mut Self
pub fn allowed_to_push( &mut self, access: ProtectedAccess<ProtectedAccessLevel> ) -> &mut Self
Add access to push to the branch.
sourcepub fn allowed_to_merge(
&mut self,
access: ProtectedAccess<ProtectedAccessLevel>
) -> &mut Self
pub fn allowed_to_merge( &mut self, access: ProtectedAccess<ProtectedAccessLevel> ) -> &mut Self
Add access to merge into the branch.
sourcepub fn allowed_to_unprotect(
&mut self,
access: ProtectedAccess<ProtectedAccessLevelWithAccess>
) -> &mut Self
pub fn allowed_to_unprotect( &mut self, access: ProtectedAccess<ProtectedAccessLevelWithAccess> ) -> &mut Self
Add access to unprotect the branch.
Trait Implementations§
source§impl<'a> Clone for ProtectBranchBuilder<'a>
impl<'a> Clone for ProtectBranchBuilder<'a>
source§fn clone(&self) -> ProtectBranchBuilder<'a>
fn clone(&self) -> ProtectBranchBuilder<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for ProtectBranchBuilder<'a>
impl<'a> RefUnwindSafe for ProtectBranchBuilder<'a>
impl<'a> Send for ProtectBranchBuilder<'a>
impl<'a> Sync for ProtectBranchBuilder<'a>
impl<'a> Unpin for ProtectBranchBuilder<'a>
impl<'a> UnwindSafe for ProtectBranchBuilder<'a>
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
Mutably borrows from an owned value. Read more
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more