aws_sdk_storagegateway/operation/start_cache_report/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::start_cache_report::_start_cache_report_output::StartCacheReportOutputBuilder;
3
4pub use crate::operation::start_cache_report::_start_cache_report_input::StartCacheReportInputBuilder;
5
6impl crate::operation::start_cache_report::builders::StartCacheReportInputBuilder {
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::start_cache_report::StartCacheReportOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::start_cache_report::StartCacheReportError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.start_cache_report();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `StartCacheReport`.
24///
25/// <p>Starts generating a report of the file metadata currently cached by an S3 File Gateway for a specific file share. You can use this report to identify and resolve issues if you have files failing upload from your gateway to Amazon S3. The report is a CSV file containing a list of files which match the set of filter parameters you specify in the request.</p><note>
26/// <p>The <b>Files Failing Upload</b> flag is reset every 24 hours and during gateway reboot. If this report captures the files after the reset, but before they become flagged again, they will not be reported as <b>Files Failing Upload</b>.</p>
27/// </note>
28/// <p>The following requirements must be met to successfully generate a cache report:</p>
29/// <ul>
30/// <li>
31/// <p>You must have <code>s3:PutObject</code> and <code>s3:AbortMultipartUpload</code> permissions for the Amazon S3 bucket where you want to store the cache report.</p></li>
32/// <li>
33/// <p>No other cache reports can currently be in-progress for the specified file share.</p></li>
34/// <li>
35/// <p>There must be fewer than 10 existing cache reports for the specified file share.</p></li>
36/// <li>
37/// <p>The gateway must be online and connected to Amazon Web Services.</p></li>
38/// <li>
39/// <p>The root disk must have at least 20GB of free space when report generation starts.</p></li>
40/// <li>
41/// <p>You must specify at least one value for <code>InclusionFilters</code> or <code>ExclusionFilters</code> in the request.</p></li>
42/// </ul>
43#[derive(::std::clone::Clone, ::std::fmt::Debug)]
44pub struct StartCacheReportFluentBuilder {
45 handle: ::std::sync::Arc<crate::client::Handle>,
46 inner: crate::operation::start_cache_report::builders::StartCacheReportInputBuilder,
47 config_override: ::std::option::Option<crate::config::Builder>,
48}
49impl
50 crate::client::customize::internal::CustomizableSend<
51 crate::operation::start_cache_report::StartCacheReportOutput,
52 crate::operation::start_cache_report::StartCacheReportError,
53 > for StartCacheReportFluentBuilder
54{
55 fn send(
56 self,
57 config_override: crate::config::Builder,
58 ) -> crate::client::customize::internal::BoxFuture<
59 crate::client::customize::internal::SendResult<
60 crate::operation::start_cache_report::StartCacheReportOutput,
61 crate::operation::start_cache_report::StartCacheReportError,
62 >,
63 > {
64 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
65 }
66}
67impl StartCacheReportFluentBuilder {
68 /// Creates a new `StartCacheReportFluentBuilder`.
69 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
70 Self {
71 handle,
72 inner: ::std::default::Default::default(),
73 config_override: ::std::option::Option::None,
74 }
75 }
76 /// Access the StartCacheReport as a reference.
77 pub fn as_input(&self) -> &crate::operation::start_cache_report::builders::StartCacheReportInputBuilder {
78 &self.inner
79 }
80 /// Sends the request and returns the response.
81 ///
82 /// If an error occurs, an `SdkError` will be returned with additional details that
83 /// can be matched against.
84 ///
85 /// By default, any retryable failures will be retried twice. Retry behavior
86 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
87 /// set when configuring the client.
88 pub async fn send(
89 self,
90 ) -> ::std::result::Result<
91 crate::operation::start_cache_report::StartCacheReportOutput,
92 ::aws_smithy_runtime_api::client::result::SdkError<
93 crate::operation::start_cache_report::StartCacheReportError,
94 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
95 >,
96 > {
97 let input = self
98 .inner
99 .build()
100 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
101 let runtime_plugins = crate::operation::start_cache_report::StartCacheReport::operation_runtime_plugins(
102 self.handle.runtime_plugins.clone(),
103 &self.handle.conf,
104 self.config_override,
105 );
106 crate::operation::start_cache_report::StartCacheReport::orchestrate(&runtime_plugins, input).await
107 }
108
109 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
110 pub fn customize(
111 self,
112 ) -> crate::client::customize::CustomizableOperation<
113 crate::operation::start_cache_report::StartCacheReportOutput,
114 crate::operation::start_cache_report::StartCacheReportError,
115 Self,
116 > {
117 crate::client::customize::CustomizableOperation::new(self)
118 }
119 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
120 self.set_config_override(::std::option::Option::Some(config_override.into()));
121 self
122 }
123
124 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
125 self.config_override = config_override;
126 self
127 }
128 /// <p>The Amazon Resource Name (ARN) of the file share.</p>
129 pub fn file_share_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
130 self.inner = self.inner.file_share_arn(input.into());
131 self
132 }
133 /// <p>The Amazon Resource Name (ARN) of the file share.</p>
134 pub fn set_file_share_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
135 self.inner = self.inner.set_file_share_arn(input);
136 self
137 }
138 /// <p>The Amazon Resource Name (ARN) of the file share.</p>
139 pub fn get_file_share_arn(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_file_share_arn()
141 }
142 /// <p>The ARN of the IAM role used when saving the cache report to Amazon S3.</p>
143 pub fn role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
144 self.inner = self.inner.role(input.into());
145 self
146 }
147 /// <p>The ARN of the IAM role used when saving the cache report to Amazon S3.</p>
148 pub fn set_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
149 self.inner = self.inner.set_role(input);
150 self
151 }
152 /// <p>The ARN of the IAM role used when saving the cache report to Amazon S3.</p>
153 pub fn get_role(&self) -> &::std::option::Option<::std::string::String> {
154 self.inner.get_role()
155 }
156 /// <p>The ARN of the Amazon S3 bucket where you want to save the cache report.</p><note>
157 /// <p>We do not recommend saving the cache report to the same Amazon S3 bucket for which you are generating the report.</p>
158 /// <p>This field does not accept access point ARNs.</p>
159 /// </note>
160 pub fn location_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
161 self.inner = self.inner.location_arn(input.into());
162 self
163 }
164 /// <p>The ARN of the Amazon S3 bucket where you want to save the cache report.</p><note>
165 /// <p>We do not recommend saving the cache report to the same Amazon S3 bucket for which you are generating the report.</p>
166 /// <p>This field does not accept access point ARNs.</p>
167 /// </note>
168 pub fn set_location_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169 self.inner = self.inner.set_location_arn(input);
170 self
171 }
172 /// <p>The ARN of the Amazon S3 bucket where you want to save the cache report.</p><note>
173 /// <p>We do not recommend saving the cache report to the same Amazon S3 bucket for which you are generating the report.</p>
174 /// <p>This field does not accept access point ARNs.</p>
175 /// </note>
176 pub fn get_location_arn(&self) -> &::std::option::Option<::std::string::String> {
177 self.inner.get_location_arn()
178 }
179 /// <p>The Amazon Web Services Region of the Amazon S3 bucket where you want to save the cache report.</p>
180 pub fn bucket_region(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
181 self.inner = self.inner.bucket_region(input.into());
182 self
183 }
184 /// <p>The Amazon Web Services Region of the Amazon S3 bucket where you want to save the cache report.</p>
185 pub fn set_bucket_region(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
186 self.inner = self.inner.set_bucket_region(input);
187 self
188 }
189 /// <p>The Amazon Web Services Region of the Amazon S3 bucket where you want to save the cache report.</p>
190 pub fn get_bucket_region(&self) -> &::std::option::Option<::std::string::String> {
191 self.inner.get_bucket_region()
192 }
193 /// <p>The DNS name of the VPC endpoint associated with the Amazon S3 where you want to save the cache report. Optional.</p>
194 pub fn vpc_endpoint_dns_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195 self.inner = self.inner.vpc_endpoint_dns_name(input.into());
196 self
197 }
198 /// <p>The DNS name of the VPC endpoint associated with the Amazon S3 where you want to save the cache report. Optional.</p>
199 pub fn set_vpc_endpoint_dns_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200 self.inner = self.inner.set_vpc_endpoint_dns_name(input);
201 self
202 }
203 /// <p>The DNS name of the VPC endpoint associated with the Amazon S3 where you want to save the cache report. Optional.</p>
204 pub fn get_vpc_endpoint_dns_name(&self) -> &::std::option::Option<::std::string::String> {
205 self.inner.get_vpc_endpoint_dns_name()
206 }
207 ///
208 /// Appends an item to `InclusionFilters`.
209 ///
210 /// To override the contents of this collection use [`set_inclusion_filters`](Self::set_inclusion_filters).
211 ///
212 /// <p>The list of filters and parameters that determine which files are included in the report. You must specify at least one value for <code>InclusionFilters</code> or <code>ExclusionFilters</code> in a <code>StartCacheReport</code> request.</p>
213 pub fn inclusion_filters(mut self, input: crate::types::CacheReportFilter) -> Self {
214 self.inner = self.inner.inclusion_filters(input);
215 self
216 }
217 /// <p>The list of filters and parameters that determine which files are included in the report. You must specify at least one value for <code>InclusionFilters</code> or <code>ExclusionFilters</code> in a <code>StartCacheReport</code> request.</p>
218 pub fn set_inclusion_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CacheReportFilter>>) -> Self {
219 self.inner = self.inner.set_inclusion_filters(input);
220 self
221 }
222 /// <p>The list of filters and parameters that determine which files are included in the report. You must specify at least one value for <code>InclusionFilters</code> or <code>ExclusionFilters</code> in a <code>StartCacheReport</code> request.</p>
223 pub fn get_inclusion_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CacheReportFilter>> {
224 self.inner.get_inclusion_filters()
225 }
226 ///
227 /// Appends an item to `ExclusionFilters`.
228 ///
229 /// To override the contents of this collection use [`set_exclusion_filters`](Self::set_exclusion_filters).
230 ///
231 /// <p>The list of filters and parameters that determine which files are excluded from the report. You must specify at least one value for <code>InclusionFilters</code> or <code>ExclusionFilters</code> in a <code>StartCacheReport</code> request.</p>
232 pub fn exclusion_filters(mut self, input: crate::types::CacheReportFilter) -> Self {
233 self.inner = self.inner.exclusion_filters(input);
234 self
235 }
236 /// <p>The list of filters and parameters that determine which files are excluded from the report. You must specify at least one value for <code>InclusionFilters</code> or <code>ExclusionFilters</code> in a <code>StartCacheReport</code> request.</p>
237 pub fn set_exclusion_filters(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CacheReportFilter>>) -> Self {
238 self.inner = self.inner.set_exclusion_filters(input);
239 self
240 }
241 /// <p>The list of filters and parameters that determine which files are excluded from the report. You must specify at least one value for <code>InclusionFilters</code> or <code>ExclusionFilters</code> in a <code>StartCacheReport</code> request.</p>
242 pub fn get_exclusion_filters(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CacheReportFilter>> {
243 self.inner.get_exclusion_filters()
244 }
245 /// <p>A unique identifier that you use to ensure idempotent report generation if you need to retry an unsuccessful <code>StartCacheReport</code> request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p>
246 pub fn client_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
247 self.inner = self.inner.client_token(input.into());
248 self
249 }
250 /// <p>A unique identifier that you use to ensure idempotent report generation if you need to retry an unsuccessful <code>StartCacheReport</code> request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p>
251 pub fn set_client_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
252 self.inner = self.inner.set_client_token(input);
253 self
254 }
255 /// <p>A unique identifier that you use to ensure idempotent report generation if you need to retry an unsuccessful <code>StartCacheReport</code> request. If you retry a request, use the same <code>ClientToken</code> you specified in the initial request.</p>
256 pub fn get_client_token(&self) -> &::std::option::Option<::std::string::String> {
257 self.inner.get_client_token()
258 }
259 ///
260 /// Appends an item to `Tags`.
261 ///
262 /// To override the contents of this collection use [`set_tags`](Self::set_tags).
263 ///
264 /// <p>A list of up to 50 key/value tags that you can assign to the cache report. Using tags can help you categorize your reports and more easily locate them in search results.</p>
265 pub fn tags(mut self, input: crate::types::Tag) -> Self {
266 self.inner = self.inner.tags(input);
267 self
268 }
269 /// <p>A list of up to 50 key/value tags that you can assign to the cache report. Using tags can help you categorize your reports and more easily locate them in search results.</p>
270 pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
271 self.inner = self.inner.set_tags(input);
272 self
273 }
274 /// <p>A list of up to 50 key/value tags that you can assign to the cache report. Using tags can help you categorize your reports and more easily locate them in search results.</p>
275 pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
276 self.inner.get_tags()
277 }
278}