aws_sdk_fsx/operation/describe_file_systems/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_file_systems::_describe_file_systems_output::DescribeFileSystemsOutputBuilder;
3
4pub use crate::operation::describe_file_systems::_describe_file_systems_input::DescribeFileSystemsInputBuilder;
5
6impl crate::operation::describe_file_systems::builders::DescribeFileSystemsInputBuilder {
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_file_systems::DescribeFileSystemsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_file_systems::DescribeFileSystemsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_file_systems();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeFileSystems`.
24///
25/// <p>Returns the description of specific Amazon FSx file systems, if a <code>FileSystemIds</code> value is provided for that file system. Otherwise, it returns descriptions of all file systems owned by your Amazon Web Services account in the Amazon Web Services Region of the endpoint that you're calling.</p>
26/// <p>When retrieving all file system descriptions, you can optionally specify the <code>MaxResults</code> parameter to limit the number of descriptions in a response. If more file system descriptions remain, Amazon FSx returns a <code>NextToken</code> value in the response. In this case, send a later request with the <code>NextToken</code> request parameter set to the value of <code>NextToken</code> from the last response.</p>
27/// <p>This operation is used in an iterative process to retrieve a list of your file system descriptions. <code>DescribeFileSystems</code> is called first without a <code>NextToken</code>value. Then the operation continues to be called with the <code>NextToken</code> parameter set to the value of the last <code>NextToken</code> value until a response has no <code>NextToken</code>.</p>
28/// <p>When using this operation, keep the following in mind:</p>
29/// <ul>
30/// <li>
31/// <p>The implementation might return fewer than <code>MaxResults</code> file system descriptions while still including a <code>NextToken</code> value.</p></li>
32/// <li>
33/// <p>The order of file systems returned in the response of one <code>DescribeFileSystems</code> call and the order of file systems returned across the responses of a multicall iteration is unspecified.</p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct DescribeFileSystemsFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::describe_file_systems::builders::DescribeFileSystemsInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::describe_file_systems::DescribeFileSystemsOutput,
44        crate::operation::describe_file_systems::DescribeFileSystemsError,
45    > for DescribeFileSystemsFluentBuilder
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::describe_file_systems::DescribeFileSystemsOutput,
53            crate::operation::describe_file_systems::DescribeFileSystemsError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl DescribeFileSystemsFluentBuilder {
60    /// Creates a new `DescribeFileSystemsFluentBuilder`.
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 DescribeFileSystems as a reference.
69    pub fn as_input(&self) -> &crate::operation::describe_file_systems::builders::DescribeFileSystemsInputBuilder {
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::describe_file_systems::DescribeFileSystemsOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::describe_file_systems::DescribeFileSystemsError,
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::describe_file_systems::DescribeFileSystems::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::describe_file_systems::DescribeFileSystems::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::describe_file_systems::DescribeFileSystemsOutput,
106        crate::operation::describe_file_systems::DescribeFileSystemsError,
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::describe_file_systems::paginator::DescribeFileSystemsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
123    pub fn into_paginator(self) -> crate::operation::describe_file_systems::paginator::DescribeFileSystemsPaginator {
124        crate::operation::describe_file_systems::paginator::DescribeFileSystemsPaginator::new(self.handle, self.inner)
125    }
126    ///
127    /// Appends an item to `FileSystemIds`.
128    ///
129    /// To override the contents of this collection use [`set_file_system_ids`](Self::set_file_system_ids).
130    ///
131    /// <p>IDs of the file systems whose descriptions you want to retrieve (String).</p>
132    pub fn file_system_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.file_system_ids(input.into());
134        self
135    }
136    /// <p>IDs of the file systems whose descriptions you want to retrieve (String).</p>
137    pub fn set_file_system_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
138        self.inner = self.inner.set_file_system_ids(input);
139        self
140    }
141    /// <p>IDs of the file systems whose descriptions you want to retrieve (String).</p>
142    pub fn get_file_system_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
143        self.inner.get_file_system_ids()
144    }
145    /// <p>Maximum number of file systems to return in the response (integer). This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
146    pub fn max_results(mut self, input: i32) -> Self {
147        self.inner = self.inner.max_results(input);
148        self
149    }
150    /// <p>Maximum number of file systems to return in the response (integer). This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
151    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
152        self.inner = self.inner.set_max_results(input);
153        self
154    }
155    /// <p>Maximum number of file systems to return in the response (integer). This parameter value must be greater than 0. The number of items that Amazon FSx returns is the minimum of the <code>MaxResults</code> parameter specified in the request and the service's internal maximum number of items per page.</p>
156    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
157        self.inner.get_max_results()
158    }
159    /// <p>Opaque pagination token returned from a previous <code>DescribeFileSystems</code> operation (String). If a token present, the operation continues the list from where the returning call left off.</p>
160    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161        self.inner = self.inner.next_token(input.into());
162        self
163    }
164    /// <p>Opaque pagination token returned from a previous <code>DescribeFileSystems</code> operation (String). If a token present, the operation continues the list from where the returning call left off.</p>
165    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
166        self.inner = self.inner.set_next_token(input);
167        self
168    }
169    /// <p>Opaque pagination token returned from a previous <code>DescribeFileSystems</code> operation (String). If a token present, the operation continues the list from where the returning call left off.</p>
170    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_next_token()
172    }
173}