aws_sdk_connectcases/operation/update_template/
_update_template_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, ::std::fmt::Debug)]
5pub struct UpdateTemplateInput {
6    /// <p>The unique identifier of the Cases domain.</p>
7    pub domain_id: ::std::option::Option<::std::string::String>,
8    /// <p>A unique identifier for the template.</p>
9    pub template_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the template. It must be unique per domain.</p>
11    pub name: ::std::option::Option<::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>The status of the template.</p>
19    pub status: ::std::option::Option<crate::types::TemplateStatus>,
20    /// <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>
21    pub rules: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>,
22}
23impl UpdateTemplateInput {
24    /// <p>The unique identifier of the Cases domain.</p>
25    pub fn domain_id(&self) -> ::std::option::Option<&str> {
26        self.domain_id.as_deref()
27    }
28    /// <p>A unique identifier for the template.</p>
29    pub fn template_id(&self) -> ::std::option::Option<&str> {
30        self.template_id.as_deref()
31    }
32    /// <p>The name of the template. It must be unique per domain.</p>
33    pub fn name(&self) -> ::std::option::Option<&str> {
34        self.name.as_deref()
35    }
36    /// <p>A brief description of the template.</p>
37    pub fn description(&self) -> ::std::option::Option<&str> {
38        self.description.as_deref()
39    }
40    /// <p>Configuration of layouts associated to the template.</p>
41    pub fn layout_configuration(&self) -> ::std::option::Option<&crate::types::LayoutConfiguration> {
42        self.layout_configuration.as_ref()
43    }
44    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
45    ///
46    /// 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()`.
47    pub fn required_fields(&self) -> &[crate::types::RequiredField] {
48        self.required_fields.as_deref().unwrap_or_default()
49    }
50    /// <p>The status of the template.</p>
51    pub fn status(&self) -> ::std::option::Option<&crate::types::TemplateStatus> {
52        self.status.as_ref()
53    }
54    /// <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>
55    ///
56    /// 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()`.
57    pub fn rules(&self) -> &[crate::types::TemplateRule] {
58        self.rules.as_deref().unwrap_or_default()
59    }
60}
61impl UpdateTemplateInput {
62    /// Creates a new builder-style object to manufacture [`UpdateTemplateInput`](crate::operation::update_template::UpdateTemplateInput).
63    pub fn builder() -> crate::operation::update_template::builders::UpdateTemplateInputBuilder {
64        crate::operation::update_template::builders::UpdateTemplateInputBuilder::default()
65    }
66}
67
68/// A builder for [`UpdateTemplateInput`](crate::operation::update_template::UpdateTemplateInput).
69#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
70#[non_exhaustive]
71pub struct UpdateTemplateInputBuilder {
72    pub(crate) domain_id: ::std::option::Option<::std::string::String>,
73    pub(crate) template_id: ::std::option::Option<::std::string::String>,
74    pub(crate) name: ::std::option::Option<::std::string::String>,
75    pub(crate) description: ::std::option::Option<::std::string::String>,
76    pub(crate) layout_configuration: ::std::option::Option<crate::types::LayoutConfiguration>,
77    pub(crate) required_fields: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>,
78    pub(crate) status: ::std::option::Option<crate::types::TemplateStatus>,
79    pub(crate) rules: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>,
80}
81impl UpdateTemplateInputBuilder {
82    /// <p>The unique identifier of the Cases domain.</p>
83    /// This field is required.
84    pub fn domain_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
85        self.domain_id = ::std::option::Option::Some(input.into());
86        self
87    }
88    /// <p>The unique identifier of the Cases domain.</p>
89    pub fn set_domain_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
90        self.domain_id = input;
91        self
92    }
93    /// <p>The unique identifier of the Cases domain.</p>
94    pub fn get_domain_id(&self) -> &::std::option::Option<::std::string::String> {
95        &self.domain_id
96    }
97    /// <p>A unique identifier for the template.</p>
98    /// This field is required.
99    pub fn template_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
100        self.template_id = ::std::option::Option::Some(input.into());
101        self
102    }
103    /// <p>A unique identifier for the template.</p>
104    pub fn set_template_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
105        self.template_id = input;
106        self
107    }
108    /// <p>A unique identifier for the template.</p>
109    pub fn get_template_id(&self) -> &::std::option::Option<::std::string::String> {
110        &self.template_id
111    }
112    /// <p>The name of the template. It must be unique per domain.</p>
113    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.name = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// <p>The name of the template. It must be unique per domain.</p>
118    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.name = input;
120        self
121    }
122    /// <p>The name of the template. It must be unique per domain.</p>
123    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
124        &self.name
125    }
126    /// <p>A brief description of the template.</p>
127    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.description = ::std::option::Option::Some(input.into());
129        self
130    }
131    /// <p>A brief description of the template.</p>
132    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.description = input;
134        self
135    }
136    /// <p>A brief description of the template.</p>
137    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
138        &self.description
139    }
140    /// <p>Configuration of layouts associated to the template.</p>
141    pub fn layout_configuration(mut self, input: crate::types::LayoutConfiguration) -> Self {
142        self.layout_configuration = ::std::option::Option::Some(input);
143        self
144    }
145    /// <p>Configuration of layouts associated to the template.</p>
146    pub fn set_layout_configuration(mut self, input: ::std::option::Option<crate::types::LayoutConfiguration>) -> Self {
147        self.layout_configuration = input;
148        self
149    }
150    /// <p>Configuration of layouts associated to the template.</p>
151    pub fn get_layout_configuration(&self) -> &::std::option::Option<crate::types::LayoutConfiguration> {
152        &self.layout_configuration
153    }
154    /// Appends an item to `required_fields`.
155    ///
156    /// To override the contents of this collection use [`set_required_fields`](Self::set_required_fields).
157    ///
158    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
159    pub fn required_fields(mut self, input: crate::types::RequiredField) -> Self {
160        let mut v = self.required_fields.unwrap_or_default();
161        v.push(input);
162        self.required_fields = ::std::option::Option::Some(v);
163        self
164    }
165    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
166    pub fn set_required_fields(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RequiredField>>) -> Self {
167        self.required_fields = input;
168        self
169    }
170    /// <p>A list of fields that must contain a value for a case to be successfully created with this template.</p>
171    pub fn get_required_fields(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RequiredField>> {
172        &self.required_fields
173    }
174    /// <p>The status of the template.</p>
175    pub fn status(mut self, input: crate::types::TemplateStatus) -> Self {
176        self.status = ::std::option::Option::Some(input);
177        self
178    }
179    /// <p>The status of the template.</p>
180    pub fn set_status(mut self, input: ::std::option::Option<crate::types::TemplateStatus>) -> Self {
181        self.status = input;
182        self
183    }
184    /// <p>The status of the template.</p>
185    pub fn get_status(&self) -> &::std::option::Option<crate::types::TemplateStatus> {
186        &self.status
187    }
188    /// Appends an item to `rules`.
189    ///
190    /// To override the contents of this collection use [`set_rules`](Self::set_rules).
191    ///
192    /// <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>
193    pub fn rules(mut self, input: crate::types::TemplateRule) -> Self {
194        let mut v = self.rules.unwrap_or_default();
195        v.push(input);
196        self.rules = ::std::option::Option::Some(v);
197        self
198    }
199    /// <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>
200    pub fn set_rules(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>>) -> Self {
201        self.rules = input;
202        self
203    }
204    /// <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>
205    pub fn get_rules(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::TemplateRule>> {
206        &self.rules
207    }
208    /// Consumes the builder and constructs a [`UpdateTemplateInput`](crate::operation::update_template::UpdateTemplateInput).
209    pub fn build(
210        self,
211    ) -> ::std::result::Result<crate::operation::update_template::UpdateTemplateInput, ::aws_smithy_types::error::operation::BuildError> {
212        ::std::result::Result::Ok(crate::operation::update_template::UpdateTemplateInput {
213            domain_id: self.domain_id,
214            template_id: self.template_id,
215            name: self.name,
216            description: self.description,
217            layout_configuration: self.layout_configuration,
218            required_fields: self.required_fields,
219            status: self.status,
220            rules: self.rules,
221        })
222    }
223}