aws_sdk_fsx/operation/describe_file_caches/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_file_caches::_describe_file_caches_output::DescribeFileCachesOutputBuilder;
3
4pub use crate::operation::describe_file_caches::_describe_file_caches_input::DescribeFileCachesInputBuilder;
5
6impl crate::operation::describe_file_caches::builders::DescribeFileCachesInputBuilder {
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_caches::DescribeFileCachesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_file_caches::DescribeFileCachesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_file_caches();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeFileCaches`.
24///
25/// <p>Returns the description of a specific Amazon File Cache resource, if a <code>FileCacheIds</code> value is provided for that cache. Otherwise, it returns descriptions of all caches 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 cache descriptions, you can optionally specify the <code>MaxResults</code> parameter to limit the number of descriptions in a response. If more cache descriptions remain, the operation 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 cache descriptions. <code>DescribeFileCaches</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> cache descriptions while still including a <code>NextToken</code> value.</p></li>
32/// <li>
33/// <p>The order of caches returned in the response of one <code>DescribeFileCaches</code> call and the order of caches returned across the responses of a multicall iteration is unspecified.</p></li>
34/// </ul>
35#[derive(::std::clone::Clone, ::std::fmt::Debug)]
36pub struct DescribeFileCachesFluentBuilder {
37    handle: ::std::sync::Arc<crate::client::Handle>,
38    inner: crate::operation::describe_file_caches::builders::DescribeFileCachesInputBuilder,
39    config_override: ::std::option::Option<crate::config::Builder>,
40}
41impl
42    crate::client::customize::internal::CustomizableSend<
43        crate::operation::describe_file_caches::DescribeFileCachesOutput,
44        crate::operation::describe_file_caches::DescribeFileCachesError,
45    > for DescribeFileCachesFluentBuilder
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_caches::DescribeFileCachesOutput,
53            crate::operation::describe_file_caches::DescribeFileCachesError,
54        >,
55    > {
56        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
57    }
58}
59impl DescribeFileCachesFluentBuilder {
60    /// Creates a new `DescribeFileCachesFluentBuilder`.
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 DescribeFileCaches as a reference.
69    pub fn as_input(&self) -> &crate::operation::describe_file_caches::builders::DescribeFileCachesInputBuilder {
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_caches::DescribeFileCachesOutput,
84        ::aws_smithy_runtime_api::client::result::SdkError<
85            crate::operation::describe_file_caches::DescribeFileCachesError,
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_caches::DescribeFileCaches::operation_runtime_plugins(
94            self.handle.runtime_plugins.clone(),
95            &self.handle.conf,
96            self.config_override,
97        );
98        crate::operation::describe_file_caches::DescribeFileCaches::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_caches::DescribeFileCachesOutput,
106        crate::operation::describe_file_caches::DescribeFileCachesError,
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_caches::paginator::DescribeFileCachesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
123    pub fn into_paginator(self) -> crate::operation::describe_file_caches::paginator::DescribeFileCachesPaginator {
124        crate::operation::describe_file_caches::paginator::DescribeFileCachesPaginator::new(self.handle, self.inner)
125    }
126    ///
127    /// Appends an item to `FileCacheIds`.
128    ///
129    /// To override the contents of this collection use [`set_file_cache_ids`](Self::set_file_cache_ids).
130    ///
131    /// <p>IDs of the caches whose descriptions you want to retrieve (String).</p>
132    pub fn file_cache_ids(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
133        self.inner = self.inner.file_cache_ids(input.into());
134        self
135    }
136    /// <p>IDs of the caches whose descriptions you want to retrieve (String).</p>
137    pub fn set_file_cache_ids(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
138        self.inner = self.inner.set_file_cache_ids(input);
139        self
140    }
141    /// <p>IDs of the caches whose descriptions you want to retrieve (String).</p>
142    pub fn get_file_cache_ids(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
143        self.inner.get_file_cache_ids()
144    }
145    /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
146    pub fn max_results(mut self, input: i32) -> Self {
147        self.inner = self.inner.max_results(input);
148        self
149    }
150    /// <p>The maximum number of resources to return in the response. This value must be an integer greater than zero.</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>The maximum number of resources to return in the response. This value must be an integer greater than zero.</p>
156    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
157        self.inner.get_max_results()
158    }
159    /// <p>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value 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>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value 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>(Optional) Opaque pagination token returned from a previous operation (String). If present, this token indicates from what point you can continue processing the request, where the previous <code>NextToken</code> value left off.</p>
170    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
171        self.inner.get_next_token()
172    }
173}