aws_sdk_datazone/operation/create_glossary/
_create_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 CreateGlossaryOutput {
6    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
7    pub domain_id: ::std::string::String,
8    /// <p>The ID of this business glossary.</p>
9    pub id: ::std::string::String,
10    /// <p>The name of this business glossary.</p>
11    pub name: ::std::string::String,
12    /// <p>The ID of the project that currently owns this business glossary.</p>
13    pub owning_project_id: ::std::string::String,
14    /// <p>The description of this business glossary.</p>
15    pub description: ::std::option::Option<::std::string::String>,
16    /// <p>The status of this business glossary.</p>
17    pub status: ::std::option::Option<crate::types::GlossaryStatus>,
18    /// <p>The usage restriction of the restricted glossary.</p>
19    pub usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
20    _request_id: Option<String>,
21}
22impl CreateGlossaryOutput {
23    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
24    pub fn domain_id(&self) -> &str {
25        use std::ops::Deref;
26        self.domain_id.deref()
27    }
28    /// <p>The ID of this business glossary.</p>
29    pub fn id(&self) -> &str {
30        use std::ops::Deref;
31        self.id.deref()
32    }
33    /// <p>The name of this business glossary.</p>
34    pub fn name(&self) -> &str {
35        use std::ops::Deref;
36        self.name.deref()
37    }
38    /// <p>The ID of the project that currently owns this business glossary.</p>
39    pub fn owning_project_id(&self) -> &str {
40        use std::ops::Deref;
41        self.owning_project_id.deref()
42    }
43    /// <p>The description of this business glossary.</p>
44    pub fn description(&self) -> ::std::option::Option<&str> {
45        self.description.as_deref()
46    }
47    /// <p>The status of this business glossary.</p>
48    pub fn status(&self) -> ::std::option::Option<&crate::types::GlossaryStatus> {
49        self.status.as_ref()
50    }
51    /// <p>The usage restriction of the restricted glossary.</p>
52    ///
53    /// 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()`.
54    pub fn usage_restrictions(&self) -> &[crate::types::GlossaryUsageRestriction] {
55        self.usage_restrictions.as_deref().unwrap_or_default()
56    }
57}
58impl ::std::fmt::Debug for CreateGlossaryOutput {
59    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
60        let mut formatter = f.debug_struct("CreateGlossaryOutput");
61        formatter.field("domain_id", &self.domain_id);
62        formatter.field("id", &self.id);
63        formatter.field("name", &"*** Sensitive Data Redacted ***");
64        formatter.field("owning_project_id", &self.owning_project_id);
65        formatter.field("description", &"*** Sensitive Data Redacted ***");
66        formatter.field("status", &self.status);
67        formatter.field("usage_restrictions", &self.usage_restrictions);
68        formatter.field("_request_id", &self._request_id);
69        formatter.finish()
70    }
71}
72impl ::aws_types::request_id::RequestId for CreateGlossaryOutput {
73    fn request_id(&self) -> Option<&str> {
74        self._request_id.as_deref()
75    }
76}
77impl CreateGlossaryOutput {
78    /// Creates a new builder-style object to manufacture [`CreateGlossaryOutput`](crate::operation::create_glossary::CreateGlossaryOutput).
79    pub fn builder() -> crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder {
80        crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder::default()
81    }
82}
83
84/// A builder for [`CreateGlossaryOutput`](crate::operation::create_glossary::CreateGlossaryOutput).
85#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
86#[non_exhaustive]
87pub struct CreateGlossaryOutputBuilder {
88    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
89    pub(crate) id: ::std::option::Option<::std::string::String>,
90    pub(crate) name: ::std::option::Option<::std::string::String>,
91    pub(crate) owning_project_id: ::std::option::Option<::std::string::String>,
92    pub(crate) description: ::std::option::Option<::std::string::String>,
93    pub(crate) status: ::std::option::Option<crate::types::GlossaryStatus>,
94    pub(crate) usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
95    _request_id: Option<String>,
96}
97impl CreateGlossaryOutputBuilder {
98    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
99    /// This field is required.
100    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
101        self.domain_id = ::std::option::Option::Some(input.into());
102        self
103    }
104    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
105    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106        self.domain_id = input;
107        self
108    }
109    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
110    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
111        &self.domain_id
112    }
113    /// <p>The ID of this business glossary.</p>
114    /// This field is required.
115    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.id = ::std::option::Option::Some(input.into());
117        self
118    }
119    /// <p>The ID of this business glossary.</p>
120    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.id = input;
122        self
123    }
124    /// <p>The ID of this business glossary.</p>
125    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
126        &self.id
127    }
128    /// <p>The name of this business glossary.</p>
129    /// This field is required.
130    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
131        self.name = ::std::option::Option::Some(input.into());
132        self
133    }
134    /// <p>The name of this business glossary.</p>
135    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136        self.name = input;
137        self
138    }
139    /// <p>The name of this business glossary.</p>
140    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
141        &self.name
142    }
143    /// <p>The ID of the project that currently owns this business glossary.</p>
144    /// This field is required.
145    pub fn owning_project_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146        self.owning_project_id = ::std::option::Option::Some(input.into());
147        self
148    }
149    /// <p>The ID of the project that currently owns this business glossary.</p>
150    pub fn set_owning_project_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
151        self.owning_project_id = input;
152        self
153    }
154    /// <p>The ID of the project that currently owns this business glossary.</p>
155    pub fn get_owning_project_id(&self) -> &::std::option::Option<::std::string::String> {
156        &self.owning_project_id
157    }
158    /// <p>The description of this business glossary.</p>
159    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
160        self.description = ::std::option::Option::Some(input.into());
161        self
162    }
163    /// <p>The description of this business glossary.</p>
164    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165        self.description = input;
166        self
167    }
168    /// <p>The description of this business glossary.</p>
169    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
170        &self.description
171    }
172    /// <p>The status of this business glossary.</p>
173    pub fn status(mut self, input: crate::types::GlossaryStatus) -> Self {
174        self.status = ::std::option::Option::Some(input);
175        self
176    }
177    /// <p>The status of this business glossary.</p>
178    pub fn set_status(mut self, input: ::std::option::Option<crate::types::GlossaryStatus>) -> Self {
179        self.status = input;
180        self
181    }
182    /// <p>The status of this business glossary.</p>
183    pub fn get_status(&self) -> &::std::option::Option<crate::types::GlossaryStatus> {
184        &self.status
185    }
186    /// Appends an item to `usage_restrictions`.
187    ///
188    /// To override the contents of this collection use [`set_usage_restrictions`](Self::set_usage_restrictions).
189    ///
190    /// <p>The usage restriction of the restricted glossary.</p>
191    pub fn usage_restrictions(mut self, input: crate::types::GlossaryUsageRestriction) -> Self {
192        let mut v = self.usage_restrictions.unwrap_or_default();
193        v.push(input);
194        self.usage_restrictions = ::std::option::Option::Some(v);
195        self
196    }
197    /// <p>The usage restriction of the restricted glossary.</p>
198    pub fn set_usage_restrictions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>) -> Self {
199        self.usage_restrictions = input;
200        self
201    }
202    /// <p>The usage restriction of the restricted glossary.</p>
203    pub fn get_usage_restrictions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>> {
204        &self.usage_restrictions
205    }
206    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
207        self._request_id = Some(request_id.into());
208        self
209    }
210
211    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
212        self._request_id = request_id;
213        self
214    }
215    /// Consumes the builder and constructs a [`CreateGlossaryOutput`](crate::operation::create_glossary::CreateGlossaryOutput).
216    /// This method will fail if any of the following fields are not set:
217    /// - [`domain_id`](crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder::domain_id)
218    /// - [`id`](crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder::id)
219    /// - [`name`](crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder::name)
220    /// - [`owning_project_id`](crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder::owning_project_id)
221    pub fn build(
222        self,
223    ) -> ::std::result::Result<crate::operation::create_glossary::CreateGlossaryOutput, ::aws_smithy_types::error::operation::BuildError> {
224        ::std::result::Result::Ok(crate::operation::create_glossary::CreateGlossaryOutput {
225            domain_id: self.domain_id.ok_or_else(|| {
226                ::aws_smithy_types::error::operation::BuildError::missing_field(
227                    "domain_id",
228                    "domain_id was not specified but it is required when building CreateGlossaryOutput",
229                )
230            })?,
231            id: self.id.ok_or_else(|| {
232                ::aws_smithy_types::error::operation::BuildError::missing_field(
233                    "id",
234                    "id was not specified but it is required when building CreateGlossaryOutput",
235                )
236            })?,
237            name: self.name.ok_or_else(|| {
238                ::aws_smithy_types::error::operation::BuildError::missing_field(
239                    "name",
240                    "name was not specified but it is required when building CreateGlossaryOutput",
241                )
242            })?,
243            owning_project_id: self.owning_project_id.ok_or_else(|| {
244                ::aws_smithy_types::error::operation::BuildError::missing_field(
245                    "owning_project_id",
246                    "owning_project_id was not specified but it is required when building CreateGlossaryOutput",
247                )
248            })?,
249            description: self.description,
250            status: self.status,
251            usage_restrictions: self.usage_restrictions,
252            _request_id: self._request_id,
253        })
254    }
255}
256impl ::std::fmt::Debug for CreateGlossaryOutputBuilder {
257    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
258        let mut formatter = f.debug_struct("CreateGlossaryOutputBuilder");
259        formatter.field("domain_id", &self.domain_id);
260        formatter.field("id", &self.id);
261        formatter.field("name", &"*** Sensitive Data Redacted ***");
262        formatter.field("owning_project_id", &self.owning_project_id);
263        formatter.field("description", &"*** Sensitive Data Redacted ***");
264        formatter.field("status", &self.status);
265        formatter.field("usage_restrictions", &self.usage_restrictions);
266        formatter.field("_request_id", &self._request_id);
267        formatter.finish()
268    }
269}