aws_sdk_chatbot/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 an AWS Chatbot confugration for Slack.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct CreateSlackChannelConfigurationFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::create_slack_channel_configuration::builders::CreateSlackChannelConfigurationInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
35        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
36    > for CreateSlackChannelConfigurationFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
44            crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl CreateSlackChannelConfigurationFluentBuilder {
51    /// Creates a new `CreateSlackChannelConfigurationFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the CreateSlackChannelConfiguration as a reference.
60    pub fn as_input(&self) -> &crate::operation::create_slack_channel_configuration::builders::CreateSlackChannelConfigurationInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::create_slack_channel_configuration::CreateSlackChannelConfiguration::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfiguration::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationOutput,
97        crate::operation::create_slack_channel_configuration::CreateSlackChannelConfigurationError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// <p>The ID of the Slack workspace authorized with AWS Chatbot.</p>
112    pub fn slack_team_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113        self.inner = self.inner.slack_team_id(input.into());
114        self
115    }
116    /// <p>The ID of the Slack workspace authorized with AWS Chatbot.</p>
117    pub fn set_slack_team_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118        self.inner = self.inner.set_slack_team_id(input);
119        self
120    }
121    /// <p>The ID of the Slack workspace authorized with AWS Chatbot.</p>
122    pub fn get_slack_team_id(&self) -> &::std::option::Option<::std::string::String> {
123        self.inner.get_slack_team_id()
124    }
125    /// <p>The ID of the Slack channel.</p>
126    /// <p>To get this ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.</p>
127    pub fn slack_channel_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.slack_channel_id(input.into());
129        self
130    }
131    /// <p>The ID of the Slack channel.</p>
132    /// <p>To get this ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.</p>
133    pub fn set_slack_channel_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134        self.inner = self.inner.set_slack_channel_id(input);
135        self
136    }
137    /// <p>The ID of the Slack channel.</p>
138    /// <p>To get this ID, open Slack, right click on the channel name in the left pane, then choose Copy Link. The channel ID is the 9-character string at the end of the URL. For example, ABCBBLZZZ.</p>
139    pub fn get_slack_channel_id(&self) -> &::std::option::Option<::std::string::String> {
140        self.inner.get_slack_channel_id()
141    }
142    /// <p>The name of the Slack channel.</p>
143    pub fn slack_channel_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.slack_channel_name(input.into());
145        self
146    }
147    /// <p>The name of the Slack channel.</p>
148    pub fn set_slack_channel_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_slack_channel_name(input);
150        self
151    }
152    /// <p>The name of the Slack channel.</p>
153    pub fn get_slack_channel_name(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_slack_channel_name()
155    }
156    ///
157    /// Appends an item to `SnsTopicArns`.
158    ///
159    /// To override the contents of this collection use [`set_sns_topic_arns`](Self::set_sns_topic_arns).
160    ///
161    /// <p>The Amazon Resource Names (ARNs) of the SNS topics that deliver notifications to AWS Chatbot.</p>
162    pub fn sns_topic_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.sns_topic_arns(input.into());
164        self
165    }
166    /// <p>The Amazon Resource Names (ARNs) of the SNS topics that deliver notifications to AWS Chatbot.</p>
167    pub fn set_sns_topic_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
168        self.inner = self.inner.set_sns_topic_arns(input);
169        self
170    }
171    /// <p>The Amazon Resource Names (ARNs) of the SNS topics that deliver notifications to AWS Chatbot.</p>
172    pub fn get_sns_topic_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
173        self.inner.get_sns_topic_arns()
174    }
175    /// <p>A user-defined role that AWS Chatbot assumes. This is not the service-linked role.</p>
176    /// <p>For more information, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/chatbot-iam-policies.html">IAM policies for AWS Chatbot</a> in the <i> AWS Chatbot Administrator Guide</i>.</p>
177    pub fn iam_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.iam_role_arn(input.into());
179        self
180    }
181    /// <p>A user-defined role that AWS Chatbot assumes. This is not the service-linked role.</p>
182    /// <p>For more information, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/chatbot-iam-policies.html">IAM policies for AWS Chatbot</a> in the <i> AWS Chatbot Administrator Guide</i>.</p>
183    pub fn set_iam_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
184        self.inner = self.inner.set_iam_role_arn(input);
185        self
186    }
187    /// <p>A user-defined role that AWS Chatbot assumes. This is not the service-linked role.</p>
188    /// <p>For more information, see <a href="https://docs.aws.amazon.com/chatbot/latest/adminguide/chatbot-iam-policies.html">IAM policies for AWS Chatbot</a> in the <i> AWS Chatbot Administrator Guide</i>.</p>
189    pub fn get_iam_role_arn(&self) -> &::std::option::Option<::std::string::String> {
190        self.inner.get_iam_role_arn()
191    }
192    /// <p>The name of the configuration.</p>
193    pub fn configuration_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.inner = self.inner.configuration_name(input.into());
195        self
196    }
197    /// <p>The name of the configuration.</p>
198    pub fn set_configuration_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.inner = self.inner.set_configuration_name(input);
200        self
201    }
202    /// <p>The name of the configuration.</p>
203    pub fn get_configuration_name(&self) -> &::std::option::Option<::std::string::String> {
204        self.inner.get_configuration_name()
205    }
206    /// <p>Logging levels include <code>ERROR</code>, <code>INFO</code>, or <code>NONE</code>.</p>
207    pub fn logging_level(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.logging_level(input.into());
209        self
210    }
211    /// <p>Logging levels include <code>ERROR</code>, <code>INFO</code>, or <code>NONE</code>.</p>
212    pub fn set_logging_level(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_logging_level(input);
214        self
215    }
216    /// <p>Logging levels include <code>ERROR</code>, <code>INFO</code>, or <code>NONE</code>.</p>
217    pub fn get_logging_level(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_logging_level()
219    }
220    ///
221    /// Appends an item to `GuardrailPolicyArns`.
222    ///
223    /// To override the contents of this collection use [`set_guardrail_policy_arns`](Self::set_guardrail_policy_arns).
224    ///
225    /// <p>The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed <code>AdministratorAccess</code> policy is applied by default if this is not set.</p>
226    pub fn guardrail_policy_arns(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
227        self.inner = self.inner.guardrail_policy_arns(input.into());
228        self
229    }
230    /// <p>The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed <code>AdministratorAccess</code> policy is applied by default if this is not set.</p>
231    pub fn set_guardrail_policy_arns(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
232        self.inner = self.inner.set_guardrail_policy_arns(input);
233        self
234    }
235    /// <p>The list of IAM policy ARNs that are applied as channel guardrails. The AWS managed <code>AdministratorAccess</code> policy is applied by default if this is not set.</p>
236    pub fn get_guardrail_policy_arns(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
237        self.inner.get_guardrail_policy_arns()
238    }
239    /// <p>Enables use of a user role requirement in your chat configuration.</p>
240    pub fn user_authorization_required(mut self, input: bool) -> Self {
241        self.inner = self.inner.user_authorization_required(input);
242        self
243    }
244    /// <p>Enables use of a user role requirement in your chat configuration.</p>
245    pub fn set_user_authorization_required(mut self, input: ::std::option::Option<bool>) -> Self {
246        self.inner = self.inner.set_user_authorization_required(input);
247        self
248    }
249    /// <p>Enables use of a user role requirement in your chat configuration.</p>
250    pub fn get_user_authorization_required(&self) -> &::std::option::Option<bool> {
251        self.inner.get_user_authorization_required()
252    }
253    ///
254    /// Appends an item to `Tags`.
255    ///
256    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
257    ///
258    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
259    pub fn tags(mut self, input: crate::types::Tag) -> Self {
260        self.inner = self.inner.tags(input);
261        self
262    }
263    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
264    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
265        self.inner = self.inner.set_tags(input);
266        self
267    }
268    /// <p>A map of tags assigned to a resource. A tag is a string-to-string map of key-value pairs.</p>
269    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
270        self.inner.get_tags()
271    }
272}