aws_sdk_connect/operation/update_rule/
_update_rule_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 UpdateRuleInput {
6    /// <p>A unique identifier for the rule.</p>
7    pub rule_id: ::std::option::Option<::std::string::String>,
8    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
9    pub instance_id: ::std::option::Option<::std::string::String>,
10    /// <p>The name of the rule. You can change the name only if <code>TriggerEventSource</code> is one of the following values: <code>OnZendeskTicketCreate</code> | <code>OnZendeskTicketStatusUpdate</code> | <code>OnSalesforceCaseCreate</code></p>
11    pub name: ::std::option::Option<::std::string::String>,
12    /// <p>The conditions of the rule.</p>
13    pub function: ::std::option::Option<::std::string::String>,
14    /// <p>A list of actions to be run when the rule is triggered.</p>
15    pub actions: ::std::option::Option<::std::vec::Vec<crate::types::RuleAction>>,
16    /// <p>The publish status of the rule.</p>
17    pub publish_status: ::std::option::Option<crate::types::RulePublishStatus>,
18}
19impl UpdateRuleInput {
20    /// <p>A unique identifier for the rule.</p>
21    pub fn rule_id(&self) -> ::std::option::Option<&str> {
22        self.rule_id.as_deref()
23    }
24    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
25    pub fn instance_id(&self) -> ::std::option::Option<&str> {
26        self.instance_id.as_deref()
27    }
28    /// <p>The name of the rule. You can change the name only if <code>TriggerEventSource</code> is one of the following values: <code>OnZendeskTicketCreate</code> | <code>OnZendeskTicketStatusUpdate</code> | <code>OnSalesforceCaseCreate</code></p>
29    pub fn name(&self) -> ::std::option::Option<&str> {
30        self.name.as_deref()
31    }
32    /// <p>The conditions of the rule.</p>
33    pub fn function(&self) -> ::std::option::Option<&str> {
34        self.function.as_deref()
35    }
36    /// <p>A list of actions to be run when the rule is triggered.</p>
37    ///
38    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.actions.is_none()`.
39    pub fn actions(&self) -> &[crate::types::RuleAction] {
40        self.actions.as_deref().unwrap_or_default()
41    }
42    /// <p>The publish status of the rule.</p>
43    pub fn publish_status(&self) -> ::std::option::Option<&crate::types::RulePublishStatus> {
44        self.publish_status.as_ref()
45    }
46}
47impl UpdateRuleInput {
48    /// Creates a new builder-style object to manufacture [`UpdateRuleInput`](crate::operation::update_rule::UpdateRuleInput).
49    pub fn builder() -> crate::operation::update_rule::builders::UpdateRuleInputBuilder {
50        crate::operation::update_rule::builders::UpdateRuleInputBuilder::default()
51    }
52}
53
54/// A builder for [`UpdateRuleInput`](crate::operation::update_rule::UpdateRuleInput).
55#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
56#[non_exhaustive]
57pub struct UpdateRuleInputBuilder {
58    pub(crate) rule_id: ::std::option::Option<::std::string::String>,
59    pub(crate) instance_id: ::std::option::Option<::std::string::String>,
60    pub(crate) name: ::std::option::Option<::std::string::String>,
61    pub(crate) function: ::std::option::Option<::std::string::String>,
62    pub(crate) actions: ::std::option::Option<::std::vec::Vec<crate::types::RuleAction>>,
63    pub(crate) publish_status: ::std::option::Option<crate::types::RulePublishStatus>,
64}
65impl UpdateRuleInputBuilder {
66    /// <p>A unique identifier for the rule.</p>
67    /// This field is required.
68    pub fn rule_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
69        self.rule_id = ::std::option::Option::Some(input.into());
70        self
71    }
72    /// <p>A unique identifier for the rule.</p>
73    pub fn set_rule_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
74        self.rule_id = input;
75        self
76    }
77    /// <p>A unique identifier for the rule.</p>
78    pub fn get_rule_id(&self) -> &::std::option::Option<::std::string::String> {
79        &self.rule_id
80    }
81    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
82    /// This field is required.
83    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
84        self.instance_id = ::std::option::Option::Some(input.into());
85        self
86    }
87    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
88    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
89        self.instance_id = input;
90        self
91    }
92    /// <p>The identifier of the Amazon Connect instance. You can <a href="https://docs.aws.amazon.com/connect/latest/adminguide/find-instance-arn.html">find the instance ID</a> in the Amazon Resource Name (ARN) of the instance.</p>
93    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
94        &self.instance_id
95    }
96    /// <p>The name of the rule. You can change the name only if <code>TriggerEventSource</code> is one of the following values: <code>OnZendeskTicketCreate</code> | <code>OnZendeskTicketStatusUpdate</code> | <code>OnSalesforceCaseCreate</code></p>
97    /// This field is required.
98    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
99        self.name = ::std::option::Option::Some(input.into());
100        self
101    }
102    /// <p>The name of the rule. You can change the name only if <code>TriggerEventSource</code> is one of the following values: <code>OnZendeskTicketCreate</code> | <code>OnZendeskTicketStatusUpdate</code> | <code>OnSalesforceCaseCreate</code></p>
103    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
104        self.name = input;
105        self
106    }
107    /// <p>The name of the rule. You can change the name only if <code>TriggerEventSource</code> is one of the following values: <code>OnZendeskTicketCreate</code> | <code>OnZendeskTicketStatusUpdate</code> | <code>OnSalesforceCaseCreate</code></p>
108    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
109        &self.name
110    }
111    /// <p>The conditions of the rule.</p>
112    /// This field is required.
113    pub fn function(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.function = ::std::option::Option::Some(input.into());
115        self
116    }
117    /// <p>The conditions of the rule.</p>
118    pub fn set_function(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.function = input;
120        self
121    }
122    /// <p>The conditions of the rule.</p>
123    pub fn get_function(&self) -> &::std::option::Option<::std::string::String> {
124        &self.function
125    }
126    /// Appends an item to `actions`.
127    ///
128    /// To override the contents of this collection use [`set_actions`](Self::set_actions).
129    ///
130    /// <p>A list of actions to be run when the rule is triggered.</p>
131    pub fn actions(mut self, input: crate::types::RuleAction) -> Self {
132        let mut v = self.actions.unwrap_or_default();
133        v.push(input);
134        self.actions = ::std::option::Option::Some(v);
135        self
136    }
137    /// <p>A list of actions to be run when the rule is triggered.</p>
138    pub fn set_actions(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::RuleAction>>) -> Self {
139        self.actions = input;
140        self
141    }
142    /// <p>A list of actions to be run when the rule is triggered.</p>
143    pub fn get_actions(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::RuleAction>> {
144        &self.actions
145    }
146    /// <p>The publish status of the rule.</p>
147    /// This field is required.
148    pub fn publish_status(mut self, input: crate::types::RulePublishStatus) -> Self {
149        self.publish_status = ::std::option::Option::Some(input);
150        self
151    }
152    /// <p>The publish status of the rule.</p>
153    pub fn set_publish_status(mut self, input: ::std::option::Option<crate::types::RulePublishStatus>) -> Self {
154        self.publish_status = input;
155        self
156    }
157    /// <p>The publish status of the rule.</p>
158    pub fn get_publish_status(&self) -> &::std::option::Option<crate::types::RulePublishStatus> {
159        &self.publish_status
160    }
161    /// Consumes the builder and constructs a [`UpdateRuleInput`](crate::operation::update_rule::UpdateRuleInput).
162    pub fn build(self) -> ::std::result::Result<crate::operation::update_rule::UpdateRuleInput, ::aws_smithy_types::error::operation::BuildError> {
163        ::std::result::Result::Ok(crate::operation::update_rule::UpdateRuleInput {
164            rule_id: self.rule_id,
165            instance_id: self.instance_id,
166            name: self.name,
167            function: self.function,
168            actions: self.actions,
169            publish_status: self.publish_status,
170        })
171    }
172}