aws_sdk_storagegateway/operation/refresh_cache/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::refresh_cache::_refresh_cache_output::RefreshCacheOutputBuilder;
3
4pub use crate::operation::refresh_cache::_refresh_cache_input::RefreshCacheInputBuilder;
5
6impl crate::operation::refresh_cache::builders::RefreshCacheInputBuilder {
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::refresh_cache::RefreshCacheOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::refresh_cache::RefreshCacheError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.refresh_cache();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `RefreshCache`.
24///
25/// <p>Refreshes the cached inventory of objects for the specified file share. This operation finds objects in the Amazon S3 bucket that were added, removed, or replaced since the gateway last listed the bucket's contents and cached the results. This operation does not import files into the S3 File Gateway cache storage. It only updates the cached inventory to reflect changes in the inventory of the objects in the S3 bucket. This operation is only supported in the S3 File Gateway types.</p>
26/// <p>You can subscribe to be notified through an Amazon CloudWatch event when your <code>RefreshCache</code> operation completes. For more information, see <a href="https://docs.aws.amazon.com/filegateway/latest/files3/monitoring-file-gateway.html#get-notification">Getting notified about file operations</a> in the <i>Amazon S3 File Gateway User Guide</i>. This operation is Only supported for S3 File Gateways.</p>
27/// <p>When this API is called, it only initiates the refresh operation. When the API call completes and returns a success code, it doesn't necessarily mean that the file refresh has completed. You should use the refresh-complete notification to determine that the operation has completed before you check for new files on the gateway file share. You can subscribe to be notified through a CloudWatch event when your <code>RefreshCache</code> operation completes.</p>
28/// <p>Throttle limit: This API is asynchronous, so the gateway will accept no more than two refreshes at any time. We recommend using the refresh-complete CloudWatch event notification before issuing additional requests. For more information, see <a href="https://docs.aws.amazon.com/filegateway/latest/files3/monitoring-file-gateway.html#get-notification">Getting notified about file operations</a> in the <i>Amazon S3 File Gateway User Guide</i>.</p><important>
29/// <ul>
30/// <li>
31/// <p>Wait at least 60 seconds between consecutive RefreshCache API requests.</p></li>
32/// <li>
33/// <p>If you invoke the RefreshCache API when two requests are already being processed, any new request will cause an <code>InvalidGatewayRequestException</code> error because too many requests were sent to the server.</p></li>
34/// </ul>
35/// </important> <note>
36/// <p>The S3 bucket name does not need to be included when entering the list of folders in the FolderList parameter.</p>
37/// </note>
38/// <p>For more information, see <a href="https://docs.aws.amazon.com/filegateway/latest/files3/monitoring-file-gateway.html#get-notification">Getting notified about file operations</a> in the <i>Amazon S3 File Gateway User Guide</i>.</p>
39#[derive(::std::clone::Clone, ::std::fmt::Debug)]
40pub struct RefreshCacheFluentBuilder {
41 handle: ::std::sync::Arc<crate::client::Handle>,
42 inner: crate::operation::refresh_cache::builders::RefreshCacheInputBuilder,
43 config_override: ::std::option::Option<crate::config::Builder>,
44}
45impl
46 crate::client::customize::internal::CustomizableSend<
47 crate::operation::refresh_cache::RefreshCacheOutput,
48 crate::operation::refresh_cache::RefreshCacheError,
49 > for RefreshCacheFluentBuilder
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::refresh_cache::RefreshCacheOutput,
57 crate::operation::refresh_cache::RefreshCacheError,
58 >,
59 > {
60 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
61 }
62}
63impl RefreshCacheFluentBuilder {
64 /// Creates a new `RefreshCacheFluentBuilder`.
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 RefreshCache as a reference.
73 pub fn as_input(&self) -> &crate::operation::refresh_cache::builders::RefreshCacheInputBuilder {
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::refresh_cache::RefreshCacheOutput,
88 ::aws_smithy_runtime_api::client::result::SdkError<
89 crate::operation::refresh_cache::RefreshCacheError,
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::refresh_cache::RefreshCache::operation_runtime_plugins(
98 self.handle.runtime_plugins.clone(),
99 &self.handle.conf,
100 self.config_override,
101 );
102 crate::operation::refresh_cache::RefreshCache::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::refresh_cache::RefreshCacheOutput,
110 crate::operation::refresh_cache::RefreshCacheError,
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 /// <p>The Amazon Resource Name (ARN) of the file share you want to refresh.</p>
125 pub fn file_share_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
126 self.inner = self.inner.file_share_arn(input.into());
127 self
128 }
129 /// <p>The Amazon Resource Name (ARN) of the file share you want to refresh.</p>
130 pub fn set_file_share_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
131 self.inner = self.inner.set_file_share_arn(input);
132 self
133 }
134 /// <p>The Amazon Resource Name (ARN) of the file share you want to refresh.</p>
135 pub fn get_file_share_arn(&self) -> &::std::option::Option<::std::string::String> {
136 self.inner.get_file_share_arn()
137 }
138 ///
139 /// Appends an item to `FolderList`.
140 ///
141 /// To override the contents of this collection use [`set_folder_list`](Self::set_folder_list).
142 ///
143 /// <p>A comma-separated list of the paths of folders to refresh in the cache. The default is \["/"\]. The default refreshes objects and folders at the root of the Amazon S3 bucket. If Recursive is set to true, the entire S3 bucket that the file share has access to is refreshed.</p>
144 /// <p>Do not include <code>/</code> when specifying folder names. For example, you would specify <code>samplefolder</code> rather than <code>samplefolder/</code>.</p>
145 pub fn folder_list(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
146 self.inner = self.inner.folder_list(input.into());
147 self
148 }
149 /// <p>A comma-separated list of the paths of folders to refresh in the cache. The default is \["/"\]. The default refreshes objects and folders at the root of the Amazon S3 bucket. If Recursive is set to true, the entire S3 bucket that the file share has access to is refreshed.</p>
150 /// <p>Do not include <code>/</code> when specifying folder names. For example, you would specify <code>samplefolder</code> rather than <code>samplefolder/</code>.</p>
151 pub fn set_folder_list(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
152 self.inner = self.inner.set_folder_list(input);
153 self
154 }
155 /// <p>A comma-separated list of the paths of folders to refresh in the cache. The default is \["/"\]. The default refreshes objects and folders at the root of the Amazon S3 bucket. If Recursive is set to true, the entire S3 bucket that the file share has access to is refreshed.</p>
156 /// <p>Do not include <code>/</code> when specifying folder names. For example, you would specify <code>samplefolder</code> rather than <code>samplefolder/</code>.</p>
157 pub fn get_folder_list(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
158 self.inner.get_folder_list()
159 }
160 /// <p>A value that specifies whether to recursively refresh folders in the cache. The refresh includes folders that were in the cache the last time the gateway listed the folder's contents. If this value set to <code>true</code>, each folder that is listed in <code>FolderList</code> is recursively updated. Otherwise, subfolders listed in <code>FolderList</code> are not refreshed. Only objects that are in folders listed directly under <code>FolderList</code> are found and used for the update. The default is <code>true</code>.</p>
161 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
162 pub fn recursive(mut self, input: bool) -> Self {
163 self.inner = self.inner.recursive(input);
164 self
165 }
166 /// <p>A value that specifies whether to recursively refresh folders in the cache. The refresh includes folders that were in the cache the last time the gateway listed the folder's contents. If this value set to <code>true</code>, each folder that is listed in <code>FolderList</code> is recursively updated. Otherwise, subfolders listed in <code>FolderList</code> are not refreshed. Only objects that are in folders listed directly under <code>FolderList</code> are found and used for the update. The default is <code>true</code>.</p>
167 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
168 pub fn set_recursive(mut self, input: ::std::option::Option<bool>) -> Self {
169 self.inner = self.inner.set_recursive(input);
170 self
171 }
172 /// <p>A value that specifies whether to recursively refresh folders in the cache. The refresh includes folders that were in the cache the last time the gateway listed the folder's contents. If this value set to <code>true</code>, each folder that is listed in <code>FolderList</code> is recursively updated. Otherwise, subfolders listed in <code>FolderList</code> are not refreshed. Only objects that are in folders listed directly under <code>FolderList</code> are found and used for the update. The default is <code>true</code>.</p>
173 /// <p>Valid Values: <code>true</code> | <code>false</code></p>
174 pub fn get_recursive(&self) -> &::std::option::Option<bool> {
175 self.inner.get_recursive()
176 }
177}