aws_sdk_timestreamwrite/operation/update_table/
_update_table_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct UpdateTableInput {
6    /// <p>The name of the Timestream database.</p>
7    pub database_name: ::std::option::Option<::std::string::String>,
8    /// <p>The name of the Timestream table.</p>
9    pub table_name: ::std::option::Option<::std::string::String>,
10    /// <p>The retention duration of the memory store and the magnetic store.</p>
11    pub retention_properties: ::std::option::Option<crate::types::RetentionProperties>,
12    /// <p>Contains properties to set on the table when enabling magnetic store writes.</p>
13    pub magnetic_store_write_properties: ::std::option::Option<crate::types::MagneticStoreWriteProperties>,
14    /// <p>The schema of the table.</p>
15    pub schema: ::std::option::Option<crate::types::Schema>,
16}
17impl UpdateTableInput {
18    /// <p>The name of the Timestream database.</p>
19    pub fn database_name(&self) -> ::std::option::Option<&str> {
20        self.database_name.as_deref()
21    }
22    /// <p>The name of the Timestream table.</p>
23    pub fn table_name(&self) -> ::std::option::Option<&str> {
24        self.table_name.as_deref()
25    }
26    /// <p>The retention duration of the memory store and the magnetic store.</p>
27    pub fn retention_properties(&self) -> ::std::option::Option<&crate::types::RetentionProperties> {
28        self.retention_properties.as_ref()
29    }
30    /// <p>Contains properties to set on the table when enabling magnetic store writes.</p>
31    pub fn magnetic_store_write_properties(&self) -> ::std::option::Option<&crate::types::MagneticStoreWriteProperties> {
32        self.magnetic_store_write_properties.as_ref()
33    }
34    /// <p>The schema of the table.</p>
35    pub fn schema(&self) -> ::std::option::Option<&crate::types::Schema> {
36        self.schema.as_ref()
37    }
38}
39impl UpdateTableInput {
40    /// Creates a new builder-style object to manufacture [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
41    pub fn builder() -> crate::operation::update_table::builders::UpdateTableInputBuilder {
42        crate::operation::update_table::builders::UpdateTableInputBuilder::default()
43    }
44}
45
46/// A builder for [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
47#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
48#[non_exhaustive]
49pub struct UpdateTableInputBuilder {
50    pub(crate) database_name: ::std::option::Option<::std::string::String>,
51    pub(crate) table_name: ::std::option::Option<::std::string::String>,
52    pub(crate) retention_properties: ::std::option::Option<crate::types::RetentionProperties>,
53    pub(crate) magnetic_store_write_properties: ::std::option::Option<crate::types::MagneticStoreWriteProperties>,
54    pub(crate) schema: ::std::option::Option<crate::types::Schema>,
55}
56impl UpdateTableInputBuilder {
57    /// <p>The name of the Timestream database.</p>
58    /// This field is required.
59    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
60        self.database_name = ::std::option::Option::Some(input.into());
61        self
62    }
63    /// <p>The name of the Timestream database.</p>
64    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
65        self.database_name = input;
66        self
67    }
68    /// <p>The name of the Timestream database.</p>
69    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
70        &self.database_name
71    }
72    /// <p>The name of the Timestream table.</p>
73    /// This field is required.
74    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
75        self.table_name = ::std::option::Option::Some(input.into());
76        self
77    }
78    /// <p>The name of the Timestream table.</p>
79    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
80        self.table_name = input;
81        self
82    }
83    /// <p>The name of the Timestream table.</p>
84    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
85        &self.table_name
86    }
87    /// <p>The retention duration of the memory store and the magnetic store.</p>
88    pub fn retention_properties(mut self, input: crate::types::RetentionProperties) -> Self {
89        self.retention_properties = ::std::option::Option::Some(input);
90        self
91    }
92    /// <p>The retention duration of the memory store and the magnetic store.</p>
93    pub fn set_retention_properties(mut self, input: ::std::option::Option<crate::types::RetentionProperties>) -> Self {
94        self.retention_properties = input;
95        self
96    }
97    /// <p>The retention duration of the memory store and the magnetic store.</p>
98    pub fn get_retention_properties(&self) -> &::std::option::Option<crate::types::RetentionProperties> {
99        &self.retention_properties
100    }
101    /// <p>Contains properties to set on the table when enabling magnetic store writes.</p>
102    pub fn magnetic_store_write_properties(mut self, input: crate::types::MagneticStoreWriteProperties) -> Self {
103        self.magnetic_store_write_properties = ::std::option::Option::Some(input);
104        self
105    }
106    /// <p>Contains properties to set on the table when enabling magnetic store writes.</p>
107    pub fn set_magnetic_store_write_properties(mut self, input: ::std::option::Option<crate::types::MagneticStoreWriteProperties>) -> Self {
108        self.magnetic_store_write_properties = input;
109        self
110    }
111    /// <p>Contains properties to set on the table when enabling magnetic store writes.</p>
112    pub fn get_magnetic_store_write_properties(&self) -> &::std::option::Option<crate::types::MagneticStoreWriteProperties> {
113        &self.magnetic_store_write_properties
114    }
115    /// <p>The schema of the table.</p>
116    pub fn schema(mut self, input: crate::types::Schema) -> Self {
117        self.schema = ::std::option::Option::Some(input);
118        self
119    }
120    /// <p>The schema of the table.</p>
121    pub fn set_schema(mut self, input: ::std::option::Option<crate::types::Schema>) -> Self {
122        self.schema = input;
123        self
124    }
125    /// <p>The schema of the table.</p>
126    pub fn get_schema(&self) -> &::std::option::Option<crate::types::Schema> {
127        &self.schema
128    }
129    /// Consumes the builder and constructs a [`UpdateTableInput`](crate::operation::update_table::UpdateTableInput).
130    pub fn build(self) -> ::std::result::Result<crate::operation::update_table::UpdateTableInput, ::aws_smithy_types::error::operation::BuildError> {
131        ::std::result::Result::Ok(crate::operation::update_table::UpdateTableInput {
132            database_name: self.database_name,
133            table_name: self.table_name,
134            retention_properties: self.retention_properties,
135            magnetic_store_write_properties: self.magnetic_store_write_properties,
136            schema: self.schema,
137        })
138    }
139}