aws_sdk_supportapp/operation/create_slack_channel_configuration/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::create_slack_channel_configuration::_create_slack_channel_configuration_output::CreateSlackChannelConfigurationOutputBuilder;
3
4pub use crate::operation::create_slack_channel_configuration::_create_slack_channel_configuration_input::CreateSlackChannelConfigurationInputBuilder;
5
6impl crate::operation::create_slack_channel_configuration::builders::CreateSlackChannelConfigurationInputBuilder {
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_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.create_slack_channel_configuration();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `CreateSlackChannelConfiguration`.
24///
25/// <p>Creates a Slack channel configuration for your Amazon Web Services account.</p><note>
26/// <ul>
27/// <li>
28/// <p>You can add up to 5 Slack workspaces for your account.</p></li>
29/// <li>
30/// <p>You can add up to 20 Slack channels for your account.</p></li>
31/// </ul>
32/// </note>
33/// <p>A Slack channel can have up to 100 Amazon Web Services accounts. This means that only 100 accounts can add the same Slack channel to the Amazon Web Services Support App. We recommend that you only add the accounts that you need to manage support cases for your organization. This can reduce the notifications about case updates that you receive in the Slack channel.</p><note>
34/// <p>We recommend that you choose a private Slack channel so that only members in that channel have read and write access to your support cases. Anyone in your Slack channel can create, update, or resolve support cases for your account. Users require an invitation to join private channels.</p>
35/// </note>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct CreateSlackChannelConfigurationFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::create_slack_channel_configuration::builders::CreateSlackChannelConfigurationInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
45        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
46    > for CreateSlackChannelConfigurationFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
54            crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl CreateSlackChannelConfigurationFluentBuilder {
61    /// Creates a new `CreateSlackChannelConfigurationFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the CreateSlackChannelConfiguration as a reference.
70    pub fn as_input(&self) -> &crate::operation::create_slack_channel_configuration::builders::CreateSlackChannelConfigurationInputBuilder {
71        &self.inner
72    }
73    /// Sends the request and returns the response.
74    ///
75    /// If an error occurs, an `SdkError` will be returned with additional details that
76    /// can be matched against.
77    ///
78    /// By default, any retryable failures will be retried twice. Retry behavior
79    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80    /// set when configuring the client.
81    pub async fn send(
82        self,
83    ) -> ::std::result::Result<
84        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
85        ::aws_smithy_runtime_api::client::result::SdkError<
86            crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
87            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88        >,
89    > {
90        let input = self
91            .inner
92            .build()
93            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94        let runtime_plugins = crate::operation::create_slack_channel_configuration::CreateSlackChannelConfiguration::operation_runtime_plugins(
95            self.handle.runtime_plugins.clone(),
96            &self.handle.conf,
97            self.config_override,
98        );
99        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfiguration::orchestrate(&runtime_plugins, input).await
100    }
101
102    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103    pub fn customize(
104        self,
105    ) -> crate::client::customize::CustomizableOperation<
106        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
107        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
108        Self,
109    > {
110        crate::client::customize::CustomizableOperation::new(self)
111    }
112    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113        self.set_config_override(::std::option::Option::Some(config_override.into()));
114        self
115    }
116
117    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118        self.config_override = config_override;
119        self
120    }
121    /// <p>The team ID in Slack. This ID uniquely identifies a Slack workspace, such as <code>T012ABCDEFG</code>.</p>
122    pub fn team_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
123        self.inner = self.inner.team_id(input.into());
124        self
125    }
126    /// <p>The team ID in Slack. This ID uniquely identifies a Slack workspace, such as <code>T012ABCDEFG</code>.</p>
127    pub fn set_team_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.inner = self.inner.set_team_id(input);
129        self
130    }
131    /// <p>The team ID in Slack. This ID uniquely identifies a Slack workspace, such as <code>T012ABCDEFG</code>.</p>
132    pub fn get_team_id(&self) -> &::std::option::Option<::std::string::String> {
133        self.inner.get_team_id()
134    }
135    /// <p>The channel ID in Slack. This ID identifies a channel within a Slack workspace.</p>
136    pub fn channel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
137        self.inner = self.inner.channel_id(input.into());
138        self
139    }
140    /// <p>The channel ID in Slack. This ID identifies a channel within a Slack workspace.</p>
141    pub fn set_channel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
142        self.inner = self.inner.set_channel_id(input);
143        self
144    }
145    /// <p>The channel ID in Slack. This ID identifies a channel within a Slack workspace.</p>
146    pub fn get_channel_id(&self) -> &::std::option::Option<::std::string::String> {
147        self.inner.get_channel_id()
148    }
149    /// <p>The name of the Slack channel that you configure for the Amazon Web Services Support App.</p>
150    pub fn channel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
151        self.inner = self.inner.channel_name(input.into());
152        self
153    }
154    /// <p>The name of the Slack channel that you configure for the Amazon Web Services Support App.</p>
155    pub fn set_channel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
156        self.inner = self.inner.set_channel_name(input);
157        self
158    }
159    /// <p>The name of the Slack channel that you configure for the Amazon Web Services Support App.</p>
160    pub fn get_channel_name(&self) -> &::std::option::Option<::std::string::String> {
161        self.inner.get_channel_name()
162    }
163    /// <p>Whether you want to get notified when a support case is created or reopened.</p>
164    pub fn notify_on_create_or_reopen_case(mut self, input: bool) -> Self {
165        self.inner = self.inner.notify_on_create_or_reopen_case(input);
166        self
167    }
168    /// <p>Whether you want to get notified when a support case is created or reopened.</p>
169    pub fn set_notify_on_create_or_reopen_case(mut self, input: ::std::option::Option<bool>) -> Self {
170        self.inner = self.inner.set_notify_on_create_or_reopen_case(input);
171        self
172    }
173    /// <p>Whether you want to get notified when a support case is created or reopened.</p>
174    pub fn get_notify_on_create_or_reopen_case(&self) -> &::std::option::Option<bool> {
175        self.inner.get_notify_on_create_or_reopen_case()
176    }
177    /// <p>Whether you want to get notified when a support case has a new correspondence.</p>
178    pub fn notify_on_add_correspondence_to_case(mut self, input: bool) -> Self {
179        self.inner = self.inner.notify_on_add_correspondence_to_case(input);
180        self
181    }
182    /// <p>Whether you want to get notified when a support case has a new correspondence.</p>
183    pub fn set_notify_on_add_correspondence_to_case(mut self, input: ::std::option::Option<bool>) -> Self {
184        self.inner = self.inner.set_notify_on_add_correspondence_to_case(input);
185        self
186    }
187    /// <p>Whether you want to get notified when a support case has a new correspondence.</p>
188    pub fn get_notify_on_add_correspondence_to_case(&self) -> &::std::option::Option<bool> {
189        self.inner.get_notify_on_add_correspondence_to_case()
190    }
191    /// <p>Whether you want to get notified when a support case is resolved.</p>
192    pub fn notify_on_resolve_case(mut self, input: bool) -> Self {
193        self.inner = self.inner.notify_on_resolve_case(input);
194        self
195    }
196    /// <p>Whether you want to get notified when a support case is resolved.</p>
197    pub fn set_notify_on_resolve_case(mut self, input: ::std::option::Option<bool>) -> Self {
198        self.inner = self.inner.set_notify_on_resolve_case(input);
199        self
200    }
201    /// <p>Whether you want to get notified when a support case is resolved.</p>
202    pub fn get_notify_on_resolve_case(&self) -> &::std::option::Option<bool> {
203        self.inner.get_notify_on_resolve_case()
204    }
205    /// <p>The case severity for a support case that you want to receive notifications.</p>
206    /// <p>If you specify <code>high</code> or <code>all</code>, you must specify <code>true</code> for at least one of the following parameters:</p>
207    /// <ul>
208    /// <li>
209    /// <p><code>notifyOnAddCorrespondenceToCase</code></p></li>
210    /// <li>
211    /// <p><code>notifyOnCreateOrReopenCase</code></p></li>
212    /// <li>
213    /// <p><code>notifyOnResolveCase</code></p></li>
214    /// </ul>
215    /// <p>If you specify <code>none</code>, the following parameters must be null or <code>false</code>:</p>
216    /// <ul>
217    /// <li>
218    /// <p><code>notifyOnAddCorrespondenceToCase</code></p></li>
219    /// <li>
220    /// <p><code>notifyOnCreateOrReopenCase</code></p></li>
221    /// <li>
222    /// <p><code>notifyOnResolveCase</code></p></li>
223    /// </ul><note>
224    /// <p>If you don't specify these parameters in your request, they default to <code>false</code>.</p>
225    /// </note>
226    pub fn notify_on_case_severity(mut self, input: crate::types::NotificationSeverityLevel) -> Self {
227        self.inner = self.inner.notify_on_case_severity(input);
228        self
229    }
230    /// <p>The case severity for a support case that you want to receive notifications.</p>
231    /// <p>If you specify <code>high</code> or <code>all</code>, you must specify <code>true</code> for at least one of the following parameters:</p>
232    /// <ul>
233    /// <li>
234    /// <p><code>notifyOnAddCorrespondenceToCase</code></p></li>
235    /// <li>
236    /// <p><code>notifyOnCreateOrReopenCase</code></p></li>
237    /// <li>
238    /// <p><code>notifyOnResolveCase</code></p></li>
239    /// </ul>
240    /// <p>If you specify <code>none</code>, the following parameters must be null or <code>false</code>:</p>
241    /// <ul>
242    /// <li>
243    /// <p><code>notifyOnAddCorrespondenceToCase</code></p></li>
244    /// <li>
245    /// <p><code>notifyOnCreateOrReopenCase</code></p></li>
246    /// <li>
247    /// <p><code>notifyOnResolveCase</code></p></li>
248    /// </ul><note>
249    /// <p>If you don't specify these parameters in your request, they default to <code>false</code>.</p>
250    /// </note>
251    pub fn set_notify_on_case_severity(mut self, input: ::std::option::Option<crate::types::NotificationSeverityLevel>) -> Self {
252        self.inner = self.inner.set_notify_on_case_severity(input);
253        self
254    }
255    /// <p>The case severity for a support case that you want to receive notifications.</p>
256    /// <p>If you specify <code>high</code> or <code>all</code>, you must specify <code>true</code> for at least one of the following parameters:</p>
257    /// <ul>
258    /// <li>
259    /// <p><code>notifyOnAddCorrespondenceToCase</code></p></li>
260    /// <li>
261    /// <p><code>notifyOnCreateOrReopenCase</code></p></li>
262    /// <li>
263    /// <p><code>notifyOnResolveCase</code></p></li>
264    /// </ul>
265    /// <p>If you specify <code>none</code>, the following parameters must be null or <code>false</code>:</p>
266    /// <ul>
267    /// <li>
268    /// <p><code>notifyOnAddCorrespondenceToCase</code></p></li>
269    /// <li>
270    /// <p><code>notifyOnCreateOrReopenCase</code></p></li>
271    /// <li>
272    /// <p><code>notifyOnResolveCase</code></p></li>
273    /// </ul><note>
274    /// <p>If you don't specify these parameters in your request, they default to <code>false</code>.</p>
275    /// </note>
276    pub fn get_notify_on_case_severity(&self) -> &::std::option::Option<crate::types::NotificationSeverityLevel> {
277        self.inner.get_notify_on_case_severity()
278    }
279    /// <p>The Amazon Resource Name (ARN) of an IAM role that you want to use to perform operations on Amazon Web Services. For more information, see <a href="https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html">Managing access to the Amazon Web Services Support App</a> in the <i>Amazon Web Services Support User Guide</i>.</p>
280    pub fn channel_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
281        self.inner = self.inner.channel_role_arn(input.into());
282        self
283    }
284    /// <p>The Amazon Resource Name (ARN) of an IAM role that you want to use to perform operations on Amazon Web Services. For more information, see <a href="https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html">Managing access to the Amazon Web Services Support App</a> in the <i>Amazon Web Services Support User Guide</i>.</p>
285    pub fn set_channel_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
286        self.inner = self.inner.set_channel_role_arn(input);
287        self
288    }
289    /// <p>The Amazon Resource Name (ARN) of an IAM role that you want to use to perform operations on Amazon Web Services. For more information, see <a href="https://docs.aws.amazon.com/awssupport/latest/user/support-app-permissions.html">Managing access to the Amazon Web Services Support App</a> in the <i>Amazon Web Services Support User Guide</i>.</p>
290    pub fn get_channel_role_arn(&self) -> &::std::option::Option<::std::string::String> {
291        self.inner.get_channel_role_arn()
292    }
293}