aws_sdk_swf/operation/list_domains/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_domains::_list_domains_output::ListDomainsOutputBuilder;
3
4pub use crate::operation::list_domains::_list_domains_input::ListDomainsInputBuilder;
5
6impl crate::operation::list_domains::builders::ListDomainsInputBuilder {
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_domains::ListDomainsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_domains::ListDomainsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_domains();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListDomains`.
24///
25/// <p>Returns the list of domains registered in the account. The results may be split into multiple pages. To retrieve subsequent pages, make the call again using the nextPageToken returned by the initial call.</p><note>
26/// <p>This operation is eventually consistent. The results are best effort and may not exactly reflect recent updates and changes.</p>
27/// </note>
28/// <p><b>Access Control</b></p>
29/// <p>You can use IAM policies to control this action's access to Amazon SWF resources as follows:</p>
30/// <ul>
31/// <li>
32/// <p>Use a <code>Resource</code> element with the domain name to limit the action to only specified domains. The element must be set to <code>arn:aws:swf::AccountID:domain/*</code>, where <i>AccountID</i> is the account ID, with no dashes.</p></li>
33/// <li>
34/// <p>Use an <code>Action</code> element to allow or deny permission to call this action.</p></li>
35/// <li>
36/// <p>You cannot use an IAM policy to constrain this action's parameters.</p></li>
37/// </ul>
38/// <p>If the caller doesn't have sufficient permissions to invoke the action, or the parameter values fall outside the specified constraints, the action fails. The associated event attribute's <code>cause</code> parameter is set to <code>OPERATION_NOT_PERMITTED</code>. For details and example IAM policies, see <a href="https://docs.aws.amazon.com/amazonswf/latest/developerguide/swf-dev-iam.html">Using IAM to Manage Access to Amazon SWF Workflows</a> in the <i>Amazon SWF Developer Guide</i>.</p>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct ListDomainsFluentBuilder {
41    handle: ::std::sync::Arc<crate::client::Handle>,
42    inner: crate::operation::list_domains::builders::ListDomainsInputBuilder,
43    config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46    crate::client::customize::internal::CustomizableSend<
47        crate::operation::list_domains::ListDomainsOutput,
48        crate::operation::list_domains::ListDomainsError,
49    > for ListDomainsFluentBuilder
50{
51    fn send(
52        self,
53        config_override: crate::config::Builder,
54    ) -> crate::client::customize::internal::BoxFuture<
55        crate::client::customize::internal::SendResult<
56            crate::operation::list_domains::ListDomainsOutput,
57            crate::operation::list_domains::ListDomainsError,
58        >,
59    > {
60        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61    }
62}
63impl ListDomainsFluentBuilder {
64    /// Creates a new `ListDomainsFluentBuilder`.
65    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
66        Self {
67            handle,
68            inner: ::std::default::Default::default(),
69            config_override: ::std::option::Option::None,
70        }
71    }
72    /// Access the ListDomains as a reference.
73    pub fn as_input(&self) -> &crate::operation::list_domains::builders::ListDomainsInputBuilder {
74        &self.inner
75    }
76    /// Sends the request and returns the response.
77    ///
78    /// If an error occurs, an `SdkError` will be returned with additional details that
79    /// can be matched against.
80    ///
81    /// By default, any retryable failures will be retried twice. Retry behavior
82    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
83    /// set when configuring the client.
84    pub async fn send(
85        self,
86    ) -> ::std::result::Result<
87        crate::operation::list_domains::ListDomainsOutput,
88        ::aws_smithy_runtime_api::client::result::SdkError<
89            crate::operation::list_domains::ListDomainsError,
90            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
91        >,
92    > {
93        let input = self
94            .inner
95            .build()
96            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
97        let runtime_plugins = crate::operation::list_domains::ListDomains::operation_runtime_plugins(
98            self.handle.runtime_plugins.clone(),
99            &self.handle.conf,
100            self.config_override,
101        );
102        crate::operation::list_domains::ListDomains::orchestrate(&runtime_plugins, input).await
103    }
104
105    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
106    pub fn customize(
107        self,
108    ) -> crate::client::customize::CustomizableOperation<
109        crate::operation::list_domains::ListDomainsOutput,
110        crate::operation::list_domains::ListDomainsError,
111        Self,
112    > {
113        crate::client::customize::CustomizableOperation::new(self)
114    }
115    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
116        self.set_config_override(::std::option::Option::Some(config_override.into()));
117        self
118    }
119
120    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
121        self.config_override = config_override;
122        self
123    }
124    /// Create a paginator for this request
125    ///
126    /// Paginators are used by calling [`send().await`](crate::operation::list_domains::paginator::ListDomainsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
127    pub fn into_paginator(self) -> crate::operation::list_domains::paginator::ListDomainsPaginator {
128        crate::operation::list_domains::paginator::ListDomainsPaginator::new(self.handle, self.inner)
129    }
130    /// <p>If <code>NextPageToken</code> is returned there are more results available. The value of <code>NextPageToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return a <code>400</code> error: "<code>Specified token has exceeded its maximum lifetime</code>".</p>
131    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
132    pub fn next_page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.next_page_token(input.into());
134        self
135    }
136    /// <p>If <code>NextPageToken</code> is returned there are more results available. The value of <code>NextPageToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return a <code>400</code> error: "<code>Specified token has exceeded its maximum lifetime</code>".</p>
137    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
138    pub fn set_next_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
139        self.inner = self.inner.set_next_page_token(input);
140        self
141    }
142    /// <p>If <code>NextPageToken</code> is returned there are more results available. The value of <code>NextPageToken</code> is a unique pagination token for each page. Make the call again using the returned token to retrieve the next page. Keep all other arguments unchanged. Each pagination token expires after 24 hours. Using an expired pagination token will return a <code>400</code> error: "<code>Specified token has exceeded its maximum lifetime</code>".</p>
143    /// <p>The configured <code>maximumPageSize</code> determines how many results can be returned in a single call.</p>
144    pub fn get_next_page_token(&self) -> &::std::option::Option<::std::string::String> {
145        self.inner.get_next_page_token()
146    }
147    /// <p>Specifies the registration status of the domains to list.</p>
148    pub fn registration_status(mut self, input: crate::types::RegistrationStatus) -> Self {
149        self.inner = self.inner.registration_status(input);
150        self
151    }
152    /// <p>Specifies the registration status of the domains to list.</p>
153    pub fn set_registration_status(mut self, input: ::std::option::Option<crate::types::RegistrationStatus>) -> Self {
154        self.inner = self.inner.set_registration_status(input);
155        self
156    }
157    /// <p>Specifies the registration status of the domains to list.</p>
158    pub fn get_registration_status(&self) -> &::std::option::Option<crate::types::RegistrationStatus> {
159        self.inner.get_registration_status()
160    }
161    /// <p>The maximum number of results that are returned per call. Use <code>nextPageToken</code> to obtain further pages of results.</p>
162    pub fn maximum_page_size(mut self, input: i32) -> Self {
163        self.inner = self.inner.maximum_page_size(input);
164        self
165    }
166    /// <p>The maximum number of results that are returned per call. Use <code>nextPageToken</code> to obtain further pages of results.</p>
167    pub fn set_maximum_page_size(mut self, input: ::std::option::Option<i32>) -> Self {
168        self.inner = self.inner.set_maximum_page_size(input);
169        self
170    }
171    /// <p>The maximum number of results that are returned per call. Use <code>nextPageToken</code> to obtain further pages of results.</p>
172    pub fn get_maximum_page_size(&self) -> &::std::option::Option<i32> {
173        self.inner.get_maximum_page_size()
174    }
175    /// <p>When set to <code>true</code>, returns the results in reverse order. By default, the results are returned in ascending alphabetical order by <code>name</code> of the domains.</p>
176    pub fn reverse_order(mut self, input: bool) -> Self {
177        self.inner = self.inner.reverse_order(input);
178        self
179    }
180    /// <p>When set to <code>true</code>, returns the results in reverse order. By default, the results are returned in ascending alphabetical order by <code>name</code> of the domains.</p>
181    pub fn set_reverse_order(mut self, input: ::std::option::Option<bool>) -> Self {
182        self.inner = self.inner.set_reverse_order(input);
183        self
184    }
185    /// <p>When set to <code>true</code>, returns the results in reverse order. By default, the results are returned in ascending alphabetical order by <code>name</code> of the domains.</p>
186    pub fn get_reverse_order(&self) -> &::std::option::Option<bool> {
187        self.inner.get_reverse_order()
188    }
189}