Skip to main content

aws_sdk_connectcases/operation/get_template/
_get_template_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, ::std::fmt::Debug)]
5pub struct GetTemplateOutput {
6    /// <p>A unique identifier of a template.</p>
7    pub template_id: ::std::string::String,
8    /// <p>The Amazon Resource Name (ARN) of the template.</p>
9    pub template_arn: ::std::string::String,
10    /// <p>The name of the template.</p>
11    pub name: ::std::string::String,
12    /// <p>A brief description of the template.</p>
13    pub description: ::std::option::Option<::std::string::String>,
14    /// <p>Configuration of layouts associated to the template.</p>
15    pub layout_configuration: ::std::option::Option<crate::types::LayoutConfiguration>,
16    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
17    pub required_fields: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>,
18    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
19    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
20    /// <p>The status of the template.</p>
21    pub status: crate::types::TemplateStatus,
22    /// <p>Denotes whether or not the resource has been deleted.</p>
23    pub deleted: bool,
24    /// <p>Timestamp at which the resource was created.</p>
25    pub created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
26    /// <p>Timestamp at which the resource was created or last modified.</p>
27    pub last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
28    /// <p>A list of case rules (also known as <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html">case field conditions</a>) on a template.</p>
29    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>,
30    /// <p>Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.</p>
31    pub tag_propagation_configurations: ::std::option::Option<::std::vec::Vec<crate::types::TagPropagationConfiguration>>,
32    _request_id: Option<String>,
33}
34impl GetTemplateOutput {
35    /// <p>A unique identifier of a template.</p>
36    pub fn template_id(&self) -> &str {
37        use std::ops::Deref;
38        self.template_id.deref()
39    }
40    /// <p>The Amazon Resource Name (ARN) of the template.</p>
41    pub fn template_arn(&self) -> &str {
42        use std::ops::Deref;
43        self.template_arn.deref()
44    }
45    /// <p>The name of the template.</p>
46    pub fn name(&self) -> &str {
47        use std::ops::Deref;
48        self.name.deref()
49    }
50    /// <p>A brief description of the template.</p>
51    pub fn description(&self) -> ::std::option::Option<&str> {
52        self.description.as_deref()
53    }
54    /// <p>Configuration of layouts associated to the template.</p>
55    pub fn layout_configuration(&self) -> ::std::option::Option<&crate::types::LayoutConfiguration> {
56        self.layout_configuration.as_ref()
57    }
58    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
59    ///
60    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.required_fields.is_none()`.
61    pub fn required_fields(&self) -> &[crate::types::RequiredField] {
62        self.required_fields.as_deref().unwrap_or_default()
63    }
64    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
65    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
66        self.tags.as_ref()
67    }
68    /// <p>The status of the template.</p>
69    pub fn status(&self) -> &crate::types::TemplateStatus {
70        &self.status
71    }
72    /// <p>Denotes whether or not the resource has been deleted.</p>
73    pub fn deleted(&self) -> bool {
74        self.deleted
75    }
76    /// <p>Timestamp at which the resource was created.</p>
77    pub fn created_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
78        self.created_time.as_ref()
79    }
80    /// <p>Timestamp at which the resource was created or last modified.</p>
81    pub fn last_modified_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
82        self.last_modified_time.as_ref()
83    }
84    /// <p>A list of case rules (also known as <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html">case field conditions</a>) on a template.</p>
85    ///
86    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.rules.is_none()`.
87    pub fn rules(&self) -> &[crate::types::TemplateRule] {
88        self.rules.as_deref().unwrap_or_default()
89    }
90    /// <p>Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.</p>
91    ///
92    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.tag_propagation_configurations.is_none()`.
93    pub fn tag_propagation_configurations(&self) -> &[crate::types::TagPropagationConfiguration] {
94        self.tag_propagation_configurations.as_deref().unwrap_or_default()
95    }
96}
97impl ::aws_types::request_id::RequestId for GetTemplateOutput {
98    fn request_id(&self) -> Option<&str> {
99        self._request_id.as_deref()
100    }
101}
102impl GetTemplateOutput {
103    /// Creates a new builder-style object to manufacture [`GetTemplateOutput`](crate::operation::get_template::GetTemplateOutput).
104    pub fn builder() -> crate::operation::get_template::builders::GetTemplateOutputBuilder {
105        crate::operation::get_template::builders::GetTemplateOutputBuilder::default()
106    }
107}
108
109/// A builder for [`GetTemplateOutput`](crate::operation::get_template::GetTemplateOutput).
110#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
111#[non_exhaustive]
112pub struct GetTemplateOutputBuilder {
113    pub(crate) template_id: ::std::option::Option<::std::string::String>,
114    pub(crate) template_arn: ::std::option::Option<::std::string::String>,
115    pub(crate) name: ::std::option::Option<::std::string::String>,
116    pub(crate) description: ::std::option::Option<::std::string::String>,
117    pub(crate) layout_configuration: ::std::option::Option<crate::types::LayoutConfiguration>,
118    pub(crate) required_fields: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>,
119    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
120    pub(crate) status: ::std::option::Option<crate::types::TemplateStatus>,
121    pub(crate) deleted: ::std::option::Option<bool>,
122    pub(crate) created_time: ::std::option::Option<::aws_smithy_types::DateTime>,
123    pub(crate) last_modified_time: ::std::option::Option<::aws_smithy_types::DateTime>,
124    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>,
125    pub(crate) tag_propagation_configurations: ::std::option::Option<::std::vec::Vec<crate::types::TagPropagationConfiguration>>,
126    _request_id: Option<String>,
127}
128impl GetTemplateOutputBuilder {
129    /// <p>A unique identifier of a template.</p>
130    /// This field is required.
131    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
132        self.template_id = ::std::option::Option::Some(input.into());
133        self
134    }
135    /// <p>A unique identifier of a template.</p>
136    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
137        self.template_id = input;
138        self
139    }
140    /// <p>A unique identifier of a template.</p>
141    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
142        &self.template_id
143    }
144    /// <p>The Amazon Resource Name (ARN) of the template.</p>
145    /// This field is required.
146    pub fn template_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
147        self.template_arn = ::std::option::Option::Some(input.into());
148        self
149    }
150    /// <p>The Amazon Resource Name (ARN) of the template.</p>
151    pub fn set_template_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
152        self.template_arn = input;
153        self
154    }
155    /// <p>The Amazon Resource Name (ARN) of the template.</p>
156    pub fn get_template_arn(&self) -> &::std::option::Option<::std::string::String> {
157        &self.template_arn
158    }
159    /// <p>The name of the template.</p>
160    /// This field is required.
161    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
162        self.name = ::std::option::Option::Some(input.into());
163        self
164    }
165    /// <p>The name of the template.</p>
166    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
167        self.name = input;
168        self
169    }
170    /// <p>The name of the template.</p>
171    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
172        &self.name
173    }
174    /// <p>A brief description of the template.</p>
175    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
176        self.description = ::std::option::Option::Some(input.into());
177        self
178    }
179    /// <p>A brief description of the template.</p>
180    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
181        self.description = input;
182        self
183    }
184    /// <p>A brief description of the template.</p>
185    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
186        &self.description
187    }
188    /// <p>Configuration of layouts associated to the template.</p>
189    pub fn layout_configuration(mut self, input: crate::types::LayoutConfiguration) -> Self {
190        self.layout_configuration = ::std::option::Option::Some(input);
191        self
192    }
193    /// <p>Configuration of layouts associated to the template.</p>
194    pub fn set_layout_configuration(mut self, input: ::std::option::Option<crate::types::LayoutConfiguration>) -> Self {
195        self.layout_configuration = input;
196        self
197    }
198    /// <p>Configuration of layouts associated to the template.</p>
199    pub fn get_layout_configuration(&self) -> &::std::option::Option<crate::types::LayoutConfiguration> {
200        &self.layout_configuration
201    }
202    /// Appends an item to `required_fields`.
203    ///
204    /// To override the contents of this collection use [`set_required_fields`](Self::set_required_fields).
205    ///
206    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
207    pub fn required_fields(mut self, input: crate::types::RequiredField) -> Self {
208        let mut v = self.required_fields.unwrap_or_default();
209        v.push(input);
210        self.required_fields = ::std::option::Option::Some(v);
211        self
212    }
213    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
214    pub fn set_required_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>) -> Self {
215        self.required_fields = input;
216        self
217    }
218    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
219    pub fn get_required_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequiredField>> {
220        &self.required_fields
221    }
222    /// Adds a key-value pair to `tags`.
223    ///
224    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
225    ///
226    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
227    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: ::std::option::Option<::std::string::String>) -> Self {
228        let mut hash_map = self.tags.unwrap_or_default();
229        hash_map.insert(k.into(), v);
230        self.tags = ::std::option::Option::Some(hash_map);
231        self
232    }
233    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
234    pub fn set_tags(
235        mut self,
236        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>>,
237    ) -> Self {
238        self.tags = input;
239        self
240    }
241    /// <p>A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.</p>
242    pub fn get_tags(
243        &self,
244    ) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::option::Option<::std::string::String>>> {
245        &self.tags
246    }
247    /// <p>The status of the template.</p>
248    /// This field is required.
249    pub fn status(mut self, input: crate::types::TemplateStatus) -> Self {
250        self.status = ::std::option::Option::Some(input);
251        self
252    }
253    /// <p>The status of the template.</p>
254    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TemplateStatus>) -> Self {
255        self.status = input;
256        self
257    }
258    /// <p>The status of the template.</p>
259    pub fn get_status(&self) -> &::std::option::Option<crate::types::TemplateStatus> {
260        &self.status
261    }
262    /// <p>Denotes whether or not the resource has been deleted.</p>
263    pub fn deleted(mut self, input: bool) -> Self {
264        self.deleted = ::std::option::Option::Some(input);
265        self
266    }
267    /// <p>Denotes whether or not the resource has been deleted.</p>
268    pub fn set_deleted(mut self, input: ::std::option::Option<bool>) -> Self {
269        self.deleted = input;
270        self
271    }
272    /// <p>Denotes whether or not the resource has been deleted.</p>
273    pub fn get_deleted(&self) -> &::std::option::Option<bool> {
274        &self.deleted
275    }
276    /// <p>Timestamp at which the resource was created.</p>
277    pub fn created_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
278        self.created_time = ::std::option::Option::Some(input);
279        self
280    }
281    /// <p>Timestamp at which the resource was created.</p>
282    pub fn set_created_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
283        self.created_time = input;
284        self
285    }
286    /// <p>Timestamp at which the resource was created.</p>
287    pub fn get_created_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
288        &self.created_time
289    }
290    /// <p>Timestamp at which the resource was created or last modified.</p>
291    pub fn last_modified_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
292        self.last_modified_time = ::std::option::Option::Some(input);
293        self
294    }
295    /// <p>Timestamp at which the resource was created or last modified.</p>
296    pub fn set_last_modified_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
297        self.last_modified_time = input;
298        self
299    }
300    /// <p>Timestamp at which the resource was created or last modified.</p>
301    pub fn get_last_modified_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
302        &self.last_modified_time
303    }
304    /// Appends an item to `rules`.
305    ///
306    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
307    ///
308    /// <p>A list of case rules (also known as <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html">case field conditions</a>) on a template.</p>
309    pub fn rules(mut self, input: crate::types::TemplateRule) -> Self {
310        let mut v = self.rules.unwrap_or_default();
311        v.push(input);
312        self.rules = ::std::option::Option::Some(v);
313        self
314    }
315    /// <p>A list of case rules (also known as <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html">case field conditions</a>) on a template.</p>
316    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>) -> Self {
317        self.rules = input;
318        self
319    }
320    /// <p>A list of case rules (also known as <a href="https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html">case field conditions</a>) on a template.</p>
321    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>> {
322        &self.rules
323    }
324    /// Appends an item to `tag_propagation_configurations`.
325    ///
326    /// To override the contents of this collection use [`set_tag_propagation_configurations`](Self::set_tag_propagation_configurations).
327    ///
328    /// <p>Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.</p>
329    pub fn tag_propagation_configurations(mut self, input: crate::types::TagPropagationConfiguration) -> Self {
330        let mut v = self.tag_propagation_configurations.unwrap_or_default();
331        v.push(input);
332        self.tag_propagation_configurations = ::std::option::Option::Some(v);
333        self
334    }
335    /// <p>Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.</p>
336    pub fn set_tag_propagation_configurations(
337        mut self,
338        input: ::std::option::Option<::std::vec::Vec<crate::types::TagPropagationConfiguration>>,
339    ) -> Self {
340        self.tag_propagation_configurations = input;
341        self
342    }
343    /// <p>Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.</p>
344    pub fn get_tag_propagation_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TagPropagationConfiguration>> {
345        &self.tag_propagation_configurations
346    }
347    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
348        self._request_id = Some(request_id.into());
349        self
350    }
351
352    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
353        self._request_id = request_id;
354        self
355    }
356    /// Consumes the builder and constructs a [`GetTemplateOutput`](crate::operation::get_template::GetTemplateOutput).
357    /// This method will fail if any of the following fields are not set:
358    /// - [`template_id`](crate::operation::get_template::builders::GetTemplateOutputBuilder::template_id)
359    /// - [`template_arn`](crate::operation::get_template::builders::GetTemplateOutputBuilder::template_arn)
360    /// - [`name`](crate::operation::get_template::builders::GetTemplateOutputBuilder::name)
361    /// - [`status`](crate::operation::get_template::builders::GetTemplateOutputBuilder::status)
362    pub fn build(self) -> ::std::result::Result<crate::operation::get_template::GetTemplateOutput, ::aws_smithy_types::error::operation::BuildError> {
363        ::std::result::Result::Ok(crate::operation::get_template::GetTemplateOutput {
364            template_id: self.template_id.ok_or_else(|| {
365                ::aws_smithy_types::error::operation::BuildError::missing_field(
366                    "template_id",
367                    "template_id was not specified but it is required when building GetTemplateOutput",
368                )
369            })?,
370            template_arn: self.template_arn.ok_or_else(|| {
371                ::aws_smithy_types::error::operation::BuildError::missing_field(
372                    "template_arn",
373                    "template_arn was not specified but it is required when building GetTemplateOutput",
374                )
375            })?,
376            name: self.name.ok_or_else(|| {
377                ::aws_smithy_types::error::operation::BuildError::missing_field(
378                    "name",
379                    "name was not specified but it is required when building GetTemplateOutput",
380                )
381            })?,
382            description: self.description,
383            layout_configuration: self.layout_configuration,
384            required_fields: self.required_fields,
385            tags: self.tags,
386            status: self.status.ok_or_else(|| {
387                ::aws_smithy_types::error::operation::BuildError::missing_field(
388                    "status",
389                    "status was not specified but it is required when building GetTemplateOutput",
390                )
391            })?,
392            deleted: self.deleted.unwrap_or_default(),
393            created_time: self.created_time,
394            last_modified_time: self.last_modified_time,
395            rules: self.rules,
396            tag_propagation_configurations: self.tag_propagation_configurations,
397            _request_id: self._request_id,
398        })
399    }
400}