aws_sdk_applicationsignals/operation/list_services/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::list_services::_list_services_output::ListServicesOutputBuilder;
3
4pub use crate::operation::list_services::_list_services_input::ListServicesInputBuilder;
5
6impl crate::operation::list_services::builders::ListServicesInputBuilder {
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_services::ListServicesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::list_services::ListServicesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.list_services();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ListServices`.
24///
25/// <p>Returns a list of services that have been discovered by Application Signals. A service represents a minimum logical and transactional unit that completes a business function. Services are discovered through Application Signals instrumentation.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct ListServicesFluentBuilder {
28    handle: ::std::sync::Arc<crate::client::Handle>,
29    inner: crate::operation::list_services::builders::ListServicesInputBuilder,
30    config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33    crate::client::customize::internal::CustomizableSend<
34        crate::operation::list_services::ListServicesOutput,
35        crate::operation::list_services::ListServicesError,
36    > for ListServicesFluentBuilder
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_services::ListServicesOutput,
44            crate::operation::list_services::ListServicesError,
45        >,
46    > {
47        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48    }
49}
50impl ListServicesFluentBuilder {
51    /// Creates a new `ListServicesFluentBuilder`.
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 ListServices as a reference.
60    pub fn as_input(&self) -> &crate::operation::list_services::builders::ListServicesInputBuilder {
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_services::ListServicesOutput,
75        ::aws_smithy_runtime_api::client::result::SdkError<
76            crate::operation::list_services::ListServicesError,
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_services::ListServices::operation_runtime_plugins(
85            self.handle.runtime_plugins.clone(),
86            &self.handle.conf,
87            self.config_override,
88        );
89        crate::operation::list_services::ListServices::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_services::ListServicesOutput,
97        crate::operation::list_services::ListServicesError,
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_services::paginator::ListServicesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
114    pub fn into_paginator(self) -> crate::operation::list_services::paginator::ListServicesPaginator {
115        crate::operation::list_services::paginator::ListServicesPaginator::new(self.handle, self.inner)
116    }
117    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
118    /// <p>Your requested start time will be rounded to the nearest hour.</p>
119    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
120        self.inner = self.inner.start_time(input);
121        self
122    }
123    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
124    /// <p>Your requested start time will be rounded to the nearest hour.</p>
125    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
126        self.inner = self.inner.set_start_time(input);
127        self
128    }
129    /// <p>The start of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
130    /// <p>Your requested start time will be rounded to the nearest hour.</p>
131    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
132        self.inner.get_start_time()
133    }
134    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
135    /// <p>Your requested start time will be rounded to the nearest hour.</p>
136    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
137        self.inner = self.inner.end_time(input);
138        self
139    }
140    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
141    /// <p>Your requested start time will be rounded to the nearest hour.</p>
142    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
143        self.inner = self.inner.set_end_time(input);
144        self
145    }
146    /// <p>The end of the time period to retrieve information about. When used in a raw HTTP Query API, it is formatted as be epoch time in seconds. For example: <code>1698778057</code></p>
147    /// <p>Your requested start time will be rounded to the nearest hour.</p>
148    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
149        self.inner.get_end_time()
150    }
151    /// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.</p>
152    pub fn max_results(mut self, input: i32) -> Self {
153        self.inner = self.inner.max_results(input);
154        self
155    }
156    /// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.</p>
157    pub fn set_max_results(mut self, input: ::std::option::Option<i32>) -> Self {
158        self.inner = self.inner.set_max_results(input);
159        self
160    }
161    /// <p>The maximum number of results to return in one operation. If you omit this parameter, the default of 50 is used.</p>
162    pub fn get_max_results(&self) -> &::std::option::Option<i32> {
163        self.inner.get_max_results()
164    }
165    /// <p>Include this value, if it was returned by the previous operation, to get the next set of services.</p>
166    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
167        self.inner = self.inner.next_token(input.into());
168        self
169    }
170    /// <p>Include this value, if it was returned by the previous operation, to get the next set of services.</p>
171    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
172        self.inner = self.inner.set_next_token(input);
173        self
174    }
175    /// <p>Include this value, if it was returned by the previous operation, to get the next set of services.</p>
176    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
177        self.inner.get_next_token()
178    }
179    /// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include services from source accounts in the returned data.</p>
180    pub fn include_linked_accounts(mut self, input: bool) -> Self {
181        self.inner = self.inner.include_linked_accounts(input);
182        self
183    }
184    /// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include services from source accounts in the returned data.</p>
185    pub fn set_include_linked_accounts(mut self, input: ::std::option::Option<bool>) -> Self {
186        self.inner = self.inner.set_include_linked_accounts(input);
187        self
188    }
189    /// <p>If you are using this operation in a monitoring account, specify <code>true</code> to include services from source accounts in the returned data.</p>
190    pub fn get_include_linked_accounts(&self) -> &::std::option::Option<bool> {
191        self.inner.get_include_linked_accounts()
192    }
193    /// <p>Amazon Web Services Account ID.</p>
194    pub fn aws_account_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
195        self.inner = self.inner.aws_account_id(input.into());
196        self
197    }
198    /// <p>Amazon Web Services Account ID.</p>
199    pub fn set_aws_account_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
200        self.inner = self.inner.set_aws_account_id(input);
201        self
202    }
203    /// <p>Amazon Web Services Account ID.</p>
204    pub fn get_aws_account_id(&self) -> &::std::option::Option<::std::string::String> {
205        self.inner.get_aws_account_id()
206    }
207}