aws_sdk_schemas/operation/create_schema/
_create_schema_input.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CreateSchemaInput {
6 pub content: ::std::option::Option<::std::string::String>,
8 pub description: ::std::option::Option<::std::string::String>,
10 pub registry_name: ::std::option::Option<::std::string::String>,
12 pub schema_name: ::std::option::Option<::std::string::String>,
14 pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
16 pub r#type: ::std::option::Option<crate::types::Type>,
18}
19impl CreateSchemaInput {
20 pub fn content(&self) -> ::std::option::Option<&str> {
22 self.content.as_deref()
23 }
24 pub fn description(&self) -> ::std::option::Option<&str> {
26 self.description.as_deref()
27 }
28 pub fn registry_name(&self) -> ::std::option::Option<&str> {
30 self.registry_name.as_deref()
31 }
32 pub fn schema_name(&self) -> ::std::option::Option<&str> {
34 self.schema_name.as_deref()
35 }
36 pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
38 self.tags.as_ref()
39 }
40 pub fn r#type(&self) -> ::std::option::Option<&crate::types::Type> {
42 self.r#type.as_ref()
43 }
44}
45impl CreateSchemaInput {
46 pub fn builder() -> crate::operation::create_schema::builders::CreateSchemaInputBuilder {
48 crate::operation::create_schema::builders::CreateSchemaInputBuilder::default()
49 }
50}
51
52#[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 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 pub fn set_content(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
72 self.content = input;
73 self
74 }
75 pub fn get_content(&self) -> &::std::option::Option<::std::string::String> {
77 &self.content
78 }
79 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
86 self.description = input;
87 self
88 }
89 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
91 &self.description
92 }
93 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 pub fn set_registry_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101 self.registry_name = input;
102 self
103 }
104 pub fn get_registry_name(&self) -> &::std::option::Option<::std::string::String> {
106 &self.registry_name
107 }
108 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 pub fn set_schema_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116 self.schema_name = input;
117 self
118 }
119 pub fn get_schema_name(&self) -> &::std::option::Option<::std::string::String> {
121 &self.schema_name
122 }
123 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 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 pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
141 &self.tags
142 }
143 pub fn r#type(mut self, input: crate::types::Type) -> Self {
146 self.r#type = ::std::option::Option::Some(input);
147 self
148 }
149 pub fn set_type(mut self, input: ::std::option::Option<crate::types::Type>) -> Self {
151 self.r#type = input;
152 self
153 }
154 pub fn get_type(&self) -> &::std::option::Option<crate::types::Type> {
156 &self.r#type
157 }
158 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}