// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::get_log_object::_get_log_object_output::GetLogObjectOutputBuilder;
pub use crate::operation::get_log_object::_get_log_object_input::GetLogObjectInputBuilder;
impl crate::operation::get_log_object::builders::GetLogObjectInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::get_log_object::GetLogObjectOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_log_object::GetLogObjectError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.get_log_object();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `GetLogObject`.
///
/// <p>Retrieves a large logging object (LLO) and streams it back. This API is used to fetch the content of large portions of log events that have been ingested through the PutOpenTelemetryLogs API. When log events contain fields that would cause the total event size to exceed 1MB, CloudWatch Logs automatically processes up to 10 fields, starting with the largest fields. Each field is truncated as needed to keep the total event size as close to 1MB as possible. The excess portions are stored as Large Log Objects (LLOs) and these fields are processed separately and LLO reference system fields (in the format <code>@ptr.$\[path.to.field\]</code>) are added. The path in the reference field reflects the original JSON structure where the large field was located. For example, this could be <code>@ptr.$\['input'\]\['message'\]</code>, <code>@ptr.$\['AAA'\]\['BBB'\]\['CCC'\]\['DDD'\]</code>, <code>@ptr.$\['AAA'\]</code>, or any other path matching your log structure.</p>
///
/// [`GetLogObjectOutput`](crate::operation::get_log_object::GetLogObjectOutput) contains an event stream field as well as one or more non-event stream fields.
/// Due to its current implementation, the non-event stream fields are not fully deserialized
/// until the [`send`](Self::send) method completes. As a result, accessing these fields of the operation
/// output struct within an interceptor may return uninitialized values.
///
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct GetLogObjectFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::get_log_object::builders::GetLogObjectInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::get_log_object::GetLogObjectOutput,
crate::operation::get_log_object::GetLogObjectError,
> for GetLogObjectFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::get_log_object::GetLogObjectOutput,
crate::operation::get_log_object::GetLogObjectError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl GetLogObjectFluentBuilder {
/// Creates a new `GetLogObjectFluentBuilder`.
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 GetLogObject as a reference.
pub fn as_input(&self) -> &crate::operation::get_log_object::builders::GetLogObjectInputBuilder {
&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::get_log_object::GetLogObjectOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_log_object::GetLogObjectError,
::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::get_log_object::GetLogObject::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
let mut output = crate::operation::get_log_object::GetLogObject::orchestrate(&runtime_plugins, input).await?;
// Converts any error encountered beyond this point into an `SdkError` response error
// with an `HttpResponse`. However, since we have already exited the `orchestrate`
// function, the original `HttpResponse` is no longer available and cannot be restored.
// This means that header information from the original response has been lost.
//
// Note that the response body would have been consumed by the deserializer
// regardless, even if the initial message was hypothetically processed during
// the orchestrator's deserialization phase but later resulted in an error.
fn response_error(
err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
) -> ::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::get_log_object::GetLogObjectError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
> {
::aws_smithy_runtime_api::client::result::SdkError::response_error(
err,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
::aws_smithy_types::body::SdkBody::empty(),
),
)
}
let message = output.field_stream.try_recv_initial_response().await.map_err(response_error)?;
match message {
::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
::std::option::Option::None => ::std::result::Result::Ok(output),
}
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::get_log_object::GetLogObjectOutput,
crate::operation::get_log_object::GetLogObjectError,
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>A boolean flag that indicates whether to unmask sensitive log data. When set to true, any masked or redacted data in the log object will be displayed in its original form. Default is false.</p>
pub fn unmask(mut self, input: bool) -> Self {
self.inner = self.inner.unmask(input);
self
}
/// <p>A boolean flag that indicates whether to unmask sensitive log data. When set to true, any masked or redacted data in the log object will be displayed in its original form. Default is false.</p>
pub fn set_unmask(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_unmask(input);
self
}
/// <p>A boolean flag that indicates whether to unmask sensitive log data. When set to true, any masked or redacted data in the log object will be displayed in its original form. Default is false.</p>
pub fn get_unmask(&self) -> &::std::option::Option<bool> {
self.inner.get_unmask()
}
/// <p>A pointer to the specific log object to retrieve. This is a required parameter that uniquely identifies the log object within CloudWatch Logs. The pointer is typically obtained from a previous query or filter operation.</p>
pub fn log_object_pointer(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.log_object_pointer(input.into());
self
}
/// <p>A pointer to the specific log object to retrieve. This is a required parameter that uniquely identifies the log object within CloudWatch Logs. The pointer is typically obtained from a previous query or filter operation.</p>
pub fn set_log_object_pointer(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_log_object_pointer(input);
self
}
/// <p>A pointer to the specific log object to retrieve. This is a required parameter that uniquely identifies the log object within CloudWatch Logs. The pointer is typically obtained from a previous query or filter operation.</p>
pub fn get_log_object_pointer(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_log_object_pointer()
}
}