aws_sdk_connect/operation/create_queue/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_queue::_create_queue_output::CreateQueueOutputBuilder;
3
4pub use crate::operation::create_queue::_create_queue_input::CreateQueueInputBuilder;
5
6impl crate::operation::create_queue::builders::CreateQueueInputBuilder {
7    /// Sends a request with this input using the given client.
8    pub async fn send_with(
9        self,
10        client: &crate::Client,
11    ) -> ::std::result::Result<
12        crate::operation::create_queue::CreateQueueOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_queue::CreateQueueError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_queue();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateQueue`.
24///
25/// <p>Creates a new queue for the specified Amazon Connect instance.</p><important>
26/// <ul>
27/// <li>
28/// <p>If the phone number is claimed to a traffic distribution group that was created in the same Region as the Amazon Connect instance where you are calling this API, then you can use a full phone number ARN or a UUID for <code>OutboundCallerIdNumberId</code>. However, if the phone number is claimed to a traffic distribution group that is in one Region, and you are calling this API from an instance in another Amazon Web Services Region that is associated with the traffic distribution group, you must provide a full phone number ARN. If a UUID is provided in this scenario, you will receive a <code>ResourceNotFoundException</code>.</p></li>
29/// <li>
30/// <p>Only use the phone number ARN format that doesn't contain <code>instance</code> in the path, for example, <code>arn:aws:connect:us-east-1:1234567890:phone-number/uuid</code>. This is the same ARN format that is returned when you call the <a href="https://docs.aws.amazon.com/connect/latest/APIReference/API_ListPhoneNumbersV2.html">ListPhoneNumbersV2</a> API.</p></li>
31/// <li>
32/// <p>If you plan to use IAM policies to allow/deny access to this API for phone number resources claimed to a traffic distribution group, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/security_iam_resource-level-policy-examples.html#allow-deny-queue-actions-replica-region">Allow or Deny queue API actions for phone numbers in a replica Region</a>.</p></li>
33/// </ul>
34/// </important>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct CreateQueueFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::create_queue::builders::CreateQueueInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::create_queue::CreateQueueOutput,
44        crate::operation::create_queue::CreateQueueError,
45    > for CreateQueueFluentBuilder
46{
47    fn send(
48        self,
49        config_override: crate::config::Builder,
50    ) -> crate::client::customize::internal::BoxFuture<
51        crate::client::customize::internal::SendResult<
52            crate::operation::create_queue::CreateQueueOutput,
53            crate::operation::create_queue::CreateQueueError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl CreateQueueFluentBuilder {
60    /// Creates a new `CreateQueueFluentBuilder`.
61    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
62        Self {
63            handle,
64            inner: ::std::default::Default::default(),
65            config_override: ::std::option::Option::None,
66        }
67    }
68    /// Access the CreateQueue as a reference.
69    pub fn as_input(&self) -> &crate::operation::create_queue::builders::CreateQueueInputBuilder {
70        &self.inner
71    }
72    /// Sends the request and returns the response.
73    ///
74    /// If an error occurs, an `SdkError` will be returned with additional details that
75    /// can be matched against.
76    ///
77    /// By default, any retryable failures will be retried twice. Retry behavior
78    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
79    /// set when configuring the client.
80    pub async fn send(
81        self,
82    ) -> ::std::result::Result<
83        crate::operation::create_queue::CreateQueueOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::create_queue::CreateQueueError,
86            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
87        >,
88    > {
89        let input = self
90            .inner
91            .build()
92            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
93        let runtime_plugins = crate::operation::create_queue::CreateQueue::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::create_queue::CreateQueue::orchestrate(&runtime_plugins, input).await
99    }
100
101    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
102    pub fn customize(
103        self,
104    ) -> crate::client::customize::CustomizableOperation<
105        crate::operation::create_queue::CreateQueueOutput,
106        crate::operation::create_queue::CreateQueueError,
107        Self,
108    > {
109        crate::client::customize::CustomizableOperation::new(self)
110    }
111    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
112        self.set_config_override(::std::option::Option::Some(config_override.into()));
113        self
114    }
115
116    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
117        self.config_override = config_override;
118        self
119    }
120    /// <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>
121    pub fn instance_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
122        self.inner = self.inner.instance_id(input.into());
123        self
124    }
125    /// <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>
126    pub fn set_instance_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
127        self.inner = self.inner.set_instance_id(input);
128        self
129    }
130    /// <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>
131    pub fn get_instance_id(&self) -> &::std::option::Option<::std::string::String> {
132        self.inner.get_instance_id()
133    }
134    /// <p>The name of the queue.</p>
135    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
136        self.inner = self.inner.name(input.into());
137        self
138    }
139    /// <p>The name of the queue.</p>
140    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
141        self.inner = self.inner.set_name(input);
142        self
143    }
144    /// <p>The name of the queue.</p>
145    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
146        self.inner.get_name()
147    }
148    /// <p>The description of the queue.</p>
149    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
150        self.inner = self.inner.description(input.into());
151        self
152    }
153    /// <p>The description of the queue.</p>
154    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
155        self.inner = self.inner.set_description(input);
156        self
157    }
158    /// <p>The description of the queue.</p>
159    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
160        self.inner.get_description()
161    }
162    /// <p>The outbound caller ID name, number, and outbound whisper flow.</p>
163    pub fn outbound_caller_config(mut self, input: crate::types::OutboundCallerConfig) -> Self {
164        self.inner = self.inner.outbound_caller_config(input);
165        self
166    }
167    /// <p>The outbound caller ID name, number, and outbound whisper flow.</p>
168    pub fn set_outbound_caller_config(mut self, input: ::std::option::Option<crate::types::OutboundCallerConfig>) -> Self {
169        self.inner = self.inner.set_outbound_caller_config(input);
170        self
171    }
172    /// <p>The outbound caller ID name, number, and outbound whisper flow.</p>
173    pub fn get_outbound_caller_config(&self) -> &::std::option::Option<crate::types::OutboundCallerConfig> {
174        self.inner.get_outbound_caller_config()
175    }
176    /// <p>The outbound email address ID for a specified queue.</p>
177    pub fn outbound_email_config(mut self, input: crate::types::OutboundEmailConfig) -> Self {
178        self.inner = self.inner.outbound_email_config(input);
179        self
180    }
181    /// <p>The outbound email address ID for a specified queue.</p>
182    pub fn set_outbound_email_config(mut self, input: ::std::option::Option<crate::types::OutboundEmailConfig>) -> Self {
183        self.inner = self.inner.set_outbound_email_config(input);
184        self
185    }
186    /// <p>The outbound email address ID for a specified queue.</p>
187    pub fn get_outbound_email_config(&self) -> &::std::option::Option<crate::types::OutboundEmailConfig> {
188        self.inner.get_outbound_email_config()
189    }
190    /// <p>The identifier for the hours of operation.</p>
191    pub fn hours_of_operation_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
192        self.inner = self.inner.hours_of_operation_id(input.into());
193        self
194    }
195    /// <p>The identifier for the hours of operation.</p>
196    pub fn set_hours_of_operation_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
197        self.inner = self.inner.set_hours_of_operation_id(input);
198        self
199    }
200    /// <p>The identifier for the hours of operation.</p>
201    pub fn get_hours_of_operation_id(&self) -> &::std::option::Option<::std::string::String> {
202        self.inner.get_hours_of_operation_id()
203    }
204    /// <p>The maximum number of contacts that can be in the queue before it is considered full.</p>
205    pub fn max_contacts(mut self, input: i32) -> Self {
206        self.inner = self.inner.max_contacts(input);
207        self
208    }
209    /// <p>The maximum number of contacts that can be in the queue before it is considered full.</p>
210    pub fn set_max_contacts(mut self, input: ::std::option::Option<i32>) -> Self {
211        self.inner = self.inner.set_max_contacts(input);
212        self
213    }
214    /// <p>The maximum number of contacts that can be in the queue before it is considered full.</p>
215    pub fn get_max_contacts(&self) -> &::std::option::Option<i32> {
216        self.inner.get_max_contacts()
217    }
218    ///
219    /// Appends an item to `QuickConnectIds`.
220    ///
221    /// To override the contents of this collection use [`set_quick_connect_ids`](Self::set_quick_connect_ids).
222    ///
223    /// <p>The quick connects available to agents who are working the queue.</p>
224    pub fn quick_connect_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
225        self.inner = self.inner.quick_connect_ids(input.into());
226        self
227    }
228    /// <p>The quick connects available to agents who are working the queue.</p>
229    pub fn set_quick_connect_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
230        self.inner = self.inner.set_quick_connect_ids(input);
231        self
232    }
233    /// <p>The quick connects available to agents who are working the queue.</p>
234    pub fn get_quick_connect_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
235        self.inner.get_quick_connect_ids()
236    }
237    ///
238    /// Adds a key-value pair to `Tags`.
239    ///
240    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
241    ///
242    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
243    pub fn tags(mut self, k: impl ::std::convert::Into<::std::string::String>, v: impl ::std::convert::Into<::std::string::String>) -> Self {
244        self.inner = self.inner.tags(k.into(), v.into());
245        self
246    }
247    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
248    pub fn set_tags(mut self, input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>) -> Self {
249        self.inner = self.inner.set_tags(input);
250        self
251    }
252    /// <p>The tags used to organize, track, or control access for this resource. For example, { "Tags": {"key1":"value1", "key2":"value2"} }.</p>
253    pub fn get_tags(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
254        self.inner.get_tags()
255    }
256}