aws_sdk_glue/operation/create_schema/
_create_schema_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 CreateSchemaInput {
6    /// <p>This is a wrapper shape to contain the registry identity fields. If this is not provided, the default registry will be used. The ARN format for the same will be: <code>arn:aws:glue:us-east-2:<customer id>
7    /// :registry/default-registry:random-5-letter-id
8    /// </customer></code>.</p>
9    pub registry_id: ::std::option::Option<crate::types::RegistryId>,
10    /// <p>Name of the schema to be created of max length of 255, and may only contain letters, numbers, hyphen, underscore, dollar sign, or hash mark. No whitespace.</p>
11    pub schema_name: ::std::option::Option<::std::string::String>,
12    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
13    pub data_format: ::std::option::Option<crate::types::DataFormat>,
14    /// <p>The compatibility mode of the schema. The possible values are:</p>
15    /// <ul>
16    /// <li>
17    /// <p><i>NONE</i>: No compatibility mode applies. You can use this choice in development scenarios or if you do not know the compatibility mode that you want to apply to schemas. Any new version added will be accepted without undergoing a compatibility check.</p></li>
18    /// <li>
19    /// <p><i>DISABLED</i>: This compatibility choice prevents versioning for a particular schema. You can use this choice to prevent future versioning of a schema.</p></li>
20    /// <li>
21    /// <p><i>BACKWARD</i>: This compatibility choice is recommended as it allows data receivers to read both the current and one previous schema version. This means that for instance, a new schema version cannot drop data fields or change the type of these fields, so they can't be read by readers using the previous version.</p></li>
22    /// <li>
23    /// <p><i>BACKWARD_ALL</i>: This compatibility choice allows data receivers to read both the current and all previous schema versions. You can use this choice when you need to delete fields or add optional fields, and check compatibility against all previous schema versions.</p></li>
24    /// <li>
25    /// <p><i>FORWARD</i>: This compatibility choice allows data receivers to read both the current and one next schema version, but not necessarily later versions. You can use this choice when you need to add fields or delete optional fields, but only check compatibility against the last schema version.</p></li>
26    /// <li>
27    /// <p><i>FORWARD_ALL</i>: This compatibility choice allows data receivers to read written by producers of any new registered schema. You can use this choice when you need to add fields or delete optional fields, and check compatibility against all previous schema versions.</p></li>
28    /// <li>
29    /// <p><i>FULL</i>: This compatibility choice allows data receivers to read data written by producers using the previous or next version of the schema, but not necessarily earlier or later versions. You can use this choice when you need to add or remove optional fields, but only check compatibility against the last schema version.</p></li>
30    /// <li>
31    /// <p><i>FULL_ALL</i>: This compatibility choice allows data receivers to read data written by producers using all previous schema versions. You can use this choice when you need to add or remove optional fields, and check compatibility against all previous schema versions.</p></li>
32    /// </ul>
33    pub compatibility: ::std::option::Option<crate::types::Compatibility>,
34    /// <p>An optional description of the schema. If description is not provided, there will not be any automatic default value for this.</p>
35    pub description: ::std::option::Option<::std::string::String>,
36    /// <p>Amazon Web Services tags that contain a key value pair and may be searched by console, command line, or API. If specified, follows the Amazon Web Services tags-on-create pattern.</p>
37    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
38    /// <p>The schema definition using the <code>DataFormat</code> setting for <code>SchemaName</code>.</p>
39    pub schema_definition: ::std::option::Option<::std::string::String>,
40}
41impl CreateSchemaInput {
42    /// <p>This is a wrapper shape to contain the registry identity fields. If this is not provided, the default registry will be used. The ARN format for the same will be: <code>arn:aws:glue:us-east-2:<customer id>
43    /// :registry/default-registry:random-5-letter-id
44    /// </customer></code>.</p>
45    pub fn registry_id(&self) -> ::std::option::Option<&crate::types::RegistryId> {
46        self.registry_id.as_ref()
47    }
48    /// <p>Name of the schema to be created of max length of 255, and may only contain letters, numbers, hyphen, underscore, dollar sign, or hash mark. No whitespace.</p>
49    pub fn schema_name(&self) -> ::std::option::Option<&str> {
50        self.schema_name.as_deref()
51    }
52    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
53    pub fn data_format(&self) -> ::std::option::Option<&crate::types::DataFormat> {
54        self.data_format.as_ref()
55    }
56    /// <p>The compatibility mode of the schema. The possible values are:</p>
57    /// <ul>
58    /// <li>
59    /// <p><i>NONE</i>: No compatibility mode applies. You can use this choice in development scenarios or if you do not know the compatibility mode that you want to apply to schemas. Any new version added will be accepted without undergoing a compatibility check.</p></li>
60    /// <li>
61    /// <p><i>DISABLED</i>: This compatibility choice prevents versioning for a particular schema. You can use this choice to prevent future versioning of a schema.</p></li>
62    /// <li>
63    /// <p><i>BACKWARD</i>: This compatibility choice is recommended as it allows data receivers to read both the current and one previous schema version. This means that for instance, a new schema version cannot drop data fields or change the type of these fields, so they can't be read by readers using the previous version.</p></li>
64    /// <li>
65    /// <p><i>BACKWARD_ALL</i>: This compatibility choice allows data receivers to read both the current and all previous schema versions. You can use this choice when you need to delete fields or add optional fields, and check compatibility against all previous schema versions.</p></li>
66    /// <li>
67    /// <p><i>FORWARD</i>: This compatibility choice allows data receivers to read both the current and one next schema version, but not necessarily later versions. You can use this choice when you need to add fields or delete optional fields, but only check compatibility against the last schema version.</p></li>
68    /// <li>
69    /// <p><i>FORWARD_ALL</i>: This compatibility choice allows data receivers to read written by producers of any new registered schema. You can use this choice when you need to add fields or delete optional fields, and check compatibility against all previous schema versions.</p></li>
70    /// <li>
71    /// <p><i>FULL</i>: This compatibility choice allows data receivers to read data written by producers using the previous or next version of the schema, but not necessarily earlier or later versions. You can use this choice when you need to add or remove optional fields, but only check compatibility against the last schema version.</p></li>
72    /// <li>
73    /// <p><i>FULL_ALL</i>: This compatibility choice allows data receivers to read data written by producers using all previous schema versions. You can use this choice when you need to add or remove optional fields, and check compatibility against all previous schema versions.</p></li>
74    /// </ul>
75    pub fn compatibility(&self) -> ::std::option::Option<&crate::types::Compatibility> {
76        self.compatibility.as_ref()
77    }
78    /// <p>An optional description of the schema. If description is not provided, there will not be any automatic default value for this.</p>
79    pub fn description(&self) -> ::std::option::Option<&str> {
80        self.description.as_deref()
81    }
82    /// <p>Amazon Web Services tags that contain a key value pair and may be searched by console, command line, or API. If specified, follows the Amazon Web Services tags-on-create pattern.</p>
83    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
84        self.tags.as_ref()
85    }
86    /// <p>The schema definition using the <code>DataFormat</code> setting for <code>SchemaName</code>.</p>
87    pub fn schema_definition(&self) -> ::std::option::Option<&str> {
88        self.schema_definition.as_deref()
89    }
90}
91impl CreateSchemaInput {
92    /// Creates a new builder-style object to manufacture [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
93    pub fn builder() -> crate::operation::create_schema::builders::CreateSchemaInputBuilder {
94        crate::operation::create_schema::builders::CreateSchemaInputBuilder::default()
95    }
96}
97
98/// A builder for [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
99#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
100#[non_exhaustive]
101pub struct CreateSchemaInputBuilder {
102    pub(crate) registry_id: ::std::option::Option<crate::types::RegistryId>,
103    pub(crate) schema_name: ::std::option::Option<::std::string::String>,
104    pub(crate) data_format: ::std::option::Option<crate::types::DataFormat>,
105    pub(crate) compatibility: ::std::option::Option<crate::types::Compatibility>,
106    pub(crate) description: ::std::option::Option<::std::string::String>,
107    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
108    pub(crate) schema_definition: ::std::option::Option<::std::string::String>,
109}
110impl CreateSchemaInputBuilder {
111    /// <p>This is a wrapper shape to contain the registry identity fields. If this is not provided, the default registry will be used. The ARN format for the same will be: <code>arn:aws:glue:us-east-2:<customer id>
112    /// :registry/default-registry:random-5-letter-id
113    /// </customer></code>.</p>
114    pub fn registry_id(mut self, input: crate::types::RegistryId) -> Self {
115        self.registry_id = ::std::option::Option::Some(input);
116        self
117    }
118    /// <p>This is a wrapper shape to contain the registry identity fields. If this is not provided, the default registry will be used. The ARN format for the same will be: <code>arn:aws:glue:us-east-2:<customer id>
119    /// :registry/default-registry:random-5-letter-id
120    /// </customer></code>.</p>
121    pub fn set_registry_id(mut self, input: ::std::option::Option<crate::types::RegistryId>) -> Self {
122        self.registry_id = input;
123        self
124    }
125    /// <p>This is a wrapper shape to contain the registry identity fields. If this is not provided, the default registry will be used. The ARN format for the same will be: <code>arn:aws:glue:us-east-2:<customer id>
126    /// :registry/default-registry:random-5-letter-id
127    /// </customer></code>.</p>
128    pub fn get_registry_id(&self) -> &::std::option::Option<crate::types::RegistryId> {
129        &self.registry_id
130    }
131    /// <p>Name of the schema to be created of max length of 255, and may only contain letters, numbers, hyphen, underscore, dollar sign, or hash mark. No whitespace.</p>
132    /// This field is required.
133    pub fn schema_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
134        self.schema_name = ::std::option::Option::Some(input.into());
135        self
136    }
137    /// <p>Name of the schema to be created of max length of 255, and may only contain letters, numbers, hyphen, underscore, dollar sign, or hash mark. No whitespace.</p>
138    pub fn set_schema_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.schema_name = input;
140        self
141    }
142    /// <p>Name of the schema to be created of max length of 255, and may only contain letters, numbers, hyphen, underscore, dollar sign, or hash mark. No whitespace.</p>
143    pub fn get_schema_name(&self) -> &::std::option::Option<::std::string::String> {
144        &self.schema_name
145    }
146    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
147    /// This field is required.
148    pub fn data_format(mut self, input: crate::types::DataFormat) -> Self {
149        self.data_format = ::std::option::Option::Some(input);
150        self
151    }
152    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
153    pub fn set_data_format(mut self, input: ::std::option::Option<crate::types::DataFormat>) -> Self {
154        self.data_format = input;
155        self
156    }
157    /// <p>The data format of the schema definition. Currently <code>AVRO</code>, <code>JSON</code> and <code>PROTOBUF</code> are supported.</p>
158    pub fn get_data_format(&self) -> &::std::option::Option<crate::types::DataFormat> {
159        &self.data_format
160    }
161    /// <p>The compatibility mode of the schema. The possible values are:</p>
162    /// <ul>
163    /// <li>
164    /// <p><i>NONE</i>: No compatibility mode applies. You can use this choice in development scenarios or if you do not know the compatibility mode that you want to apply to schemas. Any new version added will be accepted without undergoing a compatibility check.</p></li>
165    /// <li>
166    /// <p><i>DISABLED</i>: This compatibility choice prevents versioning for a particular schema. You can use this choice to prevent future versioning of a schema.</p></li>
167    /// <li>
168    /// <p><i>BACKWARD</i>: This compatibility choice is recommended as it allows data receivers to read both the current and one previous schema version. This means that for instance, a new schema version cannot drop data fields or change the type of these fields, so they can't be read by readers using the previous version.</p></li>
169    /// <li>
170    /// <p><i>BACKWARD_ALL</i>: This compatibility choice allows data receivers to read both the current and all previous schema versions. You can use this choice when you need to delete fields or add optional fields, and check compatibility against all previous schema versions.</p></li>
171    /// <li>
172    /// <p><i>FORWARD</i>: This compatibility choice allows data receivers to read both the current and one next schema version, but not necessarily later versions. You can use this choice when you need to add fields or delete optional fields, but only check compatibility against the last schema version.</p></li>
173    /// <li>
174    /// <p><i>FORWARD_ALL</i>: This compatibility choice allows data receivers to read written by producers of any new registered schema. You can use this choice when you need to add fields or delete optional fields, and check compatibility against all previous schema versions.</p></li>
175    /// <li>
176    /// <p><i>FULL</i>: This compatibility choice allows data receivers to read data written by producers using the previous or next version of the schema, but not necessarily earlier or later versions. You can use this choice when you need to add or remove optional fields, but only check compatibility against the last schema version.</p></li>
177    /// <li>
178    /// <p><i>FULL_ALL</i>: This compatibility choice allows data receivers to read data written by producers using all previous schema versions. You can use this choice when you need to add or remove optional fields, and check compatibility against all previous schema versions.</p></li>
179    /// </ul>
180    pub fn compatibility(mut self, input: crate::types::Compatibility) -> Self {
181        self.compatibility = ::std::option::Option::Some(input);
182        self
183    }
184    /// <p>The compatibility mode of the schema. The possible values are:</p>
185    /// <ul>
186    /// <li>
187    /// <p><i>NONE</i>: No compatibility mode applies. You can use this choice in development scenarios or if you do not know the compatibility mode that you want to apply to schemas. Any new version added will be accepted without undergoing a compatibility check.</p></li>
188    /// <li>
189    /// <p><i>DISABLED</i>: This compatibility choice prevents versioning for a particular schema. You can use this choice to prevent future versioning of a schema.</p></li>
190    /// <li>
191    /// <p><i>BACKWARD</i>: This compatibility choice is recommended as it allows data receivers to read both the current and one previous schema version. This means that for instance, a new schema version cannot drop data fields or change the type of these fields, so they can't be read by readers using the previous version.</p></li>
192    /// <li>
193    /// <p><i>BACKWARD_ALL</i>: This compatibility choice allows data receivers to read both the current and all previous schema versions. You can use this choice when you need to delete fields or add optional fields, and check compatibility against all previous schema versions.</p></li>
194    /// <li>
195    /// <p><i>FORWARD</i>: This compatibility choice allows data receivers to read both the current and one next schema version, but not necessarily later versions. You can use this choice when you need to add fields or delete optional fields, but only check compatibility against the last schema version.</p></li>
196    /// <li>
197    /// <p><i>FORWARD_ALL</i>: This compatibility choice allows data receivers to read written by producers of any new registered schema. You can use this choice when you need to add fields or delete optional fields, and check compatibility against all previous schema versions.</p></li>
198    /// <li>
199    /// <p><i>FULL</i>: This compatibility choice allows data receivers to read data written by producers using the previous or next version of the schema, but not necessarily earlier or later versions. You can use this choice when you need to add or remove optional fields, but only check compatibility against the last schema version.</p></li>
200    /// <li>
201    /// <p><i>FULL_ALL</i>: This compatibility choice allows data receivers to read data written by producers using all previous schema versions. You can use this choice when you need to add or remove optional fields, and check compatibility against all previous schema versions.</p></li>
202    /// </ul>
203    pub fn set_compatibility(mut self, input: ::std::option::Option<crate::types::Compatibility>) -> Self {
204        self.compatibility = input;
205        self
206    }
207    /// <p>The compatibility mode of the schema. The possible values are:</p>
208    /// <ul>
209    /// <li>
210    /// <p><i>NONE</i>: No compatibility mode applies. You can use this choice in development scenarios or if you do not know the compatibility mode that you want to apply to schemas. Any new version added will be accepted without undergoing a compatibility check.</p></li>
211    /// <li>
212    /// <p><i>DISABLED</i>: This compatibility choice prevents versioning for a particular schema. You can use this choice to prevent future versioning of a schema.</p></li>
213    /// <li>
214    /// <p><i>BACKWARD</i>: This compatibility choice is recommended as it allows data receivers to read both the current and one previous schema version. This means that for instance, a new schema version cannot drop data fields or change the type of these fields, so they can't be read by readers using the previous version.</p></li>
215    /// <li>
216    /// <p><i>BACKWARD_ALL</i>: This compatibility choice allows data receivers to read both the current and all previous schema versions. You can use this choice when you need to delete fields or add optional fields, and check compatibility against all previous schema versions.</p></li>
217    /// <li>
218    /// <p><i>FORWARD</i>: This compatibility choice allows data receivers to read both the current and one next schema version, but not necessarily later versions. You can use this choice when you need to add fields or delete optional fields, but only check compatibility against the last schema version.</p></li>
219    /// <li>
220    /// <p><i>FORWARD_ALL</i>: This compatibility choice allows data receivers to read written by producers of any new registered schema. You can use this choice when you need to add fields or delete optional fields, and check compatibility against all previous schema versions.</p></li>
221    /// <li>
222    /// <p><i>FULL</i>: This compatibility choice allows data receivers to read data written by producers using the previous or next version of the schema, but not necessarily earlier or later versions. You can use this choice when you need to add or remove optional fields, but only check compatibility against the last schema version.</p></li>
223    /// <li>
224    /// <p><i>FULL_ALL</i>: This compatibility choice allows data receivers to read data written by producers using all previous schema versions. You can use this choice when you need to add or remove optional fields, and check compatibility against all previous schema versions.</p></li>
225    /// </ul>
226    pub fn get_compatibility(&self) -> &::std::option::Option<crate::types::Compatibility> {
227        &self.compatibility
228    }
229    /// <p>An optional description of the schema. If description is not provided, there will not be any automatic default value for this.</p>
230    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
231        self.description = ::std::option::Option::Some(input.into());
232        self
233    }
234    /// <p>An optional description of the schema. If description is not provided, there will not be any automatic default value for this.</p>
235    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
236        self.description = input;
237        self
238    }
239    /// <p>An optional description of the schema. If description is not provided, there will not be any automatic default value for this.</p>
240    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
241        &self.description
242    }
243    /// Adds a key-value pair to `tags`.
244    ///
245    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
246    ///
247    /// <p>Amazon Web Services tags that contain a key value pair and may be searched by console, command line, or API. If specified, follows the Amazon Web Services tags-on-create pattern.</p>
248    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
249        let mut hash_map = self.tags.unwrap_or_default();
250        hash_map.insert(k.into(), v.into());
251        self.tags = ::std::option::Option::Some(hash_map);
252        self
253    }
254    /// <p>Amazon Web Services tags that contain a key value pair and may be searched by console, command line, or API. If specified, follows the Amazon Web Services tags-on-create pattern.</p>
255    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
256        self.tags = input;
257        self
258    }
259    /// <p>Amazon Web Services tags that contain a key value pair and may be searched by console, command line, or API. If specified, follows the Amazon Web Services tags-on-create pattern.</p>
260    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
261        &self.tags
262    }
263    /// <p>The schema definition using the <code>DataFormat</code> setting for <code>SchemaName</code>.</p>
264    pub fn schema_definition(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
265        self.schema_definition = ::std::option::Option::Some(input.into());
266        self
267    }
268    /// <p>The schema definition using the <code>DataFormat</code> setting for <code>SchemaName</code>.</p>
269    pub fn set_schema_definition(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
270        self.schema_definition = input;
271        self
272    }
273    /// <p>The schema definition using the <code>DataFormat</code> setting for <code>SchemaName</code>.</p>
274    pub fn get_schema_definition(&self) -> &::std::option::Option<::std::string::String> {
275        &self.schema_definition
276    }
277    /// Consumes the builder and constructs a [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
278    pub fn build(
279        self,
280    ) -> ::std::result::Result<crate::operation::create_schema::CreateSchemaInput, ::aws_smithy_types::error::operation::BuildError> {
281        ::std::result::Result::Ok(crate::operation::create_schema::CreateSchemaInput {
282            registry_id: self.registry_id,
283            schema_name: self.schema_name,
284            data_format: self.data_format,
285            compatibility: self.compatibility,
286            description: self.description,
287            tags: self.tags,
288            schema_definition: self.schema_definition,
289        })
290    }
291}