aws_sdk_applicationsignals/operation/list_service_level_objectives/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_service_level_objectives::_list_service_level_objectives_output::ListServiceLevelObjectivesOutputBuilder;
3
4pub use crate::operation::list_service_level_objectives::_list_service_level_objectives_input::ListServiceLevelObjectivesInputBuilder;
5
6impl crate::operation::list_service_level_objectives::builders::ListServiceLevelObjectivesInputBuilder {
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::list_service_level_objectives::ListServiceLevelObjectivesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_service_level_objectives();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListServiceLevelObjectives`.
24///
25/// <p>Returns a list of SLOs created in this account.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListServiceLevelObjectivesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_service_level_objectives::builders::ListServiceLevelObjectivesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_service_level_objectives::ListServiceLevelObjectivesOutput,
35        crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError,
36    > for ListServiceLevelObjectivesFluentBuilder
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::list_service_level_objectives::ListServiceLevelObjectivesOutput,
44            crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListServiceLevelObjectivesFluentBuilder {
51    /// Creates a new `ListServiceLevelObjectivesFluentBuilder`.
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 ListServiceLevelObjectives as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_service_level_objectives::builders::ListServiceLevelObjectivesInputBuilder {
61        &self.inner
62    }
63    /// Sends the request and returns the response.
64    ///
65    /// If an error occurs, an `SdkError` will be returned with additional details that
66    /// can be matched against.
67    ///
68    /// By default, any retryable failures will be retried twice. Retry behavior
69    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70    /// set when configuring the client.
71    pub async fn send(
72        self,
73    ) -> ::std::result::Result<
74        crate::operation::list_service_level_objectives::ListServiceLevelObjectivesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError,
77            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78        >,
79    > {
80        let input = self
81            .inner
82            .build()
83            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84        let runtime_plugins = crate::operation::list_service_level_objectives::ListServiceLevelObjectives::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_service_level_objectives::ListServiceLevelObjectives::orchestrate(&runtime_plugins, input).await
90    }
91
92    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93    pub fn customize(
94        self,
95    ) -> crate::client::customize::CustomizableOperation<
96        crate::operation::list_service_level_objectives::ListServiceLevelObjectivesOutput,
97        crate::operation::list_service_level_objectives::ListServiceLevelObjectivesError,
98        Self,
99    > {
100        crate::client::customize::CustomizableOperation::new(self)
101    }
102    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103        self.set_config_override(::std::option::Option::Some(config_override.into()));
104        self
105    }
106
107    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108        self.config_override = config_override;
109        self
110    }
111    /// Create a paginator for this request
112    ///
113    /// Paginators are used by calling [`send().await`](crate::operation::list_service_level_objectives::paginator::ListServiceLevelObjectivesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_service_level_objectives::paginator::ListServiceLevelObjectivesPaginator {
115        crate::operation::list_service_level_objectives::paginator::ListServiceLevelObjectivesPaginator::new(self.handle, self.inner)
116    }
117    ///
118    /// Adds a key-value pair to `KeyAttributes`.
119    ///
120    /// To override the contents of this collection use [`set_key_attributes`](Self::set_key_attributes).
121    ///
122    /// <p>You can use this optional field to specify which services you want to retrieve SLO information for.</p>
123    /// <p>This is a string-to-string map. It can include the following fields.</p>
124    /// <ul>
125    /// <li>
126    /// <p><code>Type</code> designates the type of object this is.</p></li>
127    /// <li>
128    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
129    /// <li>
130    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
131    /// <li>
132    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
133    /// <li>
134    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
135    /// </ul>
136    pub fn key_attributes(
137        mut self,
138        k: impl ::std::convert::Into<::std::string::String>,
139        v: impl ::std::convert::Into<::std::string::String>,
140    ) -> Self {
141        self.inner = self.inner.key_attributes(k.into(), v.into());
142        self
143    }
144    /// <p>You can use this optional field to specify which services you want to retrieve SLO information for.</p>
145    /// <p>This is a string-to-string map. It can include the following fields.</p>
146    /// <ul>
147    /// <li>
148    /// <p><code>Type</code> designates the type of object this is.</p></li>
149    /// <li>
150    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
151    /// <li>
152    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
153    /// <li>
154    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
155    /// <li>
156    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
157    /// </ul>
158    pub fn set_key_attributes(
159        mut self,
160        input: ::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>>,
161    ) -> Self {
162        self.inner = self.inner.set_key_attributes(input);
163        self
164    }
165    /// <p>You can use this optional field to specify which services you want to retrieve SLO information for.</p>
166    /// <p>This is a string-to-string map. It can include the following fields.</p>
167    /// <ul>
168    /// <li>
169    /// <p><code>Type</code> designates the type of object this is.</p></li>
170    /// <li>
171    /// <p><code>ResourceType</code> specifies the type of the resource. This field is used only when the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
172    /// <li>
173    /// <p><code>Name</code> specifies the name of the object. This is used only if the value of the <code>Type</code> field is <code>Service</code>, <code>RemoteService</code>, or <code>AWS::Service</code>.</p></li>
174    /// <li>
175    /// <p><code>Identifier</code> identifies the resource objects of this resource. This is used only if the value of the <code>Type</code> field is <code>Resource</code> or <code>AWS::Resource</code>.</p></li>
176    /// <li>
177    /// <p><code>Environment</code> specifies the location where this object is hosted, or what it belongs to.</p></li>
178    /// </ul>
179    pub fn get_key_attributes(&self) -> &::std::option::Option<::std::collections::HashMap<::std::string::String, ::std::string::String>> {
180        self.inner.get_key_attributes()
181    }
182    /// <p>The name of the operation that this SLO is associated with.</p>
183    pub fn operation_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
184        self.inner = self.inner.operation_name(input.into());
185        self
186    }
187    /// <p>The name of the operation that this SLO is associated with.</p>
188    pub fn set_operation_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
189        self.inner = self.inner.set_operation_name(input);
190        self
191    }
192    /// <p>The name of the operation that this SLO is associated with.</p>
193    pub fn get_operation_name(&self) -> &::std::option::Option<::std::string::String> {
194        self.inner.get_operation_name()
195    }
196    /// <p>Identifies the dependency using the <code>DependencyKeyAttributes</code> and <code>DependencyOperationName</code>.</p>
197    pub fn dependency_config(mut self, input: crate::types::DependencyConfig) -> Self {
198        self.inner = self.inner.dependency_config(input);
199        self
200    }
201    /// <p>Identifies the dependency using the <code>DependencyKeyAttributes</code> and <code>DependencyOperationName</code>.</p>
202    pub fn set_dependency_config(mut self, input: ::std::option::Option<crate::types::DependencyConfig>) -> Self {
203        self.inner = self.inner.set_dependency_config(input);
204        self
205    }
206    /// <p>Identifies the dependency using the <code>DependencyKeyAttributes</code> and <code>DependencyOperationName</code>.</p>
207    pub fn get_dependency_config(&self) -> &::std::option::Option<crate::types::DependencyConfig> {
208        self.inner.get_dependency_config()
209    }
210    /// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.</p>
211    pub fn max_results(mut self, input: i32) -> Self {
212        self.inner = self.inner.max_results(input);
213        self
214    }
215    /// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.</p>
216    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
217        self.inner = self.inner.set_max_results(input);
218        self
219    }
220    /// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.</p>
221    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
222        self.inner.get_max_results()
223    }
224    /// <p>Include this value, if it was returned by the previous operation, to get the next set of service level objectives.</p>
225    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
226        self.inner = self.inner.next_token(input.into());
227        self
228    }
229    /// <p>Include this value, if it was returned by the previous operation, to get the next set of service level objectives.</p>
230    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
231        self.inner = self.inner.set_next_token(input);
232        self
233    }
234    /// <p>Include this value, if it was returned by the previous operation, to get the next set of service level objectives.</p>
235    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
236        self.inner.get_next_token()
237    }
238    /// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include SLO from source accounts in the returned data.</p>
239    /// <p>When you are monitoring an account, you can use Amazon Web Services account ID in <code>KeyAttribute</code> filter for service source account and <code>SloOwnerawsaccountID</code> for SLO source account with <code>IncludeLinkedAccounts</code> to filter the returned data to only a single source account.</p>
240    pub fn include_linked_accounts(mut self, input: bool) -> Self {
241        self.inner = self.inner.include_linked_accounts(input);
242        self
243    }
244    /// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include SLO from source accounts in the returned data.</p>
245    /// <p>When you are monitoring an account, you can use Amazon Web Services account ID in <code>KeyAttribute</code> filter for service source account and <code>SloOwnerawsaccountID</code> for SLO source account with <code>IncludeLinkedAccounts</code> to filter the returned data to only a single source account.</p>
246    pub fn set_include_linked_accounts(mut self, input: ::std::option::Option<bool>) -> Self {
247        self.inner = self.inner.set_include_linked_accounts(input);
248        self
249    }
250    /// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include SLO from source accounts in the returned data.</p>
251    /// <p>When you are monitoring an account, you can use Amazon Web Services account ID in <code>KeyAttribute</code> filter for service source account and <code>SloOwnerawsaccountID</code> for SLO source account with <code>IncludeLinkedAccounts</code> to filter the returned data to only a single source account.</p>
252    pub fn get_include_linked_accounts(&self) -> &::std::option::Option<bool> {
253        self.inner.get_include_linked_accounts()
254    }
255    /// <p>SLO's Amazon Web Services account ID.</p>
256    pub fn slo_owner_aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
257        self.inner = self.inner.slo_owner_aws_account_id(input.into());
258        self
259    }
260    /// <p>SLO's Amazon Web Services account ID.</p>
261    pub fn set_slo_owner_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
262        self.inner = self.inner.set_slo_owner_aws_account_id(input);
263        self
264    }
265    /// <p>SLO's Amazon Web Services account ID.</p>
266    pub fn get_slo_owner_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
267        self.inner.get_slo_owner_aws_account_id()
268    }
269    ///
270    /// Appends an item to `MetricSourceTypes`.
271    ///
272    /// To override the contents of this collection use [`set_metric_source_types`](Self::set_metric_source_types).
273    ///
274    /// <p>Use this optional field to only include SLOs with the specified metric source types in the output. Supported types are:</p>
275    /// <ul>
276    /// <li>
277    /// <p>Service operation</p></li>
278    /// <li>
279    /// <p>Service dependency</p></li>
280    /// <li>
281    /// <p>CloudWatch metric</p></li>
282    /// </ul>
283    pub fn metric_source_types(mut self, input: crate::types::MetricSourceType) -> Self {
284        self.inner = self.inner.metric_source_types(input);
285        self
286    }
287    /// <p>Use this optional field to only include SLOs with the specified metric source types in the output. Supported types are:</p>
288    /// <ul>
289    /// <li>
290    /// <p>Service operation</p></li>
291    /// <li>
292    /// <p>Service dependency</p></li>
293    /// <li>
294    /// <p>CloudWatch metric</p></li>
295    /// </ul>
296    pub fn set_metric_source_types(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::MetricSourceType>>) -> Self {
297        self.inner = self.inner.set_metric_source_types(input);
298        self
299    }
300    /// <p>Use this optional field to only include SLOs with the specified metric source types in the output. Supported types are:</p>
301    /// <ul>
302    /// <li>
303    /// <p>Service operation</p></li>
304    /// <li>
305    /// <p>Service dependency</p></li>
306    /// <li>
307    /// <p>CloudWatch metric</p></li>
308    /// </ul>
309    pub fn get_metric_source_types(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::MetricSourceType>> {
310        self.inner.get_metric_source_types()
311    }
312}