aws_sdk_datasync/operation/describe_storage_system_resource_metrics/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::describe_storage_system_resource_metrics::_describe_storage_system_resource_metrics_output::DescribeStorageSystemResourceMetricsOutputBuilder;
3
4pub use crate::operation::describe_storage_system_resource_metrics::_describe_storage_system_resource_metrics_input::DescribeStorageSystemResourceMetricsInputBuilder;
5
6impl crate::operation::describe_storage_system_resource_metrics::builders::DescribeStorageSystemResourceMetricsInputBuilder {
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_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.describe_storage_system_resource_metrics();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `DescribeStorageSystemResourceMetrics`.
24///
25/// <p>Returns information, including performance data and capacity usage, which DataSync Discovery collects about a specific resource in your-premises storage system.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct DescribeStorageSystemResourceMetricsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::describe_storage_system_resource_metrics::builders::DescribeStorageSystemResourceMetricsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsOutput,
35        crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsError,
36    > for DescribeStorageSystemResourceMetricsFluentBuilder
37{
38    fn send(
39        self,
40        config_override: crate::config::Builder,
41    ) -> crate::client::customize::internal::BoxFuture<
42        crate::client::customize::internal::SendResult<
43            crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsOutput,
44            crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl DescribeStorageSystemResourceMetricsFluentBuilder {
51    /// Creates a new `DescribeStorageSystemResourceMetricsFluentBuilder`.
52    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53        Self {
54            handle,
55            inner: ::std::default::Default::default(),
56            config_override: ::std::option::Option::None,
57        }
58    }
59    /// Access the DescribeStorageSystemResourceMetrics as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::describe_storage_system_resource_metrics::builders::DescribeStorageSystemResourceMetricsInputBuilder {
63        &self.inner
64    }
65    /// Sends the request and returns the response.
66    ///
67    /// If an error occurs, an `SdkError` will be returned with additional details that
68    /// can be matched against.
69    ///
70    /// By default, any retryable failures will be retried twice. Retry behavior
71    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
72    /// set when configuring the client.
73    pub async fn send(
74        self,
75    ) -> ::std::result::Result<
76        crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsError,
79            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
80        >,
81    > {
82        let input = self
83            .inner
84            .build()
85            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
86        let runtime_plugins =
87            crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetrics::operation_runtime_plugins(
88                self.handle.runtime_plugins.clone(),
89                &self.handle.conf,
90                self.config_override,
91            );
92        crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetrics::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_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsOutput,
100        crate::operation::describe_storage_system_resource_metrics::DescribeStorageSystemResourceMetricsError,
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_storage_system_resource_metrics::paginator::DescribeStorageSystemResourceMetricsPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
117    pub fn into_paginator(
118        self,
119    ) -> crate::operation::describe_storage_system_resource_metrics::paginator::DescribeStorageSystemResourceMetricsPaginator {
120        crate::operation::describe_storage_system_resource_metrics::paginator::DescribeStorageSystemResourceMetricsPaginator::new(
121            self.handle,
122            self.inner,
123        )
124    }
125    /// <p>Specifies the Amazon Resource Name (ARN) of the discovery job that collects information about your on-premises storage system.</p>
126    pub fn discovery_job_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
127        self.inner = self.inner.discovery_job_arn(input.into());
128        self
129    }
130    /// <p>Specifies the Amazon Resource Name (ARN) of the discovery job that collects information about your on-premises storage system.</p>
131    pub fn set_discovery_job_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
132        self.inner = self.inner.set_discovery_job_arn(input);
133        self
134    }
135    /// <p>Specifies the Amazon Resource Name (ARN) of the discovery job that collects information about your on-premises storage system.</p>
136    pub fn get_discovery_job_arn(&self) -> &::std::option::Option<::std::string::String> {
137        self.inner.get_discovery_job_arn()
138    }
139    /// <p>Specifies the kind of storage system resource that you want information about.</p>
140    pub fn resource_type(mut self, input: crate::types::DiscoveryResourceType) -> Self {
141        self.inner = self.inner.resource_type(input);
142        self
143    }
144    /// <p>Specifies the kind of storage system resource that you want information about.</p>
145    pub fn set_resource_type(mut self, input: ::std::option::Option<crate::types::DiscoveryResourceType>) -> Self {
146        self.inner = self.inner.set_resource_type(input);
147        self
148    }
149    /// <p>Specifies the kind of storage system resource that you want information about.</p>
150    pub fn get_resource_type(&self) -> &::std::option::Option<crate::types::DiscoveryResourceType> {
151        self.inner.get_resource_type()
152    }
153    /// <p>Specifies the universally unique identifier (UUID) of the storage system resource that you want information about.</p>
154    pub fn resource_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
155        self.inner = self.inner.resource_id(input.into());
156        self
157    }
158    /// <p>Specifies the universally unique identifier (UUID) of the storage system resource that you want information about.</p>
159    pub fn set_resource_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
160        self.inner = self.inner.set_resource_id(input);
161        self
162    }
163    /// <p>Specifies the universally unique identifier (UUID) of the storage system resource that you want information about.</p>
164    pub fn get_resource_id(&self) -> &::std::option::Option<::std::string::String> {
165        self.inner.get_resource_id()
166    }
167    /// <p>Specifies a time within the total duration that the discovery job ran. To see information gathered during a certain time frame, use this parameter with <code>EndTime</code>.</p>
168    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
169        self.inner = self.inner.start_time(input);
170        self
171    }
172    /// <p>Specifies a time within the total duration that the discovery job ran. To see information gathered during a certain time frame, use this parameter with <code>EndTime</code>.</p>
173    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
174        self.inner = self.inner.set_start_time(input);
175        self
176    }
177    /// <p>Specifies a time within the total duration that the discovery job ran. To see information gathered during a certain time frame, use this parameter with <code>EndTime</code>.</p>
178    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
179        self.inner.get_start_time()
180    }
181    /// <p>Specifies a time within the total duration that the discovery job ran. To see information gathered during a certain time frame, use this parameter with <code>StartTime</code>.</p>
182    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
183        self.inner = self.inner.end_time(input);
184        self
185    }
186    /// <p>Specifies a time within the total duration that the discovery job ran. To see information gathered during a certain time frame, use this parameter with <code>StartTime</code>.</p>
187    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
188        self.inner = self.inner.set_end_time(input);
189        self
190    }
191    /// <p>Specifies a time within the total duration that the discovery job ran. To see information gathered during a certain time frame, use this parameter with <code>StartTime</code>.</p>
192    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
193        self.inner.get_end_time()
194    }
195    /// <p>Specifies how many results that you want in the response.</p>
196    pub fn max_results(mut self, input: i32) -> Self {
197        self.inner = self.inner.max_results(input);
198        self
199    }
200    /// <p>Specifies how many results that you want in the response.</p>
201    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
202        self.inner = self.inner.set_max_results(input);
203        self
204    }
205    /// <p>Specifies how many results that you want in the response.</p>
206    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
207        self.inner.get_max_results()
208    }
209    /// <p>Specifies an opaque string that indicates the position to begin the next list of results in the response.</p>
210    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
211        self.inner = self.inner.next_token(input.into());
212        self
213    }
214    /// <p>Specifies an opaque string that indicates the position to begin the next list of results in the response.</p>
215    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
216        self.inner = self.inner.set_next_token(input);
217        self
218    }
219    /// <p>Specifies an opaque string that indicates the position to begin the next list of results in the response.</p>
220    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
221        self.inner.get_next_token()
222    }
223}