#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct RepositoryBranchInput {
pub provider: crate::types::RepositoryProvider,
pub name: ::std::string::String,
pub branch: ::std::string::String,
}
impl RepositoryBranchInput {
pub fn provider(&self) -> &crate::types::RepositoryProvider {
&self.provider
}
pub fn name(&self) -> &str {
use std::ops::Deref;
self.name.deref()
}
pub fn branch(&self) -> &str {
use std::ops::Deref;
self.branch.deref()
}
}
impl RepositoryBranchInput {
pub fn builder() -> crate::types::builders::RepositoryBranchInputBuilder {
crate::types::builders::RepositoryBranchInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct RepositoryBranchInputBuilder {
pub(crate) provider: ::std::option::Option<crate::types::RepositoryProvider>,
pub(crate) name: ::std::option::Option<::std::string::String>,
pub(crate) branch: ::std::option::Option<::std::string::String>,
}
impl RepositoryBranchInputBuilder {
pub fn provider(mut self, input: crate::types::RepositoryProvider) -> Self {
self.provider = ::std::option::Option::Some(input);
self
}
pub fn set_provider(mut self, input: ::std::option::Option<crate::types::RepositoryProvider>) -> Self {
self.provider = input;
self
}
pub fn get_provider(&self) -> &::std::option::Option<crate::types::RepositoryProvider> {
&self.provider
}
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.name = ::std::option::Option::Some(input.into());
self
}
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.name = input;
self
}
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
&self.name
}
pub fn branch(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.branch = ::std::option::Option::Some(input.into());
self
}
pub fn set_branch(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.branch = input;
self
}
pub fn get_branch(&self) -> &::std::option::Option<::std::string::String> {
&self.branch
}
pub fn build(self) -> ::std::result::Result<crate::types::RepositoryBranchInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::RepositoryBranchInput {
provider: self.provider.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"provider",
"provider was not specified but it is required when building RepositoryBranchInput",
)
})?,
name: self.name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"name",
"name was not specified but it is required when building RepositoryBranchInput",
)
})?,
branch: self.branch.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"branch",
"branch was not specified but it is required when building RepositoryBranchInput",
)
})?,
})
}
}