#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct TemplateSyncConfig {
pub template_name: ::std::string::String,
pub template_type: crate::types::TemplateType,
pub repository_provider: crate::types::RepositoryProvider,
pub repository_name: ::std::string::String,
pub branch: ::std::string::String,
pub subdirectory: ::std::option::Option<::std::string::String>,
}
impl TemplateSyncConfig {
pub fn template_name(&self) -> &str {
use std::ops::Deref;
self.template_name.deref()
}
pub fn template_type(&self) -> &crate::types::TemplateType {
&self.template_type
}
pub fn repository_provider(&self) -> &crate::types::RepositoryProvider {
&self.repository_provider
}
pub fn repository_name(&self) -> &str {
use std::ops::Deref;
self.repository_name.deref()
}
pub fn branch(&self) -> &str {
use std::ops::Deref;
self.branch.deref()
}
pub fn subdirectory(&self) -> ::std::option::Option<&str> {
self.subdirectory.as_deref()
}
}
impl TemplateSyncConfig {
pub fn builder() -> crate::types::builders::TemplateSyncConfigBuilder {
crate::types::builders::TemplateSyncConfigBuilder::default()
}
}
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
pub struct TemplateSyncConfigBuilder {
pub(crate) template_name: ::std::option::Option<::std::string::String>,
pub(crate) template_type: ::std::option::Option<crate::types::TemplateType>,
pub(crate) repository_provider: ::std::option::Option<crate::types::RepositoryProvider>,
pub(crate) repository_name: ::std::option::Option<::std::string::String>,
pub(crate) branch: ::std::option::Option<::std::string::String>,
pub(crate) subdirectory: ::std::option::Option<::std::string::String>,
}
impl TemplateSyncConfigBuilder {
pub fn template_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.template_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_template_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.template_name = input;
self
}
pub fn get_template_name(&self) -> &::std::option::Option<::std::string::String> {
&self.template_name
}
pub fn template_type(mut self, input: crate::types::TemplateType) -> Self {
self.template_type = ::std::option::Option::Some(input);
self
}
pub fn set_template_type(mut self, input: ::std::option::Option<crate::types::TemplateType>) -> Self {
self.template_type = input;
self
}
pub fn get_template_type(&self) -> &::std::option::Option<crate::types::TemplateType> {
&self.template_type
}
pub fn repository_provider(mut self, input: crate::types::RepositoryProvider) -> Self {
self.repository_provider = ::std::option::Option::Some(input);
self
}
pub fn set_repository_provider(mut self, input: ::std::option::Option<crate::types::RepositoryProvider>) -> Self {
self.repository_provider = input;
self
}
pub fn get_repository_provider(&self) -> &::std::option::Option<crate::types::RepositoryProvider> {
&self.repository_provider
}
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
}
pub fn set_repository_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.repository_name = input;
self
}
pub fn get_repository_name(&self) -> &::std::option::Option<::std::string::String> {
&self.repository_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 subdirectory(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.subdirectory = ::std::option::Option::Some(input.into());
self
}
pub fn set_subdirectory(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.subdirectory = input;
self
}
pub fn get_subdirectory(&self) -> &::std::option::Option<::std::string::String> {
&self.subdirectory
}
pub fn build(self) -> ::std::result::Result<crate::types::TemplateSyncConfig, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::types::TemplateSyncConfig {
template_name: self.template_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"template_name",
"template_name was not specified but it is required when building TemplateSyncConfig",
)
})?,
template_type: self.template_type.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"template_type",
"template_type was not specified but it is required when building TemplateSyncConfig",
)
})?,
repository_provider: self.repository_provider.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"repository_provider",
"repository_provider was not specified but it is required when building TemplateSyncConfig",
)
})?,
repository_name: self.repository_name.ok_or_else(|| {
::aws_smithy_types::error::operation::BuildError::missing_field(
"repository_name",
"repository_name was not specified but it is required when building TemplateSyncConfig",
)
})?,
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 TemplateSyncConfig",
)
})?,
subdirectory: self.subdirectory,
})
}
}