aws_sdk_schemas/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>The source of the schema definition.</p>
7    pub content: ::std::option::Option<::std::string::String>,
8    /// <p>A description of the schema.</p>
9    pub description: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the registry.</p>
11    pub registry_name: ::std::option::Option<::std::string::String>,
12    /// <p>The name of the schema.</p>
13    pub schema_name: ::std::option::Option<::std::string::String>,
14    /// <p>Tags associated with the schema.</p>
15    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16    /// <p>The type of schema.</p>
17    pub r#type: ::std::option::Option<crate::types::Type>,
18}
19impl CreateSchemaInput {
20    /// <p>The source of the schema definition.</p>
21    pub fn content(&self) -> ::std::option::Option<&str> {
22        self.content.as_deref()
23    }
24    /// <p>A description of the schema.</p>
25    pub fn description(&self) -> ::std::option::Option<&str> {
26        self.description.as_deref()
27    }
28    /// <p>The name of the registry.</p>
29    pub fn registry_name(&self) -> ::std::option::Option<&str> {
30        self.registry_name.as_deref()
31    }
32    /// <p>The name of the schema.</p>
33    pub fn schema_name(&self) -> ::std::option::Option<&str> {
34        self.schema_name.as_deref()
35    }
36    /// <p>Tags associated with the schema.</p>
37    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38        self.tags.as_ref()
39    }
40    /// <p>The type of schema.</p>
41    pub fn r#type(&self) -> ::std::option::Option<&crate::types::Type> {
42        self.r#type.as_ref()
43    }
44}
45impl CreateSchemaInput {
46    /// Creates a new builder-style object to manufacture [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
47    pub fn builder() -> crate::operation::create_schema::builders::CreateSchemaInputBuilder {
48        crate::operation::create_schema::builders::CreateSchemaInputBuilder::default()
49    }
50}
51
52/// A builder for [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
53#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
54#[non_exhaustive]
55pub struct CreateSchemaInputBuilder {
56    pub(crate) content: ::std::option::Option<::std::string::String>,
57    pub(crate) description: ::std::option::Option<::std::string::String>,
58    pub(crate) registry_name: ::std::option::Option<::std::string::String>,
59    pub(crate) schema_name: ::std::option::Option<::std::string::String>,
60    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
61    pub(crate) r#type: ::std::option::Option<crate::types::Type>,
62}
63impl CreateSchemaInputBuilder {
64    /// <p>The source of the schema definition.</p>
65    /// This field is required.
66    pub fn content(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
67        self.content = ::std::option::Option::Some(input.into());
68        self
69    }
70    /// <p>The source of the schema definition.</p>
71    pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72        self.content = input;
73        self
74    }
75    /// <p>The source of the schema definition.</p>
76    pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
77        &self.content
78    }
79    /// <p>A description of the schema.</p>
80    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
81        self.description = ::std::option::Option::Some(input.into());
82        self
83    }
84    /// <p>A description of the schema.</p>
85    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86        self.description = input;
87        self
88    }
89    /// <p>A description of the schema.</p>
90    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
91        &self.description
92    }
93    /// <p>The name of the registry.</p>
94    /// This field is required.
95    pub fn registry_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.registry_name = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// <p>The name of the registry.</p>
100    pub fn set_registry_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.registry_name = input;
102        self
103    }
104    /// <p>The name of the registry.</p>
105    pub fn get_registry_name(&self) -> &::std::option::Option<::std::string::String> {
106        &self.registry_name
107    }
108    /// <p>The name of the schema.</p>
109    /// This field is required.
110    pub fn schema_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.schema_name = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// <p>The name of the schema.</p>
115    pub fn set_schema_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.schema_name = input;
117        self
118    }
119    /// <p>The name of the schema.</p>
120    pub fn get_schema_name(&self) -> &::std::option::Option<::std::string::String> {
121        &self.schema_name
122    }
123    /// Adds a key-value pair to `tags`.
124    ///
125    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
126    ///
127    /// <p>Tags associated with the schema.</p>
128    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
129        let mut hash_map = self.tags.unwrap_or_default();
130        hash_map.insert(k.into(), v.into());
131        self.tags = ::std::option::Option::Some(hash_map);
132        self
133    }
134    /// <p>Tags associated with the schema.</p>
135    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
136        self.tags = input;
137        self
138    }
139    /// <p>Tags associated with the schema.</p>
140    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
141        &self.tags
142    }
143    /// <p>The type of schema.</p>
144    /// This field is required.
145    pub fn r#type(mut self, input: crate::types::Type) -> Self {
146        self.r#type = ::std::option::Option::Some(input);
147        self
148    }
149    /// <p>The type of schema.</p>
150    pub fn set_type(mut self, input: ::std::option::Option<crate::types::Type>) -> Self {
151        self.r#type = input;
152        self
153    }
154    /// <p>The type of schema.</p>
155    pub fn get_type(&self) -> &::std::option::Option<crate::types::Type> {
156        &self.r#type
157    }
158    /// Consumes the builder and constructs a [`CreateSchemaInput`](crate::operation::create_schema::CreateSchemaInput).
159    pub fn build(
160        self,
161    ) -> ::std::result::Result<crate::operation::create_schema::CreateSchemaInput, ::aws_smithy_types::error::operation::BuildError> {
162        ::std::result::Result::Ok(crate::operation::create_schema::CreateSchemaInput {
163            content: self.content,
164            description: self.description,
165            registry_name: self.registry_name,
166            schema_name: self.schema_name,
167            tags: self.tags,
168            r#type: self.r#type,
169        })
170    }
171}