aws_sdk_datazone/operation/get_glossary/
_get_glossary_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct GetGlossaryOutput {
6 pub domain_id: ::std::string::String,
8 pub id: ::std::string::String,
10 pub owning_project_id: ::std::string::String,
12 pub name: ::std::string::String,
14 pub description: ::std::option::Option<::std::string::String>,
16 pub status: crate::types::GlossaryStatus,
18 pub created_at: ::std::option::Option<::aws_smithy_types::DateTime>,
20 pub created_by: ::std::option::Option<::std::string::String>,
22 pub updated_at: ::std::option::Option<::aws_smithy_types::DateTime>,
24 pub updated_by: ::std::option::Option<::std::string::String>,
26 pub usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
28 _request_id: Option<String>,
29}
30impl GetGlossaryOutput {
31 pub fn domain_id(&self) -> &str {
33 use std::ops::Deref;
34 self.domain_id.deref()
35 }
36 pub fn id(&self) -> &str {
38 use std::ops::Deref;
39 self.id.deref()
40 }
41 pub fn owning_project_id(&self) -> &str {
43 use std::ops::Deref;
44 self.owning_project_id.deref()
45 }
46 pub fn name(&self) -> &str {
48 use std::ops::Deref;
49 self.name.deref()
50 }
51 pub fn description(&self) -> ::std::option::Option<&str> {
53 self.description.as_deref()
54 }
55 pub fn status(&self) -> &crate::types::GlossaryStatus {
57 &self.status
58 }
59 pub fn created_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
61 self.created_at.as_ref()
62 }
63 pub fn created_by(&self) -> ::std::option::Option<&str> {
65 self.created_by.as_deref()
66 }
67 pub fn updated_at(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
69 self.updated_at.as_ref()
70 }
71 pub fn updated_by(&self) -> ::std::option::Option<&str> {
73 self.updated_by.as_deref()
74 }
75 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 pub fn builder() -> crate::operation::get_glossary::builders::GetGlossaryOutputBuilder {
108 crate::operation::get_glossary::builders::GetGlossaryOutputBuilder::default()
109 }
110}
111
112#[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 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 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138 self.domain_id = input;
139 self
140 }
141 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
143 &self.domain_id
144 }
145 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 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
153 self.id = input;
154 self
155 }
156 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
158 &self.id
159 }
160 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 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 pub fn get_owning_project_id(&self) -> &::std::option::Option<::std::string::String> {
173 &self.owning_project_id
174 }
175 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183 self.name = input;
184 self
185 }
186 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
188 &self.name
189 }
190 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197 self.description = input;
198 self
199 }
200 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
202 &self.description
203 }
204 pub fn status(mut self, input: crate::types::GlossaryStatus) -> Self {
207 self.status = ::std::option::Option::Some(input);
208 self
209 }
210 pub fn set_status(mut self, input: ::std::option::Option<crate::types::GlossaryStatus>) -> Self {
212 self.status = input;
213 self
214 }
215 pub fn get_status(&self) -> &::std::option::Option<crate::types::GlossaryStatus> {
217 &self.status
218 }
219 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 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 pub fn get_created_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
231 &self.created_at
232 }
233 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 pub fn set_created_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
240 self.created_by = input;
241 self
242 }
243 pub fn get_created_by(&self) -> &::std::option::Option<::std::string::String> {
245 &self.created_by
246 }
247 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 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 pub fn get_updated_at(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
259 &self.updated_at
260 }
261 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 pub fn set_updated_by(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
268 self.updated_by = input;
269 self
270 }
271 pub fn get_updated_by(&self) -> &::std::option::Option<::std::string::String> {
273 &self.updated_by
274 }
275 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 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 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 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}