aws_sdk_cloudwatchlogs/operation/get_log_object/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_log_object::_get_log_object_output::GetLogObjectOutputBuilder;
3
4pub use crate::operation::get_log_object::_get_log_object_input::GetLogObjectInputBuilder;
5
6impl crate::operation::get_log_object::builders::GetLogObjectInputBuilder {
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_log_object::GetLogObjectOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::get_log_object::GetLogObjectError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.get_log_object();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `GetLogObject`.
24///
25/// <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>
26///
27/// [`GetLogObjectOutput`](crate::operation::get_log_object::GetLogObjectOutput) contains an event stream field as well as one or more non-event stream fields.
28/// Due to its current implementation, the non-event stream fields are not fully deserialized
29/// until the [`send`](Self::send) method completes. As a result, accessing these fields of the operation
30/// output struct within an interceptor may return uninitialized values.
31///
32#[derive(::std::clone::Clone, ::std::fmt::Debug)]
33pub struct GetLogObjectFluentBuilder {
34    handle: ::std::sync::Arc<crate::client::Handle>,
35    inner: crate::operation::get_log_object::builders::GetLogObjectInputBuilder,
36    config_override: ::std::option::Option<crate::config::Builder>,
37}
38impl
39    crate::client::customize::internal::CustomizableSend<
40        crate::operation::get_log_object::GetLogObjectOutput,
41        crate::operation::get_log_object::GetLogObjectError,
42    > for GetLogObjectFluentBuilder
43{
44    fn send(
45        self,
46        config_override: crate::config::Builder,
47    ) -> crate::client::customize::internal::BoxFuture<
48        crate::client::customize::internal::SendResult<
49            crate::operation::get_log_object::GetLogObjectOutput,
50            crate::operation::get_log_object::GetLogObjectError,
51        >,
52    > {
53        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
54    }
55}
56impl GetLogObjectFluentBuilder {
57    /// Creates a new `GetLogObjectFluentBuilder`.
58    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
59        Self {
60            handle,
61            inner: ::std::default::Default::default(),
62            config_override: ::std::option::Option::None,
63        }
64    }
65    /// Access the GetLogObject as a reference.
66    pub fn as_input(&self) -> &crate::operation::get_log_object::builders::GetLogObjectInputBuilder {
67        &self.inner
68    }
69    /// Sends the request and returns the response.
70    ///
71    /// If an error occurs, an `SdkError` will be returned with additional details that
72    /// can be matched against.
73    ///
74    /// By default, any retryable failures will be retried twice. Retry behavior
75    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
76    /// set when configuring the client.
77    pub async fn send(
78        self,
79    ) -> ::std::result::Result<
80        crate::operation::get_log_object::GetLogObjectOutput,
81        ::aws_smithy_runtime_api::client::result::SdkError<
82            crate::operation::get_log_object::GetLogObjectError,
83            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
84        >,
85    > {
86        let input = self
87            .inner
88            .build()
89            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
90        let runtime_plugins = crate::operation::get_log_object::GetLogObject::operation_runtime_plugins(
91            self.handle.runtime_plugins.clone(),
92            &self.handle.conf,
93            self.config_override,
94        );
95        let mut output = crate::operation::get_log_object::GetLogObject::orchestrate(&runtime_plugins, input).await?;
96
97        // Converts any error encountered beyond this point into an `SdkError` response error
98        // with an `HttpResponse`. However, since we have already exited the `orchestrate`
99        // function, the original `HttpResponse` is no longer available and cannot be restored.
100        // This means that header information from the original response has been lost.
101        //
102        // Note that the response body would have been consumed by the deserializer
103        // regardless, even if the initial message was hypothetically processed during
104        // the orchestrator's deserialization phase but later resulted in an error.
105        fn response_error(
106            err: impl ::std::convert::Into<::aws_smithy_runtime_api::box_error::BoxError>,
107        ) -> ::aws_smithy_runtime_api::client::result::SdkError<
108            crate::operation::get_log_object::GetLogObjectError,
109            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
110        > {
111            ::aws_smithy_runtime_api::client::result::SdkError::response_error(
112                err,
113                ::aws_smithy_runtime_api::client::orchestrator::HttpResponse::new(
114                    ::aws_smithy_runtime_api::http::StatusCode::try_from(200).expect("valid successful code"),
115                    ::aws_smithy_types::body::SdkBody::empty(),
116                ),
117            )
118        }
119
120        let message = output.field_stream.try_recv_initial_response().await.map_err(response_error)?;
121
122        match message {
123            ::std::option::Option::Some(_message) => ::std::result::Result::Ok(output),
124            ::std::option::Option::None => ::std::result::Result::Ok(output),
125        }
126    }
127
128    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
129    pub fn customize(
130        self,
131    ) -> crate::client::customize::CustomizableOperation<
132        crate::operation::get_log_object::GetLogObjectOutput,
133        crate::operation::get_log_object::GetLogObjectError,
134        Self,
135    > {
136        crate::client::customize::CustomizableOperation::new(self)
137    }
138    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
139        self.set_config_override(::std::option::Option::Some(config_override.into()));
140        self
141    }
142
143    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
144        self.config_override = config_override;
145        self
146    }
147    /// <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>
148    pub fn unmask(mut self, input: bool) -> Self {
149        self.inner = self.inner.unmask(input);
150        self
151    }
152    /// <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>
153    pub fn set_unmask(mut self, input: ::std::option::Option<bool>) -> Self {
154        self.inner = self.inner.set_unmask(input);
155        self
156    }
157    /// <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>
158    pub fn get_unmask(&self) -> &::std::option::Option<bool> {
159        self.inner.get_unmask()
160    }
161    /// <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>
162    pub fn log_object_pointer(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
163        self.inner = self.inner.log_object_pointer(input.into());
164        self
165    }
166    /// <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>
167    pub fn set_log_object_pointer(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
168        self.inner = self.inner.set_log_object_pointer(input);
169        self
170    }
171    /// <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>
172    pub fn get_log_object_pointer(&self) -> &::std::option::Option<::std::string::String> {
173        self.inner.get_log_object_pointer()
174    }
175}