aws-sdk-codecommit 1.99.0

AWS SDK for AWS CodeCommit
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Represents the input of an update default branch operation.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct UpdateDefaultBranchInput {
    /// <p>The name of the repository for which you want to set or change the default branch.</p>
    pub repository_name: ::std::option::Option<::std::string::String>,
    /// <p>The name of the branch to set as the default branch.</p>
    pub default_branch_name: ::std::option::Option<::std::string::String>,
}
impl UpdateDefaultBranchInput {
    /// <p>The name of the repository for which you want to set or change the default branch.</p>
    pub fn repository_name(&self) -> ::std::option::Option<&str> {
        self.repository_name.as_deref()
    }
    /// <p>The name of the branch to set as the default branch.</p>
    pub fn default_branch_name(&self) -> ::std::option::Option<&str> {
        self.default_branch_name.as_deref()
    }
}
impl UpdateDefaultBranchInput {
    /// Creates a new builder-style object to manufacture [`UpdateDefaultBranchInput`](crate::operation::update_default_branch::UpdateDefaultBranchInput).
    pub fn builder() -> crate::operation::update_default_branch::builders::UpdateDefaultBranchInputBuilder {
        crate::operation::update_default_branch::builders::UpdateDefaultBranchInputBuilder::default()
    }
}

/// A builder for [`UpdateDefaultBranchInput`](crate::operation::update_default_branch::UpdateDefaultBranchInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct UpdateDefaultBranchInputBuilder {
    pub(crate) repository_name: ::std::option::Option<::std::string::String>,
    pub(crate) default_branch_name: ::std::option::Option<::std::string::String>,
}
impl UpdateDefaultBranchInputBuilder {
    /// <p>The name of the repository for which you want to set or change the default branch.</p>
    /// This field is required.
    pub fn repository_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.repository_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the repository for which you want to set or change the default branch.</p>
    pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.repository_name = input;
        self
    }
    /// <p>The name of the repository for which you want to set or change the default branch.</p>
    pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.repository_name
    }
    /// <p>The name of the branch to set as the default branch.</p>
    /// This field is required.
    pub fn default_branch_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.default_branch_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the branch to set as the default branch.</p>
    pub fn set_default_branch_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.default_branch_name = input;
        self
    }
    /// <p>The name of the branch to set as the default branch.</p>
    pub fn get_default_branch_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.default_branch_name
    }
    /// Consumes the builder and constructs a [`UpdateDefaultBranchInput`](crate::operation::update_default_branch::UpdateDefaultBranchInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::update_default_branch::UpdateDefaultBranchInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::update_default_branch::UpdateDefaultBranchInput {
            repository_name: self.repository_name,
            default_branch_name: self.default_branch_name,
        })
    }
}