#[allow(missing_docs)] #[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateGlobalTableInput {
pub global_table_name: ::std::option::Option<::std::string::String>,
pub replication_group: ::std::option::Option<::std::vec::Vec<crate::types::Replica>>,
}
impl CreateGlobalTableInput {
pub fn global_table_name(&self) -> ::std::option::Option<&str> {
self.global_table_name.as_deref()
}
pub fn replication_group(&self) -> &[crate::types::Replica] {
self.replication_group.as_deref().unwrap_or_default()
}
}
impl CreateGlobalTableInput {
pub fn builder() -> crate::operation::create_global_table::builders::CreateGlobalTableInputBuilder {
crate::operation::create_global_table::builders::CreateGlobalTableInputBuilder::default()
}
}
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateGlobalTableInputBuilder {
pub(crate) global_table_name: ::std::option::Option<::std::string::String>,
pub(crate) replication_group: ::std::option::Option<::std::vec::Vec<crate::types::Replica>>,
}
impl CreateGlobalTableInputBuilder {
pub fn global_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.global_table_name = ::std::option::Option::Some(input.into());
self
}
pub fn set_global_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.global_table_name = input;
self
}
pub fn get_global_table_name(&self) -> &::std::option::Option<::std::string::String> {
&self.global_table_name
}
pub fn replication_group(mut self, input: crate::types::Replica) -> Self {
let mut v = self.replication_group.unwrap_or_default();
v.push(input);
self.replication_group = ::std::option::Option::Some(v);
self
}
pub fn set_replication_group(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Replica>>) -> Self {
self.replication_group = input;
self
}
pub fn get_replication_group(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Replica>> {
&self.replication_group
}
pub fn build(
self,
) -> ::std::result::Result<crate::operation::create_global_table::CreateGlobalTableInput, ::aws_smithy_types::error::operation::BuildError> {
::std::result::Result::Ok(crate::operation::create_global_table::CreateGlobalTableInput {
global_table_name: self.global_table_name,
replication_group: self.replication_group,
})
}
}