aws_sdk_connect/operation/create_view/
_create_view_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 CreateViewInput {
6    /// <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
7    pub instance_id: ::std::option::Option<::std::string::String>,
8    /// <p>A unique Id for each create view request to avoid duplicate view creation. For example, the view is idempotent ClientToken is provided.</p>
9    pub client_token: ::std::option::Option<::std::string::String>,
10    /// <p>Indicates the view status as either <code>SAVED</code> or <code>PUBLISHED</code>. The <code>PUBLISHED</code> status will initiate validation on the content.</p>
11    pub status: ::std::option::Option<crate::types::ViewStatus>,
12    /// <p>View content containing all content necessary to render a view except for runtime input data.</p>
13    /// <p>The total uncompressed content has a maximum file size of 400kB.</p>
14    pub content: ::std::option::Option<crate::types::ViewInputContent>,
15    /// <p>The description of the view.</p>
16    pub description: ::std::option::Option<::std::string::String>,
17    /// <p>The name of the view.</p>
18    pub name: ::std::option::Option<::std::string::String>,
19    /// <p>The tags associated with the view resource (not specific to view version).These tags can be used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
20    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
21}
22impl CreateViewInput {
23    /// <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
24    pub fn instance_id(&self) -> ::std::option::Option<&str> {
25        self.instance_id.as_deref()
26    }
27    /// <p>A unique Id for each create view request to avoid duplicate view creation. For example, the view is idempotent ClientToken is provided.</p>
28    pub fn client_token(&self) -> ::std::option::Option<&str> {
29        self.client_token.as_deref()
30    }
31    /// <p>Indicates the view status as either <code>SAVED</code> or <code>PUBLISHED</code>. The <code>PUBLISHED</code> status will initiate validation on the content.</p>
32    pub fn status(&self) -> ::std::option::Option<&crate::types::ViewStatus> {
33        self.status.as_ref()
34    }
35    /// <p>View content containing all content necessary to render a view except for runtime input data.</p>
36    /// <p>The total uncompressed content has a maximum file size of 400kB.</p>
37    pub fn content(&self) -> ::std::option::Option<&crate::types::ViewInputContent> {
38        self.content.as_ref()
39    }
40    /// <p>The description of the view.</p>
41    pub fn description(&self) -> ::std::option::Option<&str> {
42        self.description.as_deref()
43    }
44    /// <p>The name of the view.</p>
45    pub fn name(&self) -> ::std::option::Option<&str> {
46        self.name.as_deref()
47    }
48    /// <p>The tags associated with the view resource (not specific to view version).These tags can be used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
49    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
50        self.tags.as_ref()
51    }
52}
53impl ::std::fmt::Debug for CreateViewInput {
54    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
55        let mut formatter = f.debug_struct("CreateViewInput");
56        formatter.field("instance_id", &self.instance_id);
57        formatter.field("client_token", &self.client_token);
58        formatter.field("status", &self.status);
59        formatter.field("content", &self.content);
60        formatter.field("description", &self.description);
61        formatter.field("name", &"*** Sensitive Data Redacted ***");
62        formatter.field("tags", &self.tags);
63        formatter.finish()
64    }
65}
66impl CreateViewInput {
67    /// Creates a new builder-style object to manufacture [`CreateViewInput`](crate::operation::create_view::CreateViewInput).
68    pub fn builder() -> crate::operation::create_view::builders::CreateViewInputBuilder {
69        crate::operation::create_view::builders::CreateViewInputBuilder::default()
70    }
71}
72
73/// A builder for [`CreateViewInput`](crate::operation::create_view::CreateViewInput).
74#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default)]
75#[non_exhaustive]
76pub struct CreateViewInputBuilder {
77    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
78    pub(crate) client_token: ::std::option::Option<::std::string::String>,
79    pub(crate) status: ::std::option::Option<crate::types::ViewStatus>,
80    pub(crate) content: ::std::option::Option<crate::types::ViewInputContent>,
81    pub(crate) description: ::std::option::Option<::std::string::String>,
82    pub(crate) name: ::std::option::Option<::std::string::String>,
83    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
84}
85impl CreateViewInputBuilder {
86    /// <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
87    /// This field is required.
88    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
89        self.instance_id = ::std::option::Option::Some(input.into());
90        self
91    }
92    /// <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
93    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
94        self.instance_id = input;
95        self
96    }
97    /// <p>The identifier of the Amazon Connect instance. You can find the instanceId in the ARN of the instance.</p>
98    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
99        &self.instance_id
100    }
101    /// <p>A unique Id for each create view request to avoid duplicate view creation. For example, the view is idempotent ClientToken is provided.</p>
102    pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
103        self.client_token = ::std::option::Option::Some(input.into());
104        self
105    }
106    /// <p>A unique Id for each create view request to avoid duplicate view creation. For example, the view is idempotent ClientToken is provided.</p>
107    pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
108        self.client_token = input;
109        self
110    }
111    /// <p>A unique Id for each create view request to avoid duplicate view creation. For example, the view is idempotent ClientToken is provided.</p>
112    pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
113        &self.client_token
114    }
115    /// <p>Indicates the view status as either <code>SAVED</code> or <code>PUBLISHED</code>. The <code>PUBLISHED</code> status will initiate validation on the content.</p>
116    /// This field is required.
117    pub fn status(mut self, input: crate::types::ViewStatus) -> Self {
118        self.status = ::std::option::Option::Some(input);
119        self
120    }
121    /// <p>Indicates the view status as either <code>SAVED</code> or <code>PUBLISHED</code>. The <code>PUBLISHED</code> status will initiate validation on the content.</p>
122    pub fn set_status(mut self, input: ::std::option::Option<crate::types::ViewStatus>) -> Self {
123        self.status = input;
124        self
125    }
126    /// <p>Indicates the view status as either <code>SAVED</code> or <code>PUBLISHED</code>. The <code>PUBLISHED</code> status will initiate validation on the content.</p>
127    pub fn get_status(&self) -> &::std::option::Option<crate::types::ViewStatus> {
128        &self.status
129    }
130    /// <p>View content containing all content necessary to render a view except for runtime input data.</p>
131    /// <p>The total uncompressed content has a maximum file size of 400kB.</p>
132    /// This field is required.
133    pub fn content(mut self, input: crate::types::ViewInputContent) -> Self {
134        self.content = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>View content containing all content necessary to render a view except for runtime input data.</p>
138    /// <p>The total uncompressed content has a maximum file size of 400kB.</p>
139    pub fn set_content(mut self, input: ::std::option::Option<crate::types::ViewInputContent>) -> Self {
140        self.content = input;
141        self
142    }
143    /// <p>View content containing all content necessary to render a view except for runtime input data.</p>
144    /// <p>The total uncompressed content has a maximum file size of 400kB.</p>
145    pub fn get_content(&self) -> &::std::option::Option<crate::types::ViewInputContent> {
146        &self.content
147    }
148    /// <p>The description of the view.</p>
149    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.description = ::std::option::Option::Some(input.into());
151        self
152    }
153    /// <p>The description of the view.</p>
154    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.description = input;
156        self
157    }
158    /// <p>The description of the view.</p>
159    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
160        &self.description
161    }
162    /// <p>The name of the view.</p>
163    /// This field is required.
164    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
165        self.name = ::std::option::Option::Some(input.into());
166        self
167    }
168    /// <p>The name of the view.</p>
169    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
170        self.name = input;
171        self
172    }
173    /// <p>The name of the view.</p>
174    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
175        &self.name
176    }
177    /// Adds a key-value pair to `tags`.
178    ///
179    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
180    ///
181    /// <p>The tags associated with the view resource (not specific to view version).These tags can be used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
182    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
183        let mut hash_map = self.tags.unwrap_or_default();
184        hash_map.insert(k.into(), v.into());
185        self.tags = ::std::option::Option::Some(hash_map);
186        self
187    }
188    /// <p>The tags associated with the view resource (not specific to view version).These tags can be used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
189    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
190        self.tags = input;
191        self
192    }
193    /// <p>The tags associated with the view resource (not specific to view version).These tags can be used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.</p>
194    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
195        &self.tags
196    }
197    /// Consumes the builder and constructs a [`CreateViewInput`](crate::operation::create_view::CreateViewInput).
198    pub fn build(self) -> ::std::result::Result<crate::operation::create_view::CreateViewInput, ::aws_smithy_types::error::operation::BuildError> {
199        ::std::result::Result::Ok(crate::operation::create_view::CreateViewInput {
200            instance_id: self.instance_id,
201            client_token: self.client_token,
202            status: self.status,
203            content: self.content,
204            description: self.description,
205            name: self.name,
206            tags: self.tags,
207        })
208    }
209}
210impl ::std::fmt::Debug for CreateViewInputBuilder {
211    fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
212        let mut formatter = f.debug_struct("CreateViewInputBuilder");
213        formatter.field("instance_id", &self.instance_id);
214        formatter.field("client_token", &self.client_token);
215        formatter.field("status", &self.status);
216        formatter.field("content", &self.content);
217        formatter.field("description", &self.description);
218        formatter.field("name", &"*** Sensitive Data Redacted ***");
219        formatter.field("tags", &self.tags);
220        formatter.finish()
221    }
222}