aws_sdk_directory/operation/describe_directories/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_directories::_describe_directories_output::DescribeDirectoriesOutputBuilder;
3
4pub use crate::operation::describe_directories::_describe_directories_input::DescribeDirectoriesInputBuilder;
5
6impl crate::operation::describe_directories::builders::DescribeDirectoriesInputBuilder {
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::describe_directories::DescribeDirectoriesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_directories::DescribeDirectoriesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_directories();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeDirectories`.
24///
25/// <p>Obtains information about the directories that belong to this account.</p>
26/// <p>You can retrieve information about specific directories by passing the directory identifiers in the <code>DirectoryIds</code> parameter. Otherwise, all directories that belong to the current account are returned.</p>
27/// <p>This operation supports pagination with the use of the <code>NextToken</code> request and response parameters. If more results are available, the <code>DescribeDirectoriesResult.NextToken</code> member contains a token that you pass in the next call to <code>DescribeDirectories</code> to retrieve the next set of items.</p>
28/// <p>You can also specify a maximum number of return results with the <code>Limit</code> parameter.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct DescribeDirectoriesFluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::describe_directories::builders::DescribeDirectoriesInputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::describe_directories::DescribeDirectoriesOutput,
38        crate::operation::describe_directories::DescribeDirectoriesError,
39    > for DescribeDirectoriesFluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::describe_directories::DescribeDirectoriesOutput,
47            crate::operation::describe_directories::DescribeDirectoriesError,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl DescribeDirectoriesFluentBuilder {
54    /// Creates a new `DescribeDirectoriesFluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the DescribeDirectories as a reference.
63    pub fn as_input(&self) -> &crate::operation::describe_directories::builders::DescribeDirectoriesInputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::describe_directories::DescribeDirectoriesOutput,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::describe_directories::DescribeDirectoriesError,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::describe_directories::DescribeDirectories::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::describe_directories::DescribeDirectories::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::describe_directories::DescribeDirectoriesOutput,
100        crate::operation::describe_directories::DescribeDirectoriesError,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// Create a paginator for this request
115    ///
116    /// Paginators are used by calling [`send().await`](crate::operation::describe_directories::paginator::DescribeDirectoriesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
117    pub fn into_paginator(self) -> crate::operation::describe_directories::paginator::DescribeDirectoriesPaginator {
118        crate::operation::describe_directories::paginator::DescribeDirectoriesPaginator::new(self.handle, self.inner)
119    }
120    ///
121    /// Appends an item to `DirectoryIds`.
122    ///
123    /// To override the contents of this collection use [`set_directory_ids`](Self::set_directory_ids).
124    ///
125    /// <p>A list of identifiers of the directories for which to obtain the information. If this member is null, all directories that belong to the current account are returned.</p>
126    /// <p>An empty list results in an <code>InvalidParameterException</code> being thrown.</p>
127    pub fn directory_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.directory_ids(input.into());
129        self
130    }
131    /// <p>A list of identifiers of the directories for which to obtain the information. If this member is null, all directories that belong to the current account are returned.</p>
132    /// <p>An empty list results in an <code>InvalidParameterException</code> being thrown.</p>
133    pub fn set_directory_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
134        self.inner = self.inner.set_directory_ids(input);
135        self
136    }
137    /// <p>A list of identifiers of the directories for which to obtain the information. If this member is null, all directories that belong to the current account are returned.</p>
138    /// <p>An empty list results in an <code>InvalidParameterException</code> being thrown.</p>
139    pub fn get_directory_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
140        self.inner.get_directory_ids()
141    }
142    /// <p>The <code>DescribeDirectoriesResult.NextToken</code> value from a previous call to <code>DescribeDirectories</code>. Pass null if this is the first call.</p>
143    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144        self.inner = self.inner.next_token(input.into());
145        self
146    }
147    /// <p>The <code>DescribeDirectoriesResult.NextToken</code> value from a previous call to <code>DescribeDirectories</code>. Pass null if this is the first call.</p>
148    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149        self.inner = self.inner.set_next_token(input);
150        self
151    }
152    /// <p>The <code>DescribeDirectoriesResult.NextToken</code> value from a previous call to <code>DescribeDirectories</code>. Pass null if this is the first call.</p>
153    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
154        self.inner.get_next_token()
155    }
156    /// <p>The maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.</p>
157    pub fn limit(mut self, input: i32) -> Self {
158        self.inner = self.inner.limit(input);
159        self
160    }
161    /// <p>The maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.</p>
162    pub fn set_limit(mut self, input: ::std::option::Option<i32>) -> Self {
163        self.inner = self.inner.set_limit(input);
164        self
165    }
166    /// <p>The maximum number of items to return. If this value is zero, the maximum number of items is specified by the limitations of the operation.</p>
167    pub fn get_limit(&self) -> &::std::option::Option<i32> {
168        self.inner.get_limit()
169    }
170}