aws_sdk_datazone/operation/create_glossary/
_create_glossary_input.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 CreateGlossaryInput {
6    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
7    pub domain_identifier: ::std::option::Option<::std::string::String>,
8    /// <p>The name of this business glossary.</p>
9    pub name: ::std::option::Option<::std::string::String>,
10    /// <p>The ID of the project that currently owns business glossary.</p>
11    pub owning_project_identifier: ::std::option::Option<::std::string::String>,
12    /// <p>The description of this business glossary.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>The status of this business glossary.</p>
15    pub status: ::std::option::Option<crate::types::GlossaryStatus>,
16    /// <p>The usage restriction of the restricted glossary.</p>
17    pub usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
18    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
19    pub client_token: ::std::option::Option<::std::string::String>,
20}
21impl CreateGlossaryInput {
22    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
23    pub fn domain_identifier(&self) -> ::std::option::Option<&str> {
24        self.domain_identifier.as_deref()
25    }
26    /// <p>The name of this business glossary.</p>
27    pub fn name(&self) -> ::std::option::Option<&str> {
28        self.name.as_deref()
29    }
30    /// <p>The ID of the project that currently owns business glossary.</p>
31    pub fn owning_project_identifier(&self) -> ::std::option::Option<&str> {
32        self.owning_project_identifier.as_deref()
33    }
34    /// <p>The description of this business glossary.</p>
35    pub fn description(&self) -> ::std::option::Option<&str> {
36        self.description.as_deref()
37    }
38    /// <p>The status of this business glossary.</p>
39    pub fn status(&self) -> ::std::option::Option<&crate::types::GlossaryStatus> {
40        self.status.as_ref()
41    }
42    /// <p>The usage restriction of the restricted glossary.</p>
43    ///
44    /// 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()`.
45    pub fn usage_restrictions(&self) -> &[crate::types::GlossaryUsageRestriction] {
46        self.usage_restrictions.as_deref().unwrap_or_default()
47    }
48    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
49    pub fn client_token(&self) -> ::std::option::Option<&str> {
50        self.client_token.as_deref()
51    }
52}
53impl ::std::fmt::Debug for CreateGlossaryInput {
54    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
55        let mut formatter = f.debug_struct("CreateGlossaryInput");
56        formatter.field("domain_identifier", &self.domain_identifier);
57        formatter.field("name", &"*** Sensitive Data Redacted ***");
58        formatter.field("owning_project_identifier", &self.owning_project_identifier);
59        formatter.field("description", &"*** Sensitive Data Redacted ***");
60        formatter.field("status", &self.status);
61        formatter.field("usage_restrictions", &self.usage_restrictions);
62        formatter.field("client_token", &self.client_token);
63        formatter.finish()
64    }
65}
66impl CreateGlossaryInput {
67    /// Creates a new builder-style object to manufacture [`CreateGlossaryInput`](crate::operation::create_glossary::CreateGlossaryInput).
68    pub fn builder() -> crate::operation::create_glossary::builders::CreateGlossaryInputBuilder {
69        crate::operation::create_glossary::builders::CreateGlossaryInputBuilder::default()
70    }
71}
72
73/// A builder for [`CreateGlossaryInput`](crate::operation::create_glossary::CreateGlossaryInput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
75#[non_exhaustive]
76pub struct CreateGlossaryInputBuilder {
77    pub(crate) domain_identifier: ::std::option::Option<::std::string::String>,
78    pub(crate) name: ::std::option::Option<::std::string::String>,
79    pub(crate) owning_project_identifier: ::std::option::Option<::std::string::String>,
80    pub(crate) description: ::std::option::Option<::std::string::String>,
81    pub(crate) status: ::std::option::Option<crate::types::GlossaryStatus>,
82    pub(crate) usage_restrictions: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>,
83    pub(crate) client_token: ::std::option::Option<::std::string::String>,
84}
85impl CreateGlossaryInputBuilder {
86    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
87    /// This field is required.
88    pub fn domain_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.domain_identifier = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
93    pub fn set_domain_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.domain_identifier = input;
95        self
96    }
97    /// <p>The ID of the Amazon DataZone domain in which this business glossary is created.</p>
98    pub fn get_domain_identifier(&self) -> &::std::option::Option<::std::string::String> {
99        &self.domain_identifier
100    }
101    /// <p>The name of this business glossary.</p>
102    /// This field is required.
103    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
104        self.name = ::std::option::Option::Some(input.into());
105        self
106    }
107    /// <p>The name of this business glossary.</p>
108    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
109        self.name = input;
110        self
111    }
112    /// <p>The name of this business glossary.</p>
113    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
114        &self.name
115    }
116    /// <p>The ID of the project that currently owns business glossary.</p>
117    /// This field is required.
118    pub fn owning_project_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
119        self.owning_project_identifier = ::std::option::Option::Some(input.into());
120        self
121    }
122    /// <p>The ID of the project that currently owns business glossary.</p>
123    pub fn set_owning_project_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
124        self.owning_project_identifier = input;
125        self
126    }
127    /// <p>The ID of the project that currently owns business glossary.</p>
128    pub fn get_owning_project_identifier(&self) -> &::std::option::Option<::std::string::String> {
129        &self.owning_project_identifier
130    }
131    /// <p>The description of this business glossary.</p>
132    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.description = ::std::option::Option::Some(input.into());
134        self
135    }
136    /// <p>The description of this business glossary.</p>
137    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
138        self.description = input;
139        self
140    }
141    /// <p>The description of this business glossary.</p>
142    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
143        &self.description
144    }
145    /// <p>The status of this business glossary.</p>
146    pub fn status(mut self, input: crate::types::GlossaryStatus) -> Self {
147        self.status = ::std::option::Option::Some(input);
148        self
149    }
150    /// <p>The status of this business glossary.</p>
151    pub fn set_status(mut self, input: ::std::option::Option<crate::types::GlossaryStatus>) -> Self {
152        self.status = input;
153        self
154    }
155    /// <p>The status of this business glossary.</p>
156    pub fn get_status(&self) -> &::std::option::Option<crate::types::GlossaryStatus> {
157        &self.status
158    }
159    /// Appends an item to `usage_restrictions`.
160    ///
161    /// To override the contents of this collection use [`set_usage_restrictions`](Self::set_usage_restrictions).
162    ///
163    /// <p>The usage restriction of the restricted glossary.</p>
164    pub fn usage_restrictions(mut self, input: crate::types::GlossaryUsageRestriction) -> Self {
165        let mut v = self.usage_restrictions.unwrap_or_default();
166        v.push(input);
167        self.usage_restrictions = ::std::option::Option::Some(v);
168        self
169    }
170    /// <p>The usage restriction of the restricted glossary.</p>
171    pub fn set_usage_restrictions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>>) -> Self {
172        self.usage_restrictions = input;
173        self
174    }
175    /// <p>The usage restriction of the restricted glossary.</p>
176    pub fn get_usage_restrictions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::GlossaryUsageRestriction>> {
177        &self.usage_restrictions
178    }
179    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
180    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181        self.client_token = ::std::option::Option::Some(input.into());
182        self
183    }
184    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
185    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186        self.client_token = input;
187        self
188    }
189    /// <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>
190    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
191        &self.client_token
192    }
193    /// Consumes the builder and constructs a [`CreateGlossaryInput`](crate::operation::create_glossary::CreateGlossaryInput).
194    pub fn build(
195        self,
196    ) -> ::std::result::Result<crate::operation::create_glossary::CreateGlossaryInput, ::aws_smithy_types::error::operation::BuildError> {
197        ::std::result::Result::Ok(crate::operation::create_glossary::CreateGlossaryInput {
198            domain_identifier: self.domain_identifier,
199            name: self.name,
200            owning_project_identifier: self.owning_project_identifier,
201            description: self.description,
202            status: self.status,
203            usage_restrictions: self.usage_restrictions,
204            client_token: self.client_token,
205        })
206    }
207}
208impl ::std::fmt::Debug for CreateGlossaryInputBuilder {
209    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
210        let mut formatter = f.debug_struct("CreateGlossaryInputBuilder");
211        formatter.field("domain_identifier", &self.domain_identifier);
212        formatter.field("name", &"*** Sensitive Data Redacted ***");
213        formatter.field("owning_project_identifier", &self.owning_project_identifier);
214        formatter.field("description", &"*** Sensitive Data Redacted ***");
215        formatter.field("status", &self.status);
216        formatter.field("usage_restrictions", &self.usage_restrictions);
217        formatter.field("client_token", &self.client_token);
218        formatter.finish()
219    }
220}