aws_sdk_xray/operation/get_trace_summaries/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_trace_summaries::_get_trace_summaries_output::GetTraceSummariesOutputBuilder;
3
4pub use crate::operation::get_trace_summaries::_get_trace_summaries_input::GetTraceSummariesInputBuilder;
5
6impl crate::operation::get_trace_summaries::builders::GetTraceSummariesInputBuilder {
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_trace_summaries::GetTraceSummariesOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_trace_summaries::GetTraceSummariesError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_trace_summaries();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetTraceSummaries`.
24///
25/// <p>Retrieves IDs and annotations for traces available for a specified time frame using an optional filter. To get the full traces, pass the trace IDs to <code>BatchGetTraces</code>.</p>
26/// <p>A filter expression can target traced requests that hit specific service nodes or edges, have errors, or come from a known user. For example, the following filter expression targets traces that pass through <code>api.example.com</code>:</p>
27/// <p><code>service("api.example.com")</code></p>
28/// <p>This filter expression finds traces that have an annotation named <code>account</code> with the value <code>12345</code>:</p>
29/// <p><code>annotation.account = "12345"</code></p>
30/// <p>For a full list of indexed fields and keywords that you can use in filter expressions, see <a href="https://docs.aws.amazon.com/xray/latest/devguide/aws-xray-interface-console.html#xray-console-filters">Use filter expressions</a> in the <i>Amazon Web Services X-Ray Developer Guide</i>.</p>
31#[derive(::std::clone::Clone, ::std::fmt::Debug)]
32pub struct GetTraceSummariesFluentBuilder {
33    handle: ::std::sync::Arc<crate::client::Handle>,
34    inner: crate::operation::get_trace_summaries::builders::GetTraceSummariesInputBuilder,
35    config_override: ::std::option::Option<crate::config::Builder>,
36}
37impl
38    crate::client::customize::internal::CustomizableSend<
39        crate::operation::get_trace_summaries::GetTraceSummariesOutput,
40        crate::operation::get_trace_summaries::GetTraceSummariesError,
41    > for GetTraceSummariesFluentBuilder
42{
43    fn send(
44        self,
45        config_override: crate::config::Builder,
46    ) -> crate::client::customize::internal::BoxFuture<
47        crate::client::customize::internal::SendResult<
48            crate::operation::get_trace_summaries::GetTraceSummariesOutput,
49            crate::operation::get_trace_summaries::GetTraceSummariesError,
50        >,
51    > {
52        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
53    }
54}
55impl GetTraceSummariesFluentBuilder {
56    /// Creates a new `GetTraceSummariesFluentBuilder`.
57    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
58        Self {
59            handle,
60            inner: ::std::default::Default::default(),
61            config_override: ::std::option::Option::None,
62        }
63    }
64    /// Access the GetTraceSummaries as a reference.
65    pub fn as_input(&self) -> &crate::operation::get_trace_summaries::builders::GetTraceSummariesInputBuilder {
66        &self.inner
67    }
68    /// Sends the request and returns the response.
69    ///
70    /// If an error occurs, an `SdkError` will be returned with additional details that
71    /// can be matched against.
72    ///
73    /// By default, any retryable failures will be retried twice. Retry behavior
74    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
75    /// set when configuring the client.
76    pub async fn send(
77        self,
78    ) -> ::std::result::Result<
79        crate::operation::get_trace_summaries::GetTraceSummariesOutput,
80        ::aws_smithy_runtime_api::client::result::SdkError<
81            crate::operation::get_trace_summaries::GetTraceSummariesError,
82            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
83        >,
84    > {
85        let input = self
86            .inner
87            .build()
88            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
89        let runtime_plugins = crate::operation::get_trace_summaries::GetTraceSummaries::operation_runtime_plugins(
90            self.handle.runtime_plugins.clone(),
91            &self.handle.conf,
92            self.config_override,
93        );
94        crate::operation::get_trace_summaries::GetTraceSummaries::orchestrate(&runtime_plugins, input).await
95    }
96
97    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
98    pub fn customize(
99        self,
100    ) -> crate::client::customize::CustomizableOperation<
101        crate::operation::get_trace_summaries::GetTraceSummariesOutput,
102        crate::operation::get_trace_summaries::GetTraceSummariesError,
103        Self,
104    > {
105        crate::client::customize::CustomizableOperation::new(self)
106    }
107    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
108        self.set_config_override(::std::option::Option::Some(config_override.into()));
109        self
110    }
111
112    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
113        self.config_override = config_override;
114        self
115    }
116    /// Create a paginator for this request
117    ///
118    /// Paginators are used by calling [`send().await`](crate::operation::get_trace_summaries::paginator::GetTraceSummariesPaginator::send) which returns a [`PaginationStream`](aws_smithy_async::future::pagination_stream::PaginationStream).
119    pub fn into_paginator(self) -> crate::operation::get_trace_summaries::paginator::GetTraceSummariesPaginator {
120        crate::operation::get_trace_summaries::paginator::GetTraceSummariesPaginator::new(self.handle, self.inner)
121    }
122    /// <p>The start of the time frame for which to retrieve traces.</p>
123    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
124        self.inner = self.inner.start_time(input);
125        self
126    }
127    /// <p>The start of the time frame for which to retrieve traces.</p>
128    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
129        self.inner = self.inner.set_start_time(input);
130        self
131    }
132    /// <p>The start of the time frame for which to retrieve traces.</p>
133    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
134        self.inner.get_start_time()
135    }
136    /// <p>The end of the time frame for which to retrieve traces.</p>
137    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
138        self.inner = self.inner.end_time(input);
139        self
140    }
141    /// <p>The end of the time frame for which to retrieve traces.</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 frame for which to retrieve traces.</p>
147    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
148        self.inner.get_end_time()
149    }
150    /// <p>Query trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).</p>
151    pub fn time_range_type(mut self, input: crate::types::TimeRangeType) -> Self {
152        self.inner = self.inner.time_range_type(input);
153        self
154    }
155    /// <p>Query trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).</p>
156    pub fn set_time_range_type(mut self, input: ::std::option::Option<crate::types::TimeRangeType>) -> Self {
157        self.inner = self.inner.set_time_range_type(input);
158        self
159    }
160    /// <p>Query trace summaries by TraceId (trace start time), Event (trace update time), or Service (trace segment end time).</p>
161    pub fn get_time_range_type(&self) -> &::std::option::Option<crate::types::TimeRangeType> {
162        self.inner.get_time_range_type()
163    }
164    /// <p>Set to <code>true</code> to get summaries for only a subset of available traces.</p>
165    pub fn sampling(mut self, input: bool) -> Self {
166        self.inner = self.inner.sampling(input);
167        self
168    }
169    /// <p>Set to <code>true</code> to get summaries for only a subset of available traces.</p>
170    pub fn set_sampling(mut self, input: ::std::option::Option<bool>) -> Self {
171        self.inner = self.inner.set_sampling(input);
172        self
173    }
174    /// <p>Set to <code>true</code> to get summaries for only a subset of available traces.</p>
175    pub fn get_sampling(&self) -> &::std::option::Option<bool> {
176        self.inner.get_sampling()
177    }
178    /// <p>A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.</p>
179    pub fn sampling_strategy(mut self, input: crate::types::SamplingStrategy) -> Self {
180        self.inner = self.inner.sampling_strategy(input);
181        self
182    }
183    /// <p>A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.</p>
184    pub fn set_sampling_strategy(mut self, input: ::std::option::Option<crate::types::SamplingStrategy>) -> Self {
185        self.inner = self.inner.set_sampling_strategy(input);
186        self
187    }
188    /// <p>A parameter to indicate whether to enable sampling on trace summaries. Input parameters are Name and Value.</p>
189    pub fn get_sampling_strategy(&self) -> &::std::option::Option<crate::types::SamplingStrategy> {
190        self.inner.get_sampling_strategy()
191    }
192    /// <p>Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.</p>
193    pub fn filter_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.inner = self.inner.filter_expression(input.into());
195        self
196    }
197    /// <p>Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.</p>
198    pub fn set_filter_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
199        self.inner = self.inner.set_filter_expression(input);
200        self
201    }
202    /// <p>Specify a filter expression to retrieve trace summaries for services or requests that meet certain requirements.</p>
203    pub fn get_filter_expression(&self) -> &::std::option::Option<::std::string::String> {
204        self.inner.get_filter_expression()
205    }
206    /// <p>Specify the pagination token returned by a previous request to retrieve the next page of results.</p>
207    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
208        self.inner = self.inner.next_token(input.into());
209        self
210    }
211    /// <p>Specify the pagination token returned by a previous request to retrieve the next page of results.</p>
212    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
213        self.inner = self.inner.set_next_token(input);
214        self
215    }
216    /// <p>Specify the pagination token returned by a previous request to retrieve the next page of results.</p>
217    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_next_token()
219    }
220}