aws-sdk-xray 1.96.0

AWS SDK for AWS X-Ray
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::list_retrieved_traces::_list_retrieved_traces_input::ListRetrievedTracesInputBuilder;

pub use crate::operation::list_retrieved_traces::_list_retrieved_traces_output::ListRetrievedTracesOutputBuilder;

impl crate::operation::list_retrieved_traces::builders::ListRetrievedTracesInputBuilder {
    /// Sends a request with this input using the given client.
    pub async fn send_with(
        self,
        client: &crate::Client,
    ) -> ::std::result::Result<
        crate::operation::list_retrieved_traces::ListRetrievedTracesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::list_retrieved_traces::ListRetrievedTracesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let mut fluent_builder = client.list_retrieved_traces();
        fluent_builder.inner = self;
        fluent_builder.send().await
    }
}
/// Fluent builder constructing a request to `ListRetrievedTraces`.
///
/// <p>Retrieves a list of traces for a given <code>RetrievalToken</code> from the CloudWatch log group generated by Transaction Search. For information on what each trace returns, see <a href="https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html">BatchGetTraces</a>.</p>
/// <p>This API does not initiate a retrieval process. To start a trace retrieval, use <code>StartTraceRetrieval</code>, which generates the required <code>RetrievalToken</code>.</p>
/// <p>When the <code>RetrievalStatus</code> is not <i>COMPLETE</i>, the API will return an empty response. Retry the request once the retrieval has completed to access the full list of traces.</p>
/// <p>For cross-account observability, this API can retrieve traces from linked accounts when CloudWatch log is set as the destination across relevant accounts. For more details, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html">CloudWatch cross-account observability</a>.</p>
/// <p>For retrieving data from X-Ray directly as opposed to the Transaction Search generated log group, see <a href="https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html">BatchGetTraces</a>.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct ListRetrievedTracesFluentBuilder {
    handle: ::std::sync::Arc<crate::client::Handle>,
    inner: crate::operation::list_retrieved_traces::builders::ListRetrievedTracesInputBuilder,
    config_override: ::std::option::Option<crate::config::Builder>,
}
impl
    crate::client::customize::internal::CustomizableSend<
        crate::operation::list_retrieved_traces::ListRetrievedTracesOutput,
        crate::operation::list_retrieved_traces::ListRetrievedTracesError,
    > for ListRetrievedTracesFluentBuilder
{
    fn send(
        self,
        config_override: crate::config::Builder,
    ) -> crate::client::customize::internal::BoxFuture<
        crate::client::customize::internal::SendResult<
            crate::operation::list_retrieved_traces::ListRetrievedTracesOutput,
            crate::operation::list_retrieved_traces::ListRetrievedTracesError,
        >,
    > {
        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
    }
}
impl ListRetrievedTracesFluentBuilder {
    /// Creates a new `ListRetrievedTracesFluentBuilder`.
    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
        Self {
            handle,
            inner: ::std::default::Default::default(),
            config_override: ::std::option::Option::None,
        }
    }
    /// Access the ListRetrievedTraces as a reference.
    pub fn as_input(&self) -> &crate::operation::list_retrieved_traces::builders::ListRetrievedTracesInputBuilder {
        &self.inner
    }
    /// Sends the request and returns the response.
    ///
    /// If an error occurs, an `SdkError` will be returned with additional details that
    /// can be matched against.
    ///
    /// By default, any retryable failures will be retried twice. Retry behavior
    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
    /// set when configuring the client.
    pub async fn send(
        self,
    ) -> ::std::result::Result<
        crate::operation::list_retrieved_traces::ListRetrievedTracesOutput,
        ::aws_smithy_runtime_api::client::result::SdkError<
            crate::operation::list_retrieved_traces::ListRetrievedTracesError,
            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
        >,
    > {
        let input = self
            .inner
            .build()
            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
        let runtime_plugins = crate::operation::list_retrieved_traces::ListRetrievedTraces::operation_runtime_plugins(
            self.handle.runtime_plugins.clone(),
            &self.handle.conf,
            self.config_override,
        );
        crate::operation::list_retrieved_traces::ListRetrievedTraces::orchestrate(&runtime_plugins, input).await
    }

    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
    pub fn customize(
        self,
    ) -> crate::client::customize::CustomizableOperation<
        crate::operation::list_retrieved_traces::ListRetrievedTracesOutput,
        crate::operation::list_retrieved_traces::ListRetrievedTracesError,
        Self,
    > {
        crate::client::customize::CustomizableOperation::new(self)
    }
    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
        self.set_config_override(::std::option::Option::Some(config_override.into()));
        self
    }

    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
        self.config_override = config_override;
        self
    }
    /// <p>Retrieval token.</p>
    pub fn retrieval_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.retrieval_token(input.into());
        self
    }
    /// <p>Retrieval token.</p>
    pub fn set_retrieval_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_retrieval_token(input);
        self
    }
    /// <p>Retrieval token.</p>
    pub fn get_retrieval_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_retrieval_token()
    }
    /// <p>Format of the requested traces.</p>
    pub fn trace_format(mut self, input: crate::types::TraceFormatType) -> Self {
        self.inner = self.inner.trace_format(input);
        self
    }
    /// <p>Format of the requested traces.</p>
    pub fn set_trace_format(mut self, input: ::std::option::Option<crate::types::TraceFormatType>) -> Self {
        self.inner = self.inner.set_trace_format(input);
        self
    }
    /// <p>Format of the requested traces.</p>
    pub fn get_trace_format(&self) -> &::std::option::Option<crate::types::TraceFormatType> {
        self.inner.get_trace_format()
    }
    /// <p>Specify the pagination token returned by a previous request to retrieve the next page of indexes.</p>
    pub fn next_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.inner = self.inner.next_token(input.into());
        self
    }
    /// <p>Specify the pagination token returned by a previous request to retrieve the next page of indexes.</p>
    pub fn set_next_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.inner = self.inner.set_next_token(input);
        self
    }
    /// <p>Specify the pagination token returned by a previous request to retrieve the next page of indexes.</p>
    pub fn get_next_token(&self) -> &::std::option::Option<::std::string::String> {
        self.inner.get_next_token()
    }
}