aws_sdk_glue/operation/create_table/
_create_table_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateTableInput {
6 pub catalog_id: ::std::option::Option<::std::string::String>,
8 pub database_name: ::std::option::Option<::std::string::String>,
10 pub name: ::std::option::Option<::std::string::String>,
12 pub table_input: ::std::option::Option<crate::types::TableInput>,
14 pub partition_indexes: ::std::option::Option<::std::vec::Vec<crate::types::PartitionIndex>>,
16 pub transaction_id: ::std::option::Option<::std::string::String>,
18 pub open_table_format_input: ::std::option::Option<crate::types::OpenTableFormatInput>,
20}
21impl CreateTableInput {
22 pub fn catalog_id(&self) -> ::std::option::Option<&str> {
24 self.catalog_id.as_deref()
25 }
26 pub fn database_name(&self) -> ::std::option::Option<&str> {
28 self.database_name.as_deref()
29 }
30 pub fn name(&self) -> ::std::option::Option<&str> {
32 self.name.as_deref()
33 }
34 pub fn table_input(&self) -> ::std::option::Option<&crate::types::TableInput> {
36 self.table_input.as_ref()
37 }
38 pub fn partition_indexes(&self) -> &[crate::types::PartitionIndex] {
42 self.partition_indexes.as_deref().unwrap_or_default()
43 }
44 pub fn transaction_id(&self) -> ::std::option::Option<&str> {
46 self.transaction_id.as_deref()
47 }
48 pub fn open_table_format_input(&self) -> ::std::option::Option<&crate::types::OpenTableFormatInput> {
50 self.open_table_format_input.as_ref()
51 }
52}
53impl CreateTableInput {
54 pub fn builder() -> crate::operation::create_table::builders::CreateTableInputBuilder {
56 crate::operation::create_table::builders::CreateTableInputBuilder::default()
57 }
58}
59
60#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
62#[non_exhaustive]
63pub struct CreateTableInputBuilder {
64 pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
65 pub(crate) database_name: ::std::option::Option<::std::string::String>,
66 pub(crate) name: ::std::option::Option<::std::string::String>,
67 pub(crate) table_input: ::std::option::Option<crate::types::TableInput>,
68 pub(crate) partition_indexes: ::std::option::Option<::std::vec::Vec<crate::types::PartitionIndex>>,
69 pub(crate) transaction_id: ::std::option::Option<::std::string::String>,
70 pub(crate) open_table_format_input: ::std::option::Option<crate::types::OpenTableFormatInput>,
71}
72impl CreateTableInputBuilder {
73 pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75 self.catalog_id = ::std::option::Option::Some(input.into());
76 self
77 }
78 pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80 self.catalog_id = input;
81 self
82 }
83 pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
85 &self.catalog_id
86 }
87 pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
90 self.database_name = ::std::option::Option::Some(input.into());
91 self
92 }
93 pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
95 self.database_name = input;
96 self
97 }
98 pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
100 &self.database_name
101 }
102 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104 self.name = ::std::option::Option::Some(input.into());
105 self
106 }
107 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109 self.name = input;
110 self
111 }
112 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
114 &self.name
115 }
116 pub fn table_input(mut self, input: crate::types::TableInput) -> Self {
118 self.table_input = ::std::option::Option::Some(input);
119 self
120 }
121 pub fn set_table_input(mut self, input: ::std::option::Option<crate::types::TableInput>) -> Self {
123 self.table_input = input;
124 self
125 }
126 pub fn get_table_input(&self) -> &::std::option::Option<crate::types::TableInput> {
128 &self.table_input
129 }
130 pub fn partition_indexes(mut self, input: crate::types::PartitionIndex) -> Self {
136 let mut v = self.partition_indexes.unwrap_or_default();
137 v.push(input);
138 self.partition_indexes = ::std::option::Option::Some(v);
139 self
140 }
141 pub fn set_partition_indexes(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::PartitionIndex>>) -> Self {
143 self.partition_indexes = input;
144 self
145 }
146 pub fn get_partition_indexes(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::PartitionIndex>> {
148 &self.partition_indexes
149 }
150 pub fn transaction_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
152 self.transaction_id = ::std::option::Option::Some(input.into());
153 self
154 }
155 pub fn set_transaction_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
157 self.transaction_id = input;
158 self
159 }
160 pub fn get_transaction_id(&self) -> &::std::option::Option<::std::string::String> {
162 &self.transaction_id
163 }
164 pub fn open_table_format_input(mut self, input: crate::types::OpenTableFormatInput) -> Self {
166 self.open_table_format_input = ::std::option::Option::Some(input);
167 self
168 }
169 pub fn set_open_table_format_input(mut self, input: ::std::option::Option<crate::types::OpenTableFormatInput>) -> Self {
171 self.open_table_format_input = input;
172 self
173 }
174 pub fn get_open_table_format_input(&self) -> &::std::option::Option<crate::types::OpenTableFormatInput> {
176 &self.open_table_format_input
177 }
178 pub fn build(self) -> ::std::result::Result<crate::operation::create_table::CreateTableInput, ::aws_smithy_types::error::operation::BuildError> {
180 ::std::result::Result::Ok(crate::operation::create_table::CreateTableInput {
181 catalog_id: self.catalog_id,
182 database_name: self.database_name,
183 name: self.name,
184 table_input: self.table_input,
185 partition_indexes: self.partition_indexes,
186 transaction_id: self.transaction_id,
187 open_table_format_input: self.open_table_format_input,
188 })
189 }
190}