aws_sdk_datazone/operation/create_glossary_term/
_create_glossary_term_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateGlossaryTermOutput {
6 pub id: ::std::string::String,
8 pub domain_id: ::std::string::String,
10 pub glossary_id: ::std::string::String,
12 pub name: ::std::string::String,
14 pub status: crate::types::GlossaryTermStatus,
16 pub short_description: ::std::option::Option<::std::string::String>,
18 pub long_description: ::std::option::Option<::std::string::String>,
20 pub term_relations: ::std::option::Option<crate::types::TermRelations>,
22 pub usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
24 _request_id: Option<String>,
25}
26impl CreateGlossaryTermOutput {
27 pub fn id(&self) -> &str {
29 use std::ops::Deref;
30 self.id.deref()
31 }
32 pub fn domain_id(&self) -> &str {
34 use std::ops::Deref;
35 self.domain_id.deref()
36 }
37 pub fn glossary_id(&self) -> &str {
39 use std::ops::Deref;
40 self.glossary_id.deref()
41 }
42 pub fn name(&self) -> &str {
44 use std::ops::Deref;
45 self.name.deref()
46 }
47 pub fn status(&self) -> &crate::types::GlossaryTermStatus {
49 &self.status
50 }
51 pub fn short_description(&self) -> ::std::option::Option<&str> {
53 self.short_description.as_deref()
54 }
55 pub fn long_description(&self) -> ::std::option::Option<&str> {
57 self.long_description.as_deref()
58 }
59 pub fn term_relations(&self) -> ::std::option::Option<&crate::types::TermRelations> {
61 self.term_relations.as_ref()
62 }
63 pub fn usage_restrictions(&self) -> &[crate::types::GlossaryUsageRestriction] {
67 self.usage_restrictions.as_deref().unwrap_or_default()
68 }
69}
70impl ::std::fmt::Debug for CreateGlossaryTermOutput {
71 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
72 let mut formatter = f.debug_struct("CreateGlossaryTermOutput");
73 formatter.field("id", &self.id);
74 formatter.field("domain_id", &self.domain_id);
75 formatter.field("glossary_id", &self.glossary_id);
76 formatter.field("name", &"*** Sensitive Data Redacted ***");
77 formatter.field("status", &self.status);
78 formatter.field("short_description", &"*** Sensitive Data Redacted ***");
79 formatter.field("long_description", &"*** Sensitive Data Redacted ***");
80 formatter.field("term_relations", &self.term_relations);
81 formatter.field("usage_restrictions", &self.usage_restrictions);
82 formatter.field("_request_id", &self._request_id);
83 formatter.finish()
84 }
85}
86impl ::aws_types::request_id::RequestId for CreateGlossaryTermOutput {
87 fn request_id(&self) -> Option<&str> {
88 self._request_id.as_deref()
89 }
90}
91impl CreateGlossaryTermOutput {
92 pub fn builder() -> crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder {
94 crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder::default()
95 }
96}
97
98#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
100#[non_exhaustive]
101pub struct CreateGlossaryTermOutputBuilder {
102 pub(crate) id: ::std::option::Option<::std::string::String>,
103 pub(crate) domain_id: ::std::option::Option<::std::string::String>,
104 pub(crate) glossary_id: ::std::option::Option<::std::string::String>,
105 pub(crate) name: ::std::option::Option<::std::string::String>,
106 pub(crate) status: ::std::option::Option<crate::types::GlossaryTermStatus>,
107 pub(crate) short_description: ::std::option::Option<::std::string::String>,
108 pub(crate) long_description: ::std::option::Option<::std::string::String>,
109 pub(crate) term_relations: ::std::option::Option<crate::types::TermRelations>,
110 pub(crate) usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
111 _request_id: Option<String>,
112}
113impl CreateGlossaryTermOutputBuilder {
114 pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
117 self.id = ::std::option::Option::Some(input.into());
118 self
119 }
120 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122 self.id = input;
123 self
124 }
125 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
127 &self.id
128 }
129 pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132 self.domain_id = ::std::option::Option::Some(input.into());
133 self
134 }
135 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137 self.domain_id = input;
138 self
139 }
140 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
142 &self.domain_id
143 }
144 pub fn glossary_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147 self.glossary_id = ::std::option::Option::Some(input.into());
148 self
149 }
150 pub fn set_glossary_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152 self.glossary_id = input;
153 self
154 }
155 pub fn get_glossary_id(&self) -> &::std::option::Option<::std::string::String> {
157 &self.glossary_id
158 }
159 pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162 self.name = ::std::option::Option::Some(input.into());
163 self
164 }
165 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167 self.name = input;
168 self
169 }
170 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
172 &self.name
173 }
174 pub fn status(mut self, input: crate::types::GlossaryTermStatus) -> Self {
177 self.status = ::std::option::Option::Some(input);
178 self
179 }
180 pub fn set_status(mut self, input: ::std::option::Option<crate::types::GlossaryTermStatus>) -> Self {
182 self.status = input;
183 self
184 }
185 pub fn get_status(&self) -> &::std::option::Option<crate::types::GlossaryTermStatus> {
187 &self.status
188 }
189 pub fn short_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
191 self.short_description = ::std::option::Option::Some(input.into());
192 self
193 }
194 pub fn set_short_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196 self.short_description = input;
197 self
198 }
199 pub fn get_short_description(&self) -> &::std::option::Option<::std::string::String> {
201 &self.short_description
202 }
203 pub fn long_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
205 self.long_description = ::std::option::Option::Some(input.into());
206 self
207 }
208 pub fn set_long_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210 self.long_description = input;
211 self
212 }
213 pub fn get_long_description(&self) -> &::std::option::Option<::std::string::String> {
215 &self.long_description
216 }
217 pub fn term_relations(mut self, input: crate::types::TermRelations) -> Self {
219 self.term_relations = ::std::option::Option::Some(input);
220 self
221 }
222 pub fn set_term_relations(mut self, input: ::std::option::Option<crate::types::TermRelations>) -> Self {
224 self.term_relations = input;
225 self
226 }
227 pub fn get_term_relations(&self) -> &::std::option::Option<crate::types::TermRelations> {
229 &self.term_relations
230 }
231 pub fn usage_restrictions(mut self, input: crate::types::GlossaryUsageRestriction) -> Self {
237 let mut v = self.usage_restrictions.unwrap_or_default();
238 v.push(input);
239 self.usage_restrictions = ::std::option::Option::Some(v);
240 self
241 }
242 pub fn set_usage_restrictions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>) -> Self {
244 self.usage_restrictions = input;
245 self
246 }
247 pub fn get_usage_restrictions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>> {
249 &self.usage_restrictions
250 }
251 pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
252 self._request_id = Some(request_id.into());
253 self
254 }
255
256 pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
257 self._request_id = request_id;
258 self
259 }
260 pub fn build(
268 self,
269 ) -> ::std::result::Result<crate::operation::create_glossary_term::CreateGlossaryTermOutput, ::aws_smithy_types::error::operation::BuildError>
270 {
271 ::std::result::Result::Ok(crate::operation::create_glossary_term::CreateGlossaryTermOutput {
272 id: self.id.ok_or_else(|| {
273 ::aws_smithy_types::error::operation::BuildError::missing_field(
274 "id",
275 "id was not specified but it is required when building CreateGlossaryTermOutput",
276 )
277 })?,
278 domain_id: self.domain_id.ok_or_else(|| {
279 ::aws_smithy_types::error::operation::BuildError::missing_field(
280 "domain_id",
281 "domain_id was not specified but it is required when building CreateGlossaryTermOutput",
282 )
283 })?,
284 glossary_id: self.glossary_id.ok_or_else(|| {
285 ::aws_smithy_types::error::operation::BuildError::missing_field(
286 "glossary_id",
287 "glossary_id was not specified but it is required when building CreateGlossaryTermOutput",
288 )
289 })?,
290 name: self.name.ok_or_else(|| {
291 ::aws_smithy_types::error::operation::BuildError::missing_field(
292 "name",
293 "name was not specified but it is required when building CreateGlossaryTermOutput",
294 )
295 })?,
296 status: self.status.ok_or_else(|| {
297 ::aws_smithy_types::error::operation::BuildError::missing_field(
298 "status",
299 "status was not specified but it is required when building CreateGlossaryTermOutput",
300 )
301 })?,
302 short_description: self.short_description,
303 long_description: self.long_description,
304 term_relations: self.term_relations,
305 usage_restrictions: self.usage_restrictions,
306 _request_id: self._request_id,
307 })
308 }
309}
310impl ::std::fmt::Debug for CreateGlossaryTermOutputBuilder {
311 fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
312 let mut formatter = f.debug_struct("CreateGlossaryTermOutputBuilder");
313 formatter.field("id", &self.id);
314 formatter.field("domain_id", &self.domain_id);
315 formatter.field("glossary_id", &self.glossary_id);
316 formatter.field("name", &"*** Sensitive Data Redacted ***");
317 formatter.field("status", &self.status);
318 formatter.field("short_description", &"*** Sensitive Data Redacted ***");
319 formatter.field("long_description", &"*** Sensitive Data Redacted ***");
320 formatter.field("term_relations", &self.term_relations);
321 formatter.field("usage_restrictions", &self.usage_restrictions);
322 formatter.field("_request_id", &self._request_id);
323 formatter.finish()
324 }
325}