aws_sdk_dynamodb/operation/create_global_table/
_create_global_table_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateGlobalTableInput {
6 pub global_table_name: ::std::option::Option<::std::string::String>,
8 pub replication_group: ::std::option::Option<::std::vec::Vec<crate::types::Replica>>,
10}
11impl CreateGlobalTableInput {
12 pub fn global_table_name(&self) -> ::std::option::Option<&str> {
14 self.global_table_name.as_deref()
15 }
16 pub fn replication_group(&self) -> &[crate::types::Replica] {
20 self.replication_group.as_deref().unwrap_or_default()
21 }
22}
23impl CreateGlobalTableInput {
24 pub fn builder() -> crate::operation::create_global_table::builders::CreateGlobalTableInputBuilder {
26 crate::operation::create_global_table::builders::CreateGlobalTableInputBuilder::default()
27 }
28}
29
30#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
32#[non_exhaustive]
33pub struct CreateGlobalTableInputBuilder {
34 pub(crate) global_table_name: ::std::option::Option<::std::string::String>,
35 pub(crate) replication_group: ::std::option::Option<::std::vec::Vec<crate::types::Replica>>,
36}
37impl CreateGlobalTableInputBuilder {
38 pub fn global_table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
41 self.global_table_name = ::std::option::Option::Some(input.into());
42 self
43 }
44 pub fn set_global_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
46 self.global_table_name = input;
47 self
48 }
49 pub fn get_global_table_name(&self) -> &::std::option::Option<::std::string::String> {
51 &self.global_table_name
52 }
53 pub fn replication_group(mut self, input: crate::types::Replica) -> Self {
59 let mut v = self.replication_group.unwrap_or_default();
60 v.push(input);
61 self.replication_group = ::std::option::Option::Some(v);
62 self
63 }
64 pub fn set_replication_group(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Replica>>) -> Self {
66 self.replication_group = input;
67 self
68 }
69 pub fn get_replication_group(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Replica>> {
71 &self.replication_group
72 }
73 pub fn build(
75 self,
76 ) -> ::std::result::Result<crate::operation::create_global_table::CreateGlobalTableInput, ::aws_smithy_types::error::operation::BuildError> {
77 ::std::result::Result::Ok(crate::operation::create_global_table::CreateGlobalTableInput {
78 global_table_name: self.global_table_name,
79 replication_group: self.replication_group,
80 })
81 }
82}