aws_sdk_datazone/operation/create_glossary_term/
_create_glossary_term_output.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)]
5pub struct CreateGlossaryTermOutput {
6    /// <p>The ID of this business glossary term.</p>
7    pub id: ::std::string::String,
8    /// <p>The ID of the Amazon DataZone domain in which this business glossary term is created.</p>
9    pub domain_id: ::std::string::String,
10    /// <p>The ID of the business glossary in which this term is created.</p>
11    pub glossary_id: ::std::string::String,
12    /// <p>The name of this business glossary term.</p>
13    pub name: ::std::string::String,
14    /// <p>The status of this business glossary term.</p>
15    pub status: crate::types::GlossaryTermStatus,
16    /// <p>The short description of this business glossary term.</p>
17    pub short_description: ::std::option::Option<::std::string::String>,
18    /// <p>The long description of this business glossary term.</p>
19    pub long_description: ::std::option::Option<::std::string::String>,
20    /// <p>The term relations of this business glossary term.</p>
21    pub term_relations: ::std::option::Option<crate::types::TermRelations>,
22    /// <p>The usage restriction of the restricted glossary.</p>
23    pub usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
24    _request_id: Option<String>,
25}
26impl CreateGlossaryTermOutput {
27    /// <p>The ID of this business glossary term.</p>
28    pub fn id(&self) -> &str {
29        use std::ops::Deref;
30        self.id.deref()
31    }
32    /// <p>The ID of the Amazon DataZone domain in which this business glossary term is created.</p>
33    pub fn domain_id(&self) -> &str {
34        use std::ops::Deref;
35        self.domain_id.deref()
36    }
37    /// <p>The ID of the business glossary in which this term is created.</p>
38    pub fn glossary_id(&self) -> &str {
39        use std::ops::Deref;
40        self.glossary_id.deref()
41    }
42    /// <p>The name of this business glossary term.</p>
43    pub fn name(&self) -> &str {
44        use std::ops::Deref;
45        self.name.deref()
46    }
47    /// <p>The status of this business glossary term.</p>
48    pub fn status(&self) -> &crate::types::GlossaryTermStatus {
49        &self.status
50    }
51    /// <p>The short description of this business glossary term.</p>
52    pub fn short_description(&self) -> ::std::option::Option<&str> {
53        self.short_description.as_deref()
54    }
55    /// <p>The long description of this business glossary term.</p>
56    pub fn long_description(&self) -> ::std::option::Option<&str> {
57        self.long_description.as_deref()
58    }
59    /// <p>The term relations of this business glossary term.</p>
60    pub fn term_relations(&self) -> ::std::option::Option<&crate::types::TermRelations> {
61        self.term_relations.as_ref()
62    }
63    /// <p>The usage restriction of the restricted glossary.</p>
64    ///
65    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.usage_restrictions.is_none()`.
66    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    /// Creates a new builder-style object to manufacture [`CreateGlossaryTermOutput`](crate::operation::create_glossary_term::CreateGlossaryTermOutput).
93    pub fn builder() -> crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder {
94        crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder::default()
95    }
96}
97
98/// A builder for [`CreateGlossaryTermOutput`](crate::operation::create_glossary_term::CreateGlossaryTermOutput).
99#[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    /// <p>The ID of this business glossary term.</p>
115    /// This field is required.
116    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    /// <p>The ID of this business glossary term.</p>
121    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
122        self.id = input;
123        self
124    }
125    /// <p>The ID of this business glossary term.</p>
126    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
127        &self.id
128    }
129    /// <p>The ID of the Amazon DataZone domain in which this business glossary term is created.</p>
130    /// This field is required.
131    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    /// <p>The ID of the Amazon DataZone domain in which this business glossary term is created.</p>
136    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.domain_id = input;
138        self
139    }
140    /// <p>The ID of the Amazon DataZone domain in which this business glossary term is created.</p>
141    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
142        &self.domain_id
143    }
144    /// <p>The ID of the business glossary in which this term is created.</p>
145    /// This field is required.
146    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    /// <p>The ID of the business glossary in which this term is created.</p>
151    pub fn set_glossary_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.glossary_id = input;
153        self
154    }
155    /// <p>The ID of the business glossary in which this term is created.</p>
156    pub fn get_glossary_id(&self) -> &::std::option::Option<::std::string::String> {
157        &self.glossary_id
158    }
159    /// <p>The name of this business glossary term.</p>
160    /// This field is required.
161    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    /// <p>The name of this business glossary term.</p>
166    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.name = input;
168        self
169    }
170    /// <p>The name of this business glossary term.</p>
171    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
172        &self.name
173    }
174    /// <p>The status of this business glossary term.</p>
175    /// This field is required.
176    pub fn status(mut self, input: crate::types::GlossaryTermStatus) -> Self {
177        self.status = ::std::option::Option::Some(input);
178        self
179    }
180    /// <p>The status of this business glossary term.</p>
181    pub fn set_status(mut self, input: ::std::option::Option<crate::types::GlossaryTermStatus>) -> Self {
182        self.status = input;
183        self
184    }
185    /// <p>The status of this business glossary term.</p>
186    pub fn get_status(&self) -> &::std::option::Option<crate::types::GlossaryTermStatus> {
187        &self.status
188    }
189    /// <p>The short description of this business glossary term.</p>
190    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    /// <p>The short description of this business glossary term.</p>
195    pub fn set_short_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
196        self.short_description = input;
197        self
198    }
199    /// <p>The short description of this business glossary term.</p>
200    pub fn get_short_description(&self) -> &::std::option::Option<::std::string::String> {
201        &self.short_description
202    }
203    /// <p>The long description of this business glossary term.</p>
204    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    /// <p>The long description of this business glossary term.</p>
209    pub fn set_long_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
210        self.long_description = input;
211        self
212    }
213    /// <p>The long description of this business glossary term.</p>
214    pub fn get_long_description(&self) -> &::std::option::Option<::std::string::String> {
215        &self.long_description
216    }
217    /// <p>The term relations of this business glossary term.</p>
218    pub fn term_relations(mut self, input: crate::types::TermRelations) -> Self {
219        self.term_relations = ::std::option::Option::Some(input);
220        self
221    }
222    /// <p>The term relations of this business glossary term.</p>
223    pub fn set_term_relations(mut self, input: ::std::option::Option<crate::types::TermRelations>) -> Self {
224        self.term_relations = input;
225        self
226    }
227    /// <p>The term relations of this business glossary term.</p>
228    pub fn get_term_relations(&self) -> &::std::option::Option<crate::types::TermRelations> {
229        &self.term_relations
230    }
231    /// Appends an item to `usage_restrictions`.
232    ///
233    /// To override the contents of this collection use [`set_usage_restrictions`](Self::set_usage_restrictions).
234    ///
235    /// <p>The usage restriction of the restricted glossary.</p>
236    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    /// <p>The usage restriction of the restricted glossary.</p>
243    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    /// <p>The usage restriction of the restricted glossary.</p>
248    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    /// Consumes the builder and constructs a [`CreateGlossaryTermOutput`](crate::operation::create_glossary_term::CreateGlossaryTermOutput).
261    /// This method will fail if any of the following fields are not set:
262    /// - [`id`](crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder::id)
263    /// - [`domain_id`](crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder::domain_id)
264    /// - [`glossary_id`](crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder::glossary_id)
265    /// - [`name`](crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder::name)
266    /// - [`status`](crate::operation::create_glossary_term::builders::CreateGlossaryTermOutputBuilder::status)
267    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}