aws_sdk_applicationsignals/operation/update_service_level_objective/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_service_level_objective::_update_service_level_objective_output::UpdateServiceLevelObjectiveOutputBuilder;
3
4pub use crate::operation::update_service_level_objective::_update_service_level_objective_input::UpdateServiceLevelObjectiveInputBuilder;
5
6impl crate::operation::update_service_level_objective::builders::UpdateServiceLevelObjectiveInputBuilder {
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::update_service_level_objective::UpdateServiceLevelObjectiveOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_service_level_objective();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateServiceLevelObjective`.
24///
25/// <p>Updates an existing service level objective (SLO). If you omit parameters, the previous values of those parameters are retained.</p>
26/// <p>You cannot change from a period-based SLO to a request-based SLO, or change from a request-based SLO to a period-based SLO.</p>
27#[derive(::std::clone::Clone, ::std::fmt::Debug)]
28pub struct UpdateServiceLevelObjectiveFluentBuilder {
29    handle: ::std::sync::Arc<crate::client::Handle>,
30    inner: crate::operation::update_service_level_objective::builders::UpdateServiceLevelObjectiveInputBuilder,
31    config_override: ::std::option::Option<crate::config::Builder>,
32}
33impl
34    crate::client::customize::internal::CustomizableSend<
35        crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveOutput,
36        crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError,
37    > for UpdateServiceLevelObjectiveFluentBuilder
38{
39    fn send(
40        self,
41        config_override: crate::config::Builder,
42    ) -> crate::client::customize::internal::BoxFuture<
43        crate::client::customize::internal::SendResult<
44            crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveOutput,
45            crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError,
46        >,
47    > {
48        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
49    }
50}
51impl UpdateServiceLevelObjectiveFluentBuilder {
52    /// Creates a new `UpdateServiceLevelObjectiveFluentBuilder`.
53    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
54        Self {
55            handle,
56            inner: ::std::default::Default::default(),
57            config_override: ::std::option::Option::None,
58        }
59    }
60    /// Access the UpdateServiceLevelObjective as a reference.
61    pub fn as_input(&self) -> &crate::operation::update_service_level_objective::builders::UpdateServiceLevelObjectiveInputBuilder {
62        &self.inner
63    }
64    /// Sends the request and returns the response.
65    ///
66    /// If an error occurs, an `SdkError` will be returned with additional details that
67    /// can be matched against.
68    ///
69    /// By default, any retryable failures will be retried twice. Retry behavior
70    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
71    /// set when configuring the client.
72    pub async fn send(
73        self,
74    ) -> ::std::result::Result<
75        crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveOutput,
76        ::aws_smithy_runtime_api::client::result::SdkError<
77            crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError,
78            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
79        >,
80    > {
81        let input = self
82            .inner
83            .build()
84            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
85        let runtime_plugins = crate::operation::update_service_level_objective::UpdateServiceLevelObjective::operation_runtime_plugins(
86            self.handle.runtime_plugins.clone(),
87            &self.handle.conf,
88            self.config_override,
89        );
90        crate::operation::update_service_level_objective::UpdateServiceLevelObjective::orchestrate(&runtime_plugins, input).await
91    }
92
93    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
94    pub fn customize(
95        self,
96    ) -> crate::client::customize::CustomizableOperation<
97        crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveOutput,
98        crate::operation::update_service_level_objective::UpdateServiceLevelObjectiveError,
99        Self,
100    > {
101        crate::client::customize::CustomizableOperation::new(self)
102    }
103    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
104        self.set_config_override(::std::option::Option::Some(config_override.into()));
105        self
106    }
107
108    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
109        self.config_override = config_override;
110        self
111    }
112    /// <p>The Amazon Resource Name (ARN) or name of the service level objective that you want to update.</p>
113    pub fn id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
114        self.inner = self.inner.id(input.into());
115        self
116    }
117    /// <p>The Amazon Resource Name (ARN) or name of the service level objective that you want to update.</p>
118    pub fn set_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
119        self.inner = self.inner.set_id(input);
120        self
121    }
122    /// <p>The Amazon Resource Name (ARN) or name of the service level objective that you want to update.</p>
123    pub fn get_id(&self) -> &::std::option::Option<::std::string::String> {
124        self.inner.get_id()
125    }
126    /// <p>An optional description for the SLO.</p>
127    pub fn description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128        self.inner = self.inner.description(input.into());
129        self
130    }
131    /// <p>An optional description for the SLO.</p>
132    pub fn set_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
133        self.inner = self.inner.set_description(input);
134        self
135    }
136    /// <p>An optional description for the SLO.</p>
137    pub fn get_description(&self) -> &::std::option::Option<::std::string::String> {
138        self.inner.get_description()
139    }
140    /// <p>If this SLO is a period-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p>
141    pub fn sli_config(mut self, input: crate::types::ServiceLevelIndicatorConfig) -> Self {
142        self.inner = self.inner.sli_config(input);
143        self
144    }
145    /// <p>If this SLO is a period-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p>
146    pub fn set_sli_config(mut self, input: ::std::option::Option<crate::types::ServiceLevelIndicatorConfig>) -> Self {
147        self.inner = self.inner.set_sli_config(input);
148        self
149    }
150    /// <p>If this SLO is a period-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p>
151    pub fn get_sli_config(&self) -> &::std::option::Option<crate::types::ServiceLevelIndicatorConfig> {
152        self.inner.get_sli_config()
153    }
154    /// <p>If this SLO is a request-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p>
155    /// <p>You can't specify both <code>SliConfig</code> and <code>RequestBasedSliConfig</code> in the same operation.</p>
156    pub fn request_based_sli_config(mut self, input: crate::types::RequestBasedServiceLevelIndicatorConfig) -> Self {
157        self.inner = self.inner.request_based_sli_config(input);
158        self
159    }
160    /// <p>If this SLO is a request-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p>
161    /// <p>You can't specify both <code>SliConfig</code> and <code>RequestBasedSliConfig</code> in the same operation.</p>
162    pub fn set_request_based_sli_config(mut self, input: ::std::option::Option<crate::types::RequestBasedServiceLevelIndicatorConfig>) -> Self {
163        self.inner = self.inner.set_request_based_sli_config(input);
164        self
165    }
166    /// <p>If this SLO is a request-based SLO, this structure defines the information about what performance metric this SLO will monitor.</p>
167    /// <p>You can't specify both <code>SliConfig</code> and <code>RequestBasedSliConfig</code> in the same operation.</p>
168    pub fn get_request_based_sli_config(&self) -> &::std::option::Option<crate::types::RequestBasedServiceLevelIndicatorConfig> {
169        self.inner.get_request_based_sli_config()
170    }
171    /// <p>A structure that contains the attributes that determine the goal of the SLO. This includes the time period for evaluation and the attainment threshold.</p>
172    pub fn goal(mut self, input: crate::types::Goal) -> Self {
173        self.inner = self.inner.goal(input);
174        self
175    }
176    /// <p>A structure that contains the attributes that determine the goal of the SLO. This includes the time period for evaluation and the attainment threshold.</p>
177    pub fn set_goal(mut self, input: ::std::option::Option<crate::types::Goal>) -> Self {
178        self.inner = self.inner.set_goal(input);
179        self
180    }
181    /// <p>A structure that contains the attributes that determine the goal of the SLO. This includes the time period for evaluation and the attainment threshold.</p>
182    pub fn get_goal(&self) -> &::std::option::Option<crate::types::Goal> {
183        self.inner.get_goal()
184    }
185    ///
186    /// Appends an item to `BurnRateConfigurations`.
187    ///
188    /// To override the contents of this collection use [`set_burn_rate_configurations`](Self::set_burn_rate_configurations).
189    ///
190    /// <p>Use this array to create <i>burn rates</i> for this SLO. Each burn rate is a metric that indicates how fast the service is consuming the error budget, relative to the attainment goal of the SLO.</p>
191    pub fn burn_rate_configurations(mut self, input: crate::types::BurnRateConfiguration) -> Self {
192        self.inner = self.inner.burn_rate_configurations(input);
193        self
194    }
195    /// <p>Use this array to create <i>burn rates</i> for this SLO. Each burn rate is a metric that indicates how fast the service is consuming the error budget, relative to the attainment goal of the SLO.</p>
196    pub fn set_burn_rate_configurations(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::BurnRateConfiguration>>) -> Self {
197        self.inner = self.inner.set_burn_rate_configurations(input);
198        self
199    }
200    /// <p>Use this array to create <i>burn rates</i> for this SLO. Each burn rate is a metric that indicates how fast the service is consuming the error budget, relative to the attainment goal of the SLO.</p>
201    pub fn get_burn_rate_configurations(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::BurnRateConfiguration>> {
202        self.inner.get_burn_rate_configurations()
203    }
204}