aws_sdk_datazone/operation/create_glossary/
_create_glossary_output.rs1#[allow(missing_docs)] #[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq)]
5pub struct CreateGlossaryOutput {
6 pub domain_id: ::std::string::String,
8 pub id: ::std::string::String,
10 pub name: ::std::string::String,
12 pub owning_project_id: ::std::string::String,
14 pub description: ::std::option::Option<::std::string::String>,
16 pub status: ::std::option::Option<crate::types::GlossaryStatus>,
18 pub usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
20 _request_id: Option<String>,
21}
22impl CreateGlossaryOutput {
23 pub fn domain_id(&self) -> &str {
25 use std::ops::Deref;
26 self.domain_id.deref()
27 }
28 pub fn id(&self) -> &str {
30 use std::ops::Deref;
31 self.id.deref()
32 }
33 pub fn name(&self) -> &str {
35 use std::ops::Deref;
36 self.name.deref()
37 }
38 pub fn owning_project_id(&self) -> &str {
40 use std::ops::Deref;
41 self.owning_project_id.deref()
42 }
43 pub fn description(&self) -> ::std::option::Option<&str> {
45 self.description.as_deref()
46 }
47 pub fn status(&self) -> ::std::option::Option<&crate::types::GlossaryStatus> {
49 self.status.as_ref()
50 }
51 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 pub fn builder() -> crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder {
80 crate::operation::create_glossary::builders::CreateGlossaryOutputBuilder::default()
81 }
82}
83
84#[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 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 pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
106 self.domain_id = input;
107 self
108 }
109 pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
111 &self.domain_id
112 }
113 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 pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121 self.id = input;
122 self
123 }
124 pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
126 &self.id
127 }
128 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 pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
136 self.name = input;
137 self
138 }
139 pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
141 &self.name
142 }
143 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 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 pub fn get_owning_project_id(&self) -> &::std::option::Option<::std::string::String> {
156 &self.owning_project_id
157 }
158 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 pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
165 self.description = input;
166 self
167 }
168 pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
170 &self.description
171 }
172 pub fn status(mut self, input: crate::types::GlossaryStatus) -> Self {
174 self.status = ::std::option::Option::Some(input);
175 self
176 }
177 pub fn set_status(mut self, input: ::std::option::Option<crate::types::GlossaryStatus>) -> Self {
179 self.status = input;
180 self
181 }
182 pub fn get_status(&self) -> &::std::option::Option<crate::types::GlossaryStatus> {
184 &self.status
185 }
186 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 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 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 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}