aws_sdk_connectcampaignsv2/operation/create_campaign/
_create_campaign_input.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2
3/// The request for CreateCampaign API.
4#[non_exhaustive]
5#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
6pub struct CreateCampaignInput {
7    /// The name of an Amazon Connect Campaign name.
8    pub name: ::std::option::Option<::std::string::String>,
9    /// Amazon Connect Instance Id
10    pub connect_instance_id: ::std::option::Option<::std::string::String>,
11    /// Campaign Channel Subtype config
12    pub channel_subtype_config: ::std::option::Option<crate::types::ChannelSubtypeConfig>,
13    /// The type of campaign externally exposed in APIs.
14    pub r#type: ::std::option::Option<crate::types::ExternalCampaignType>,
15    /// Source of the campaign
16    pub source: ::std::option::Option<crate::types::Source>,
17    /// Amazon Resource Names(ARN)
18    pub connect_campaign_flow_arn: ::std::option::Option<::std::string::String>,
19    /// Campaign schedule
20    pub schedule: ::std::option::Option<crate::types::Schedule>,
21    /// Campaign communication time config
22    pub communication_time_config: ::std::option::Option<crate::types::CommunicationTimeConfig>,
23    /// Communication limits config
24    pub communication_limits_override: ::std::option::Option<crate::types::CommunicationLimitsConfig>,
25    /// Tag map with key and value.
26    pub tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
27}
28impl CreateCampaignInput {
29    /// The name of an Amazon Connect Campaign name.
30    pub fn name(&self) -> ::std::option::Option<&str> {
31        self.name.as_deref()
32    }
33    /// Amazon Connect Instance Id
34    pub fn connect_instance_id(&self) -> ::std::option::Option<&str> {
35        self.connect_instance_id.as_deref()
36    }
37    /// Campaign Channel Subtype config
38    pub fn channel_subtype_config(&self) -> ::std::option::Option<&crate::types::ChannelSubtypeConfig> {
39        self.channel_subtype_config.as_ref()
40    }
41    /// The type of campaign externally exposed in APIs.
42    pub fn r#type(&self) -> ::std::option::Option<&crate::types::ExternalCampaignType> {
43        self.r#type.as_ref()
44    }
45    /// Source of the campaign
46    pub fn source(&self) -> ::std::option::Option<&crate::types::Source> {
47        self.source.as_ref()
48    }
49    /// Amazon Resource Names(ARN)
50    pub fn connect_campaign_flow_arn(&self) -> ::std::option::Option<&str> {
51        self.connect_campaign_flow_arn.as_deref()
52    }
53    /// Campaign schedule
54    pub fn schedule(&self) -> ::std::option::Option<&crate::types::Schedule> {
55        self.schedule.as_ref()
56    }
57    /// Campaign communication time config
58    pub fn communication_time_config(&self) -> ::std::option::Option<&crate::types::CommunicationTimeConfig> {
59        self.communication_time_config.as_ref()
60    }
61    /// Communication limits config
62    pub fn communication_limits_override(&self) -> ::std::option::Option<&crate::types::CommunicationLimitsConfig> {
63        self.communication_limits_override.as_ref()
64    }
65    /// Tag map with key and value.
66    pub fn tags(&self) -> ::std::option::Option<&::std::collections::HashMap<::std::string::String, ::std::string::String>> {
67        self.tags.as_ref()
68    }
69}
70impl CreateCampaignInput {
71    /// Creates a new builder-style object to manufacture [`CreateCampaignInput`](crate::operation::create_campaign::CreateCampaignInput).
72    pub fn builder() -> crate::operation::create_campaign::builders::CreateCampaignInputBuilder {
73        crate::operation::create_campaign::builders::CreateCampaignInputBuilder::default()
74    }
75}
76
77/// A builder for [`CreateCampaignInput`](crate::operation::create_campaign::CreateCampaignInput).
78#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
79#[non_exhaustive]
80pub struct CreateCampaignInputBuilder {
81    pub(crate) name: ::std::option::Option<::std::string::String>,
82    pub(crate) connect_instance_id: ::std::option::Option<::std::string::String>,
83    pub(crate) channel_subtype_config: ::std::option::Option<crate::types::ChannelSubtypeConfig>,
84    pub(crate) r#type: ::std::option::Option<crate::types::ExternalCampaignType>,
85    pub(crate) source: ::std::option::Option<crate::types::Source>,
86    pub(crate) connect_campaign_flow_arn: ::std::option::Option<::std::string::String>,
87    pub(crate) schedule: ::std::option::Option<crate::types::Schedule>,
88    pub(crate) communication_time_config: ::std::option::Option<crate::types::CommunicationTimeConfig>,
89    pub(crate) communication_limits_override: ::std::option::Option<crate::types::CommunicationLimitsConfig>,
90    pub(crate) tags: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
91}
92impl CreateCampaignInputBuilder {
93    /// The name of an Amazon Connect Campaign name.
94    /// This field is required.
95    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
96        self.name = ::std::option::Option::Some(input.into());
97        self
98    }
99    /// The name of an Amazon Connect Campaign name.
100    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
101        self.name = input;
102        self
103    }
104    /// The name of an Amazon Connect Campaign name.
105    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
106        &self.name
107    }
108    /// Amazon Connect Instance Id
109    /// This field is required.
110    pub fn connect_instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
111        self.connect_instance_id = ::std::option::Option::Some(input.into());
112        self
113    }
114    /// Amazon Connect Instance Id
115    pub fn set_connect_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
116        self.connect_instance_id = input;
117        self
118    }
119    /// Amazon Connect Instance Id
120    pub fn get_connect_instance_id(&self) -> &::std::option::Option<::std::string::String> {
121        &self.connect_instance_id
122    }
123    /// Campaign Channel Subtype config
124    pub fn channel_subtype_config(mut self, input: crate::types::ChannelSubtypeConfig) -> Self {
125        self.channel_subtype_config = ::std::option::Option::Some(input);
126        self
127    }
128    /// Campaign Channel Subtype config
129    pub fn set_channel_subtype_config(mut self, input: ::std::option::Option<crate::types::ChannelSubtypeConfig>) -> Self {
130        self.channel_subtype_config = input;
131        self
132    }
133    /// Campaign Channel Subtype config
134    pub fn get_channel_subtype_config(&self) -> &::std::option::Option<crate::types::ChannelSubtypeConfig> {
135        &self.channel_subtype_config
136    }
137    /// The type of campaign externally exposed in APIs.
138    pub fn r#type(mut self, input: crate::types::ExternalCampaignType) -> Self {
139        self.r#type = ::std::option::Option::Some(input);
140        self
141    }
142    /// The type of campaign externally exposed in APIs.
143    pub fn set_type(mut self, input: ::std::option::Option<crate::types::ExternalCampaignType>) -> Self {
144        self.r#type = input;
145        self
146    }
147    /// The type of campaign externally exposed in APIs.
148    pub fn get_type(&self) -> &::std::option::Option<crate::types::ExternalCampaignType> {
149        &self.r#type
150    }
151    /// Source of the campaign
152    pub fn source(mut self, input: crate::types::Source) -> Self {
153        self.source = ::std::option::Option::Some(input);
154        self
155    }
156    /// Source of the campaign
157    pub fn set_source(mut self, input: ::std::option::Option<crate::types::Source>) -> Self {
158        self.source = input;
159        self
160    }
161    /// Source of the campaign
162    pub fn get_source(&self) -> &::std::option::Option<crate::types::Source> {
163        &self.source
164    }
165    /// Amazon Resource Names(ARN)
166    pub fn connect_campaign_flow_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.connect_campaign_flow_arn = ::std::option::Option::Some(input.into());
168        self
169    }
170    /// Amazon Resource Names(ARN)
171    pub fn set_connect_campaign_flow_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.connect_campaign_flow_arn = input;
173        self
174    }
175    /// Amazon Resource Names(ARN)
176    pub fn get_connect_campaign_flow_arn(&self) -> &::std::option::Option<::std::string::String> {
177        &self.connect_campaign_flow_arn
178    }
179    /// Campaign schedule
180    pub fn schedule(mut self, input: crate::types::Schedule) -> Self {
181        self.schedule = ::std::option::Option::Some(input);
182        self
183    }
184    /// Campaign schedule
185    pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::Schedule>) -> Self {
186        self.schedule = input;
187        self
188    }
189    /// Campaign schedule
190    pub fn get_schedule(&self) -> &::std::option::Option<crate::types::Schedule> {
191        &self.schedule
192    }
193    /// Campaign communication time config
194    pub fn communication_time_config(mut self, input: crate::types::CommunicationTimeConfig) -> Self {
195        self.communication_time_config = ::std::option::Option::Some(input);
196        self
197    }
198    /// Campaign communication time config
199    pub fn set_communication_time_config(mut self, input: ::std::option::Option<crate::types::CommunicationTimeConfig>) -> Self {
200        self.communication_time_config = input;
201        self
202    }
203    /// Campaign communication time config
204    pub fn get_communication_time_config(&self) -> &::std::option::Option<crate::types::CommunicationTimeConfig> {
205        &self.communication_time_config
206    }
207    /// Communication limits config
208    pub fn communication_limits_override(mut self, input: crate::types::CommunicationLimitsConfig) -> Self {
209        self.communication_limits_override = ::std::option::Option::Some(input);
210        self
211    }
212    /// Communication limits config
213    pub fn set_communication_limits_override(mut self, input: ::std::option::Option<crate::types::CommunicationLimitsConfig>) -> Self {
214        self.communication_limits_override = input;
215        self
216    }
217    /// Communication limits config
218    pub fn get_communication_limits_override(&self) -> &::std::option::Option<crate::types::CommunicationLimitsConfig> {
219        &self.communication_limits_override
220    }
221    /// Adds a key-value pair to `tags`.
222    ///
223    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
224    ///
225    /// Tag map with key and value.
226    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
227        let mut hash_map = self.tags.unwrap_or_default();
228        hash_map.insert(k.into(), v.into());
229        self.tags = ::std::option::Option::Some(hash_map);
230        self
231    }
232    /// Tag map with key and value.
233    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
234        self.tags = input;
235        self
236    }
237    /// Tag map with key and value.
238    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
239        &self.tags
240    }
241    /// Consumes the builder and constructs a [`CreateCampaignInput`](crate::operation::create_campaign::CreateCampaignInput).
242    pub fn build(
243        self,
244    ) -> ::std::result::Result<crate::operation::create_campaign::CreateCampaignInput, ::aws_smithy_types::error::operation::BuildError> {
245        ::std::result::Result::Ok(crate::operation::create_campaign::CreateCampaignInput {
246            name: self.name,
247            connect_instance_id: self.connect_instance_id,
248            channel_subtype_config: self.channel_subtype_config,
249            r#type: self.r#type,
250            source: self.source,
251            connect_campaign_flow_arn: self.connect_campaign_flow_arn,
252            schedule: self.schedule,
253            communication_time_config: self.communication_time_config,
254            communication_limits_override: self.communication_limits_override,
255            tags: self.tags,
256        })
257    }
258}