aws_sdk_computeoptimizer/operation/get_ecs_service_recommendation_projected_metrics/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_ecs_service_recommendation_projected_metrics::_get_ecs_service_recommendation_projected_metrics_output::GetEcsServiceRecommendationProjectedMetricsOutputBuilder;
3
4pub use crate::operation::get_ecs_service_recommendation_projected_metrics::_get_ecs_service_recommendation_projected_metrics_input::GetEcsServiceRecommendationProjectedMetricsInputBuilder;
5
6impl crate::operation::get_ecs_service_recommendation_projected_metrics::builders::GetEcsServiceRecommendationProjectedMetricsInputBuilder {
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::get_ecs_service_recommendation_projected_metrics::GetEcsServiceRecommendationProjectedMetricsOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_ecs_service_recommendation_projected_metrics::GetECSServiceRecommendationProjectedMetricsError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_ecs_service_recommendation_projected_metrics();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetECSServiceRecommendationProjectedMetrics`.
24///
25/// <p>Returns the projected metrics of Amazon ECS service recommendations.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetECSServiceRecommendationProjectedMetricsFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::get_ecs_service_recommendation_projected_metrics::builders::GetEcsServiceRecommendationProjectedMetricsInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::get_ecs_service_recommendation_projected_metrics::GetEcsServiceRecommendationProjectedMetricsOutput,
35        crate::operation::get_ecs_service_recommendation_projected_metrics::GetECSServiceRecommendationProjectedMetricsError,
36    > for GetECSServiceRecommendationProjectedMetricsFluentBuilder
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::get_ecs_service_recommendation_projected_metrics::GetEcsServiceRecommendationProjectedMetricsOutput,
44            crate::operation::get_ecs_service_recommendation_projected_metrics::GetECSServiceRecommendationProjectedMetricsError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl GetECSServiceRecommendationProjectedMetricsFluentBuilder {
51    /// Creates a new `GetECSServiceRecommendationProjectedMetricsFluentBuilder`.
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 GetECSServiceRecommendationProjectedMetrics as a reference.
60    pub fn as_input(
61        &self,
62    ) -> &crate::operation::get_ecs_service_recommendation_projected_metrics::builders::GetEcsServiceRecommendationProjectedMetricsInputBuilder {
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::get_ecs_service_recommendation_projected_metrics::GetEcsServiceRecommendationProjectedMetricsOutput,
77        ::aws_smithy_runtime_api::client::result::SdkError<
78            crate::operation::get_ecs_service_recommendation_projected_metrics::GetECSServiceRecommendationProjectedMetricsError,
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 = crate::operation::get_ecs_service_recommendation_projected_metrics::GetECSServiceRecommendationProjectedMetrics::operation_runtime_plugins(
87                            self.handle.runtime_plugins.clone(),
88                            &self.handle.conf,
89                            self.config_override,
90                        );
91        crate::operation::get_ecs_service_recommendation_projected_metrics::GetECSServiceRecommendationProjectedMetrics::orchestrate(
92            &runtime_plugins,
93            input,
94        )
95        .await
96    }
97
98    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
99    pub fn customize(
100        self,
101    ) -> crate::client::customize::CustomizableOperation<
102        crate::operation::get_ecs_service_recommendation_projected_metrics::GetEcsServiceRecommendationProjectedMetricsOutput,
103        crate::operation::get_ecs_service_recommendation_projected_metrics::GetECSServiceRecommendationProjectedMetricsError,
104        Self,
105    > {
106        crate::client::customize::CustomizableOperation::new(self)
107    }
108    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
109        self.set_config_override(::std::option::Option::Some(config_override.into()));
110        self
111    }
112
113    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
114        self.config_override = config_override;
115        self
116    }
117    /// <p>The ARN that identifies the Amazon ECS service.</p>
118    /// <p>The following is the format of the ARN:</p>
119    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
120    pub fn service_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
121        self.inner = self.inner.service_arn(input.into());
122        self
123    }
124    /// <p>The ARN that identifies the Amazon ECS service.</p>
125    /// <p>The following is the format of the ARN:</p>
126    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
127    pub fn set_service_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
128        self.inner = self.inner.set_service_arn(input);
129        self
130    }
131    /// <p>The ARN that identifies the Amazon ECS service.</p>
132    /// <p>The following is the format of the ARN:</p>
133    /// <p><code>arn:aws:ecs:region:aws_account_id:service/cluster-name/service-name</code></p>
134    pub fn get_service_arn(&self) -> &::std::option::Option<::std::string::String> {
135        self.inner.get_service_arn()
136    }
137    /// <p>The statistic of the projected metrics.</p>
138    pub fn stat(mut self, input: crate::types::MetricStatistic) -> Self {
139        self.inner = self.inner.stat(input);
140        self
141    }
142    /// <p>The statistic of the projected metrics.</p>
143    pub fn set_stat(mut self, input: ::std::option::Option<crate::types::MetricStatistic>) -> Self {
144        self.inner = self.inner.set_stat(input);
145        self
146    }
147    /// <p>The statistic of the projected metrics.</p>
148    pub fn get_stat(&self) -> &::std::option::Option<crate::types::MetricStatistic> {
149        self.inner.get_stat()
150    }
151    /// <p>The granularity, in seconds, of the projected metrics data points.</p>
152    pub fn period(mut self, input: i32) -> Self {
153        self.inner = self.inner.period(input);
154        self
155    }
156    /// <p>The granularity, in seconds, of the projected metrics data points.</p>
157    pub fn set_period(mut self, input: ::std::option::Option<i32>) -> Self {
158        self.inner = self.inner.set_period(input);
159        self
160    }
161    /// <p>The granularity, in seconds, of the projected metrics data points.</p>
162    pub fn get_period(&self) -> &::std::option::Option<i32> {
163        self.inner.get_period()
164    }
165    /// <p>The timestamp of the first projected metrics data point to return.</p>
166    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
167        self.inner = self.inner.start_time(input);
168        self
169    }
170    /// <p>The timestamp of the first projected metrics data point to return.</p>
171    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
172        self.inner = self.inner.set_start_time(input);
173        self
174    }
175    /// <p>The timestamp of the first projected metrics data point to return.</p>
176    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
177        self.inner.get_start_time()
178    }
179    /// <p>The timestamp of the last projected metrics data point to return.</p>
180    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
181        self.inner = self.inner.end_time(input);
182        self
183    }
184    /// <p>The timestamp of the last projected metrics data point to return.</p>
185    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
186        self.inner = self.inner.set_end_time(input);
187        self
188    }
189    /// <p>The timestamp of the last projected metrics data point to return.</p>
190    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
191        self.inner.get_end_time()
192    }
193}