aws_sdk_firehose/types/
_schema_configuration.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// <p>Specifies the schema to which you want Firehose to configure your data before it writes it to Amazon S3. This parameter is required if <code>Enabled</code> is set to true.</p>
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct SchemaConfiguration {
7    /// <p>The role that Firehose can use to access Amazon Web Services Glue. This role must be in the same account you use for Firehose. Cross-account roles aren't allowed.</p><important>
8    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>RoleARN</code> property is required and its value must be specified.</p>
9    /// </important>
10    pub role_arn: ::std::option::Option<::std::string::String>,
11    /// <p>The ID of the Amazon Web Services Glue Data Catalog. If you don't supply this, the Amazon Web Services account ID is used by default.</p>
12    pub catalog_id: ::std::option::Option<::std::string::String>,
13    /// <p>Specifies the name of the Amazon Web Services Glue database that contains the schema for the output data.</p><important>
14    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>DatabaseName</code> property is required and its value must be specified.</p>
15    /// </important>
16    pub database_name: ::std::option::Option<::std::string::String>,
17    /// <p>Specifies the Amazon Web Services Glue table that contains the column information that constitutes your data schema.</p><important>
18    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>TableName</code> property is required and its value must be specified.</p>
19    /// </important>
20    pub table_name: ::std::option::Option<::std::string::String>,
21    /// <p>If you don't specify an Amazon Web Services Region, the default is the current Region.</p>
22    pub region: ::std::option::Option<::std::string::String>,
23    /// <p>Specifies the table version for the output data schema. If you don't specify this version ID, or if you set it to <code>LATEST</code>, Firehose uses the most recent version. This means that any updates to the table are automatically picked up.</p>
24    pub version_id: ::std::option::Option<::std::string::String>,
25}
26impl SchemaConfiguration {
27    /// <p>The role that Firehose can use to access Amazon Web Services Glue. This role must be in the same account you use for Firehose. Cross-account roles aren't allowed.</p><important>
28    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>RoleARN</code> property is required and its value must be specified.</p>
29    /// </important>
30    pub fn role_arn(&self) -> ::std::option::Option<&str> {
31        self.role_arn.as_deref()
32    }
33    /// <p>The ID of the Amazon Web Services Glue Data Catalog. If you don't supply this, the Amazon Web Services account ID is used by default.</p>
34    pub fn catalog_id(&self) -> ::std::option::Option<&str> {
35        self.catalog_id.as_deref()
36    }
37    /// <p>Specifies the name of the Amazon Web Services Glue database that contains the schema for the output data.</p><important>
38    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>DatabaseName</code> property is required and its value must be specified.</p>
39    /// </important>
40    pub fn database_name(&self) -> ::std::option::Option<&str> {
41        self.database_name.as_deref()
42    }
43    /// <p>Specifies the Amazon Web Services Glue table that contains the column information that constitutes your data schema.</p><important>
44    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>TableName</code> property is required and its value must be specified.</p>
45    /// </important>
46    pub fn table_name(&self) -> ::std::option::Option<&str> {
47        self.table_name.as_deref()
48    }
49    /// <p>If you don't specify an Amazon Web Services Region, the default is the current Region.</p>
50    pub fn region(&self) -> ::std::option::Option<&str> {
51        self.region.as_deref()
52    }
53    /// <p>Specifies the table version for the output data schema. If you don't specify this version ID, or if you set it to <code>LATEST</code>, Firehose uses the most recent version. This means that any updates to the table are automatically picked up.</p>
54    pub fn version_id(&self) -> ::std::option::Option<&str> {
55        self.version_id.as_deref()
56    }
57}
58impl SchemaConfiguration {
59    /// Creates a new builder-style object to manufacture [`SchemaConfiguration`](crate::types::SchemaConfiguration).
60    pub fn builder() -> crate::types::builders::SchemaConfigurationBuilder {
61        crate::types::builders::SchemaConfigurationBuilder::default()
62    }
63}
64
65/// A builder for [`SchemaConfiguration`](crate::types::SchemaConfiguration).
66#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
67#[non_exhaustive]
68pub struct SchemaConfigurationBuilder {
69    pub(crate) role_arn: ::std::option::Option<::std::string::String>,
70    pub(crate) catalog_id: ::std::option::Option<::std::string::String>,
71    pub(crate) database_name: ::std::option::Option<::std::string::String>,
72    pub(crate) table_name: ::std::option::Option<::std::string::String>,
73    pub(crate) region: ::std::option::Option<::std::string::String>,
74    pub(crate) version_id: ::std::option::Option<::std::string::String>,
75}
76impl SchemaConfigurationBuilder {
77    /// <p>The role that Firehose can use to access Amazon Web Services Glue. This role must be in the same account you use for Firehose. Cross-account roles aren't allowed.</p><important>
78    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>RoleARN</code> property is required and its value must be specified.</p>
79    /// </important>
80    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.role_arn = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>The role that Firehose can use to access Amazon Web Services Glue. This role must be in the same account you use for Firehose. Cross-account roles aren't allowed.</p><important>
85    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>RoleARN</code> property is required and its value must be specified.</p>
86    /// </important>
87    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
88        self.role_arn = input;
89        self
90    }
91    /// <p>The role that Firehose can use to access Amazon Web Services Glue. This role must be in the same account you use for Firehose. Cross-account roles aren't allowed.</p><important>
92    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>RoleARN</code> property is required and its value must be specified.</p>
93    /// </important>
94    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
95        &self.role_arn
96    }
97    /// <p>The ID of the Amazon Web Services Glue Data Catalog. If you don't supply this, the Amazon Web Services account ID is used by default.</p>
98    pub fn catalog_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.catalog_id = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The ID of the Amazon Web Services Glue Data Catalog. If you don't supply this, the Amazon Web Services account ID is used by default.</p>
103    pub fn set_catalog_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.catalog_id = input;
105        self
106    }
107    /// <p>The ID of the Amazon Web Services Glue Data Catalog. If you don't supply this, the Amazon Web Services account ID is used by default.</p>
108    pub fn get_catalog_id(&self) -> &::std::option::Option<::std::string::String> {
109        &self.catalog_id
110    }
111    /// <p>Specifies the name of the Amazon Web Services Glue database that contains the schema for the output data.</p><important>
112    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>DatabaseName</code> property is required and its value must be specified.</p>
113    /// </important>
114    pub fn database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
115        self.database_name = ::std::option::Option::Some(input.into());
116        self
117    }
118    /// <p>Specifies the name of the Amazon Web Services Glue database that contains the schema for the output data.</p><important>
119    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>DatabaseName</code> property is required and its value must be specified.</p>
120    /// </important>
121    pub fn set_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.database_name = input;
123        self
124    }
125    /// <p>Specifies the name of the Amazon Web Services Glue database that contains the schema for the output data.</p><important>
126    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>DatabaseName</code> property is required and its value must be specified.</p>
127    /// </important>
128    pub fn get_database_name(&self) -> &::std::option::Option<::std::string::String> {
129        &self.database_name
130    }
131    /// <p>Specifies the Amazon Web Services Glue table that contains the column information that constitutes your data schema.</p><important>
132    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>TableName</code> property is required and its value must be specified.</p>
133    /// </important>
134    pub fn table_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
135        self.table_name = ::std::option::Option::Some(input.into());
136        self
137    }
138    /// <p>Specifies the Amazon Web Services Glue table that contains the column information that constitutes your data schema.</p><important>
139    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>TableName</code> property is required and its value must be specified.</p>
140    /// </important>
141    pub fn set_table_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.table_name = input;
143        self
144    }
145    /// <p>Specifies the Amazon Web Services Glue table that contains the column information that constitutes your data schema.</p><important>
146    /// <p>If the <code>SchemaConfiguration</code> request parameter is used as part of invoking the <code>CreateDeliveryStream</code> API, then the <code>TableName</code> property is required and its value must be specified.</p>
147    /// </important>
148    pub fn get_table_name(&self) -> &::std::option::Option<::std::string::String> {
149        &self.table_name
150    }
151    /// <p>If you don't specify an Amazon Web Services Region, the default is the current Region.</p>
152    pub fn region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
153        self.region = ::std::option::Option::Some(input.into());
154        self
155    }
156    /// <p>If you don't specify an Amazon Web Services Region, the default is the current Region.</p>
157    pub fn set_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
158        self.region = input;
159        self
160    }
161    /// <p>If you don't specify an Amazon Web Services Region, the default is the current Region.</p>
162    pub fn get_region(&self) -> &::std::option::Option<::std::string::String> {
163        &self.region
164    }
165    /// <p>Specifies the table version for the output data schema. If you don't specify this version ID, or if you set it to <code>LATEST</code>, Firehose uses the most recent version. This means that any updates to the table are automatically picked up.</p>
166    pub fn version_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.version_id = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// <p>Specifies the table version for the output data schema. If you don't specify this version ID, or if you set it to <code>LATEST</code>, Firehose uses the most recent version. This means that any updates to the table are automatically picked up.</p>
171    pub fn set_version_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.version_id = input;
173        self
174    }
175    /// <p>Specifies the table version for the output data schema. If you don't specify this version ID, or if you set it to <code>LATEST</code>, Firehose uses the most recent version. This means that any updates to the table are automatically picked up.</p>
176    pub fn get_version_id(&self) -> &::std::option::Option<::std::string::String> {
177        &self.version_id
178    }
179    /// Consumes the builder and constructs a [`SchemaConfiguration`](crate::types::SchemaConfiguration).
180    pub fn build(self) -> crate::types::SchemaConfiguration {
181        crate::types::SchemaConfiguration {
182            role_arn: self.role_arn,
183            catalog_id: self.catalog_id,
184            database_name: self.database_name,
185            table_name: self.table_name,
186            region: self.region,
187            version_id: self.version_id,
188        }
189    }
190}