aws_sdk_datazone/operation/get_glossary/
_get_glossary_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 GetGlossaryOutput {
6    /// <p>The ID of the Amazon DataZone domain in which this business glossary exists.</p>
7    pub domain_id: ::std::string::String,
8    /// <p>The ID of the business glossary.</p>
9    pub id: ::std::string::String,
10    /// <p>The ID of the project that owns this business glossary.</p>
11    pub owning_project_id: ::std::string::String,
12    /// <p>The name of the business glossary.</p>
13    pub name: ::std::string::String,
14    /// <p>The description of the business glossary.</p>
15    pub description: ::std::option::Option<::std::string::String>,
16    /// <p>The status of the business glossary.</p>
17    pub status: crate::types::GlossaryStatus,
18    /// <p>The timestamp of when this business glossary was created.</p>
19    pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
20    /// <p>The Amazon DataZone user who created this business glossary.</p>
21    pub created_by: ::std::option::Option<::std::string::String>,
22    /// <p>The timestamp of when the business glossary was updated.</p>
23    pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
24    /// <p>The Amazon DataZone user who updated the business glossary.</p>
25    pub updated_by: ::std::option::Option<::std::string::String>,
26    /// <p>The usage restriction of the restricted glossary.</p>
27    pub usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
28    _request_id: Option<String>,
29}
30impl GetGlossaryOutput {
31    /// <p>The ID of the Amazon DataZone domain in which this business glossary exists.</p>
32    pub fn domain_id(&self) -> &str {
33        use std::ops::Deref;
34        self.domain_id.deref()
35    }
36    /// <p>The ID of the business glossary.</p>
37    pub fn id(&self) -> &str {
38        use std::ops::Deref;
39        self.id.deref()
40    }
41    /// <p>The ID of the project that owns this business glossary.</p>
42    pub fn owning_project_id(&self) -> &str {
43        use std::ops::Deref;
44        self.owning_project_id.deref()
45    }
46    /// <p>The name of the business glossary.</p>
47    pub fn name(&self) -> &str {
48        use std::ops::Deref;
49        self.name.deref()
50    }
51    /// <p>The description of the business glossary.</p>
52    pub fn description(&self) -> ::std::option::Option<&str> {
53        self.description.as_deref()
54    }
55    /// <p>The status of the business glossary.</p>
56    pub fn status(&self) -> &crate::types::GlossaryStatus {
57        &self.status
58    }
59    /// <p>The timestamp of when this business glossary was created.</p>
60    pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
61        self.created_at.as_ref()
62    }
63    /// <p>The Amazon DataZone user who created this business glossary.</p>
64    pub fn created_by(&self) -> ::std::option::Option<&str> {
65        self.created_by.as_deref()
66    }
67    /// <p>The timestamp of when the business glossary was updated.</p>
68    pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
69        self.updated_at.as_ref()
70    }
71    /// <p>The Amazon DataZone user who updated the business glossary.</p>
72    pub fn updated_by(&self) -> ::std::option::Option<&str> {
73        self.updated_by.as_deref()
74    }
75    /// <p>The usage restriction of the restricted glossary.</p>
76    ///
77    /// 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()`.
78    pub fn usage_restrictions(&self) -> &[crate::types::GlossaryUsageRestriction] {
79        self.usage_restrictions.as_deref().unwrap_or_default()
80    }
81}
82impl ::std::fmt::Debug for GetGlossaryOutput {
83    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
84        let mut formatter = f.debug_struct("GetGlossaryOutput");
85        formatter.field("domain_id", &self.domain_id);
86        formatter.field("id", &self.id);
87        formatter.field("owning_project_id", &self.owning_project_id);
88        formatter.field("name", &"*** Sensitive Data Redacted ***");
89        formatter.field("description", &"*** Sensitive Data Redacted ***");
90        formatter.field("status", &self.status);
91        formatter.field("created_at", &self.created_at);
92        formatter.field("created_by", &self.created_by);
93        formatter.field("updated_at", &self.updated_at);
94        formatter.field("updated_by", &self.updated_by);
95        formatter.field("usage_restrictions", &self.usage_restrictions);
96        formatter.field("_request_id", &self._request_id);
97        formatter.finish()
98    }
99}
100impl ::aws_types::request_id::RequestId for GetGlossaryOutput {
101    fn request_id(&self) -> Option<&str> {
102        self._request_id.as_deref()
103    }
104}
105impl GetGlossaryOutput {
106    /// Creates a new builder-style object to manufacture [`GetGlossaryOutput`](crate::operation::get_glossary::GetGlossaryOutput).
107    pub fn builder() -> crate::operation::get_glossary::builders::GetGlossaryOutputBuilder {
108        crate::operation::get_glossary::builders::GetGlossaryOutputBuilder::default()
109    }
110}
111
112/// A builder for [`GetGlossaryOutput`](crate::operation::get_glossary::GetGlossaryOutput).
113#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
114#[non_exhaustive]
115pub struct GetGlossaryOutputBuilder {
116    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
117    pub(crate) id: ::std::option::Option<::std::string::String>,
118    pub(crate) owning_project_id: ::std::option::Option<::std::string::String>,
119    pub(crate) name: ::std::option::Option<::std::string::String>,
120    pub(crate) description: ::std::option::Option<::std::string::String>,
121    pub(crate) status: ::std::option::Option<crate::types::GlossaryStatus>,
122    pub(crate) created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
123    pub(crate) created_by: ::std::option::Option<::std::string::String>,
124    pub(crate) updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
125    pub(crate) updated_by: ::std::option::Option<::std::string::String>,
126    pub(crate) usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
127    _request_id: Option<String>,
128}
129impl GetGlossaryOutputBuilder {
130    /// <p>The ID of the Amazon DataZone domain in which this business glossary exists.</p>
131    /// This field is required.
132    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.domain_id = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <p>The ID of the Amazon DataZone domain in which this business glossary exists.</p>
137    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.domain_id = input;
139        self
140    }
141    /// <p>The ID of the Amazon DataZone domain in which this business glossary exists.</p>
142    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
143        &self.domain_id
144    }
145    /// <p>The ID of the business glossary.</p>
146    /// This field is required.
147    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.id = ::std::option::Option::Some(input.into());
149        self
150    }
151    /// <p>The ID of the business glossary.</p>
152    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153        self.id = input;
154        self
155    }
156    /// <p>The ID of the business glossary.</p>
157    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
158        &self.id
159    }
160    /// <p>The ID of the project that owns this business glossary.</p>
161    /// This field is required.
162    pub fn owning_project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.owning_project_id = ::std::option::Option::Some(input.into());
164        self
165    }
166    /// <p>The ID of the project that owns this business glossary.</p>
167    pub fn set_owning_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.owning_project_id = input;
169        self
170    }
171    /// <p>The ID of the project that owns this business glossary.</p>
172    pub fn get_owning_project_id(&self) -> &::std::option::Option<::std::string::String> {
173        &self.owning_project_id
174    }
175    /// <p>The name of the business glossary.</p>
176    /// This field is required.
177    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.name = ::std::option::Option::Some(input.into());
179        self
180    }
181    /// <p>The name of the business glossary.</p>
182    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.name = input;
184        self
185    }
186    /// <p>The name of the business glossary.</p>
187    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
188        &self.name
189    }
190    /// <p>The description of the business glossary.</p>
191    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.description = ::std::option::Option::Some(input.into());
193        self
194    }
195    /// <p>The description of the business glossary.</p>
196    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.description = input;
198        self
199    }
200    /// <p>The description of the business glossary.</p>
201    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
202        &self.description
203    }
204    /// <p>The status of the business glossary.</p>
205    /// This field is required.
206    pub fn status(mut self, input: crate::types::GlossaryStatus) -> Self {
207        self.status = ::std::option::Option::Some(input);
208        self
209    }
210    /// <p>The status of the business glossary.</p>
211    pub fn set_status(mut self, input: ::std::option::Option<crate::types::GlossaryStatus>) -> Self {
212        self.status = input;
213        self
214    }
215    /// <p>The status of the business glossary.</p>
216    pub fn get_status(&self) -> &::std::option::Option<crate::types::GlossaryStatus> {
217        &self.status
218    }
219    /// <p>The timestamp of when this business glossary was created.</p>
220    pub fn created_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
221        self.created_at = ::std::option::Option::Some(input);
222        self
223    }
224    /// <p>The timestamp of when this business glossary was created.</p>
225    pub fn set_created_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
226        self.created_at = input;
227        self
228    }
229    /// <p>The timestamp of when this business glossary was created.</p>
230    pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
231        &self.created_at
232    }
233    /// <p>The Amazon DataZone user who created this business glossary.</p>
234    pub fn created_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
235        self.created_by = ::std::option::Option::Some(input.into());
236        self
237    }
238    /// <p>The Amazon DataZone user who created this business glossary.</p>
239    pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240        self.created_by = input;
241        self
242    }
243    /// <p>The Amazon DataZone user who created this business glossary.</p>
244    pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
245        &self.created_by
246    }
247    /// <p>The timestamp of when the business glossary was updated.</p>
248    pub fn updated_at(mut self, input: ::aws_smithy_types::DateTime) -> Self {
249        self.updated_at = ::std::option::Option::Some(input);
250        self
251    }
252    /// <p>The timestamp of when the business glossary was updated.</p>
253    pub fn set_updated_at(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
254        self.updated_at = input;
255        self
256    }
257    /// <p>The timestamp of when the business glossary was updated.</p>
258    pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
259        &self.updated_at
260    }
261    /// <p>The Amazon DataZone user who updated the business glossary.</p>
262    pub fn updated_by(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
263        self.updated_by = ::std::option::Option::Some(input.into());
264        self
265    }
266    /// <p>The Amazon DataZone user who updated the business glossary.</p>
267    pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268        self.updated_by = input;
269        self
270    }
271    /// <p>The Amazon DataZone user who updated the business glossary.</p>
272    pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
273        &self.updated_by
274    }
275    /// Appends an item to `usage_restrictions`.
276    ///
277    /// To override the contents of this collection use [`set_usage_restrictions`](Self::set_usage_restrictions).
278    ///
279    /// <p>The usage restriction of the restricted glossary.</p>
280    pub fn usage_restrictions(mut self, input: crate::types::GlossaryUsageRestriction) -> Self {
281        let mut v = self.usage_restrictions.unwrap_or_default();
282        v.push(input);
283        self.usage_restrictions = ::std::option::Option::Some(v);
284        self
285    }
286    /// <p>The usage restriction of the restricted glossary.</p>
287    pub fn set_usage_restrictions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>) -> Self {
288        self.usage_restrictions = input;
289        self
290    }
291    /// <p>The usage restriction of the restricted glossary.</p>
292    pub fn get_usage_restrictions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>> {
293        &self.usage_restrictions
294    }
295    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
296        self._request_id = Some(request_id.into());
297        self
298    }
299
300    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
301        self._request_id = request_id;
302        self
303    }
304    /// Consumes the builder and constructs a [`GetGlossaryOutput`](crate::operation::get_glossary::GetGlossaryOutput).
305    /// This method will fail if any of the following fields are not set:
306    /// - [`domain_id`](crate::operation::get_glossary::builders::GetGlossaryOutputBuilder::domain_id)
307    /// - [`id`](crate::operation::get_glossary::builders::GetGlossaryOutputBuilder::id)
308    /// - [`owning_project_id`](crate::operation::get_glossary::builders::GetGlossaryOutputBuilder::owning_project_id)
309    /// - [`name`](crate::operation::get_glossary::builders::GetGlossaryOutputBuilder::name)
310    /// - [`status`](crate::operation::get_glossary::builders::GetGlossaryOutputBuilder::status)
311    pub fn build(self) -> ::std::result::Result<crate::operation::get_glossary::GetGlossaryOutput, ::aws_smithy_types::error::operation::BuildError> {
312        ::std::result::Result::Ok(crate::operation::get_glossary::GetGlossaryOutput {
313            domain_id: self.domain_id.ok_or_else(|| {
314                ::aws_smithy_types::error::operation::BuildError::missing_field(
315                    "domain_id",
316                    "domain_id was not specified but it is required when building GetGlossaryOutput",
317                )
318            })?,
319            id: self.id.ok_or_else(|| {
320                ::aws_smithy_types::error::operation::BuildError::missing_field(
321                    "id",
322                    "id was not specified but it is required when building GetGlossaryOutput",
323                )
324            })?,
325            owning_project_id: self.owning_project_id.ok_or_else(|| {
326                ::aws_smithy_types::error::operation::BuildError::missing_field(
327                    "owning_project_id",
328                    "owning_project_id was not specified but it is required when building GetGlossaryOutput",
329                )
330            })?,
331            name: self.name.ok_or_else(|| {
332                ::aws_smithy_types::error::operation::BuildError::missing_field(
333                    "name",
334                    "name was not specified but it is required when building GetGlossaryOutput",
335                )
336            })?,
337            description: self.description,
338            status: self.status.ok_or_else(|| {
339                ::aws_smithy_types::error::operation::BuildError::missing_field(
340                    "status",
341                    "status was not specified but it is required when building GetGlossaryOutput",
342                )
343            })?,
344            created_at: self.created_at,
345            created_by: self.created_by,
346            updated_at: self.updated_at,
347            updated_by: self.updated_by,
348            usage_restrictions: self.usage_restrictions,
349            _request_id: self._request_id,
350        })
351    }
352}
353impl ::std::fmt::Debug for GetGlossaryOutputBuilder {
354    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
355        let mut formatter = f.debug_struct("GetGlossaryOutputBuilder");
356        formatter.field("domain_id", &self.domain_id);
357        formatter.field("id", &self.id);
358        formatter.field("owning_project_id", &self.owning_project_id);
359        formatter.field("name", &"*** Sensitive Data Redacted ***");
360        formatter.field("description", &"*** Sensitive Data Redacted ***");
361        formatter.field("status", &self.status);
362        formatter.field("created_at", &self.created_at);
363        formatter.field("created_by", &self.created_by);
364        formatter.field("updated_at", &self.updated_at);
365        formatter.field("updated_by", &self.updated_by);
366        formatter.field("usage_restrictions", &self.usage_restrictions);
367        formatter.field("_request_id", &self._request_id);
368        formatter.finish()
369    }
370}