aws_sdk_chimesdkmessaging/operation/list_channels/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_channels::_list_channels_output::ListChannelsOutputBuilder;
3
4pub use crate::operation::list_channels::_list_channels_input::ListChannelsInputBuilder;
5
6impl crate::operation::list_channels::builders::ListChannelsInputBuilder {
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::list_channels::ListChannelsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_channels::ListChannelsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_channels();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListChannels`.
24///
25/// <p>Lists all Channels created under a single Chime App as a paginated list. You can specify filters to narrow results.</p>
26/// <p class="title"><b>Functionality &amp; restrictions</b></p>
27/// <ul>
28/// <li>
29/// <p>Use privacy = <code>PUBLIC</code> to retrieve all public channels in the account.</p></li>
30/// <li>
31/// <p>Only an <code>AppInstanceAdmin</code> can set privacy = <code>PRIVATE</code> to list the private channels in an account.</p></li>
32/// </ul><note>
33/// <p>The <code>x-amz-chime-bearer</code> request header is mandatory. Use the ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call as the value in the header.</p>
34/// </note>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct ListChannelsFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::list_channels::builders::ListChannelsInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::list_channels::ListChannelsOutput,
44        crate::operation::list_channels::ListChannelsError,
45    > for ListChannelsFluentBuilder
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::list_channels::ListChannelsOutput,
53            crate::operation::list_channels::ListChannelsError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl ListChannelsFluentBuilder {
60    /// Creates a new `ListChannelsFluentBuilder`.
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 ListChannels as a reference.
69    pub fn as_input(&self) -> &crate::operation::list_channels::builders::ListChannelsInputBuilder {
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::list_channels::ListChannelsOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::list_channels::ListChannelsError,
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::list_channels::ListChannels::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::list_channels::ListChannels::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::list_channels::ListChannelsOutput,
106        crate::operation::list_channels::ListChannelsError,
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    /// Create a paginator for this request
121    ///
122    /// Paginators are used by calling [`send().await`](crate::operation::list_channels::paginator::ListChannelsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
123    pub fn into_paginator(self) -> crate::operation::list_channels::paginator::ListChannelsPaginator {
124        crate::operation::list_channels::paginator::ListChannelsPaginator::new(self.handle, self.inner)
125    }
126    /// <p>The ARN of the <code>AppInstance</code>.</p>
127    pub fn app_instance_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.app_instance_arn(input.into());
129        self
130    }
131    /// <p>The ARN of the <code>AppInstance</code>.</p>
132    pub fn set_app_instance_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_app_instance_arn(input);
134        self
135    }
136    /// <p>The ARN of the <code>AppInstance</code>.</p>
137    pub fn get_app_instance_arn(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_app_instance_arn()
139    }
140    /// <p>The privacy setting. <code>PUBLIC</code> retrieves all the public channels. <code>PRIVATE</code> retrieves private channels. Only an <code>AppInstanceAdmin</code> can retrieve private channels.</p>
141    pub fn privacy(mut self, input: crate::types::ChannelPrivacy) -> Self {
142        self.inner = self.inner.privacy(input);
143        self
144    }
145    /// <p>The privacy setting. <code>PUBLIC</code> retrieves all the public channels. <code>PRIVATE</code> retrieves private channels. Only an <code>AppInstanceAdmin</code> can retrieve private channels.</p>
146    pub fn set_privacy(mut self, input: ::std::option::Option<crate::types::ChannelPrivacy>) -> Self {
147        self.inner = self.inner.set_privacy(input);
148        self
149    }
150    /// <p>The privacy setting. <code>PUBLIC</code> retrieves all the public channels. <code>PRIVATE</code> retrieves private channels. Only an <code>AppInstanceAdmin</code> can retrieve private channels.</p>
151    pub fn get_privacy(&self) -> &::std::option::Option<crate::types::ChannelPrivacy> {
152        self.inner.get_privacy()
153    }
154    /// <p>The maximum number of channels that you want to return.</p>
155    pub fn max_results(mut self, input: i32) -> Self {
156        self.inner = self.inner.max_results(input);
157        self
158    }
159    /// <p>The maximum number of channels that you want to return.</p>
160    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
161        self.inner = self.inner.set_max_results(input);
162        self
163    }
164    /// <p>The maximum number of channels that you want to return.</p>
165    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
166        self.inner.get_max_results()
167    }
168    /// <p>The token passed by previous API calls until all requested channels are returned.</p>
169    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
170        self.inner = self.inner.next_token(input.into());
171        self
172    }
173    /// <p>The token passed by previous API calls until all requested channels are returned.</p>
174    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
175        self.inner = self.inner.set_next_token(input);
176        self
177    }
178    /// <p>The token passed by previous API calls until all requested channels are returned.</p>
179    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
180        self.inner.get_next_token()
181    }
182    /// <p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>
183    pub fn chime_bearer(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.chime_bearer(input.into());
185        self
186    }
187    /// <p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>
188    pub fn set_chime_bearer(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_chime_bearer(input);
190        self
191    }
192    /// <p>The ARN of the <code>AppInstanceUser</code> or <code>AppInstanceBot</code> that makes the API call.</p>
193    pub fn get_chime_bearer(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_chime_bearer()
195    }
196}