aws_sdk_cloudfront/operation/update_realtime_log_config/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::update_realtime_log_config::_update_realtime_log_config_output::UpdateRealtimeLogConfigOutputBuilder;
3
4pub use crate::operation::update_realtime_log_config::_update_realtime_log_config_input::UpdateRealtimeLogConfigInputBuilder;
5
6impl crate::operation::update_realtime_log_config::builders::UpdateRealtimeLogConfigInputBuilder {
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::update_realtime_log_config::UpdateRealtimeLogConfigOutput,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigError,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.update_realtime_log_config();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `UpdateRealtimeLogConfig`.
24///
25/// <p>Updates a real-time log configuration.</p>
26/// <p>When you update a real-time log configuration, all the parameters are updated with the values provided in the request. You cannot update some parameters independent of others. To update a real-time log configuration:</p>
27/// <ol>
28/// <li>
29/// <p>Call <code>GetRealtimeLogConfig</code> to get the current real-time log configuration.</p></li>
30/// <li>
31/// <p>Locally modify the parameters in the real-time log configuration that you want to update.</p></li>
32/// <li>
33/// <p>Call this API (<code>UpdateRealtimeLogConfig</code>) by providing the entire real-time log configuration, including the parameters that you modified and those that you didn't.</p></li>
34/// </ol>
35/// <p>You cannot update a real-time log configuration's <code>Name</code> or <code>ARN</code>.</p>
36#[derive(::std::clone::Clone, ::std::fmt::Debug)]
37pub struct UpdateRealtimeLogConfigFluentBuilder {
38    handle: ::std::sync::Arc<crate::client::Handle>,
39    inner: crate::operation::update_realtime_log_config::builders::UpdateRealtimeLogConfigInputBuilder,
40    config_override: ::std::option::Option<crate::config::Builder>,
41}
42impl
43    crate::client::customize::internal::CustomizableSend<
44        crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigOutput,
45        crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigError,
46    > for UpdateRealtimeLogConfigFluentBuilder
47{
48    fn send(
49        self,
50        config_override: crate::config::Builder,
51    ) -> crate::client::customize::internal::BoxFuture<
52        crate::client::customize::internal::SendResult<
53            crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigOutput,
54            crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigError,
55        >,
56    > {
57        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
58    }
59}
60impl UpdateRealtimeLogConfigFluentBuilder {
61    /// Creates a new `UpdateRealtimeLogConfigFluentBuilder`.
62    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
63        Self {
64            handle,
65            inner: ::std::default::Default::default(),
66            config_override: ::std::option::Option::None,
67        }
68    }
69    /// Access the UpdateRealtimeLogConfig as a reference.
70    pub fn as_input(&self) -> &crate::operation::update_realtime_log_config::builders::UpdateRealtimeLogConfigInputBuilder {
71        &self.inner
72    }
73    /// Sends the request and returns the response.
74    ///
75    /// If an error occurs, an `SdkError` will be returned with additional details that
76    /// can be matched against.
77    ///
78    /// By default, any retryable failures will be retried twice. Retry behavior
79    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
80    /// set when configuring the client.
81    pub async fn send(
82        self,
83    ) -> ::std::result::Result<
84        crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigOutput,
85        ::aws_smithy_runtime_api::client::result::SdkError<
86            crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigError,
87            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
88        >,
89    > {
90        let input = self
91            .inner
92            .build()
93            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
94        let runtime_plugins = crate::operation::update_realtime_log_config::UpdateRealtimeLogConfig::operation_runtime_plugins(
95            self.handle.runtime_plugins.clone(),
96            &self.handle.conf,
97            self.config_override,
98        );
99        crate::operation::update_realtime_log_config::UpdateRealtimeLogConfig::orchestrate(&runtime_plugins, input).await
100    }
101
102    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
103    pub fn customize(
104        self,
105    ) -> crate::client::customize::CustomizableOperation<
106        crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigOutput,
107        crate::operation::update_realtime_log_config::UpdateRealtimeLogConfigError,
108        Self,
109    > {
110        crate::client::customize::CustomizableOperation::new(self)
111    }
112    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
113        self.set_config_override(::std::option::Option::Some(config_override.into()));
114        self
115    }
116
117    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
118        self.config_override = config_override;
119        self
120    }
121    ///
122    /// Appends an item to `EndPoints`.
123    ///
124    /// To override the contents of this collection use [`set_end_points`](Self::set_end_points).
125    ///
126    /// <p>Contains information about the Amazon Kinesis data stream where you are sending real-time log data.</p>
127    pub fn end_points(mut self, input: crate::types::EndPoint) -> Self {
128        self.inner = self.inner.end_points(input);
129        self
130    }
131    /// <p>Contains information about the Amazon Kinesis data stream where you are sending real-time log data.</p>
132    pub fn set_end_points(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::EndPoint>>) -> Self {
133        self.inner = self.inner.set_end_points(input);
134        self
135    }
136    /// <p>Contains information about the Amazon Kinesis data stream where you are sending real-time log data.</p>
137    pub fn get_end_points(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::EndPoint>> {
138        self.inner.get_end_points()
139    }
140    ///
141    /// Appends an item to `Fields`.
142    ///
143    /// To override the contents of this collection use [`set_fields`](Self::set_fields).
144    ///
145    /// <p>A list of fields to include in each real-time log record.</p>
146    /// <p>For more information about fields, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields">Real-time log configuration fields</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
147    pub fn fields(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
148        self.inner = self.inner.fields(input.into());
149        self
150    }
151    /// <p>A list of fields to include in each real-time log record.</p>
152    /// <p>For more information about fields, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields">Real-time log configuration fields</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
153    pub fn set_fields(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
154        self.inner = self.inner.set_fields(input);
155        self
156    }
157    /// <p>A list of fields to include in each real-time log record.</p>
158    /// <p>For more information about fields, see <a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/real-time-logs.html#understand-real-time-log-config-fields">Real-time log configuration fields</a> in the <i>Amazon CloudFront Developer Guide</i>.</p>
159    pub fn get_fields(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
160        self.inner.get_fields()
161    }
162    /// <p>The name for this real-time log configuration.</p>
163    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
164        self.inner = self.inner.name(input.into());
165        self
166    }
167    /// <p>The name for this real-time log configuration.</p>
168    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
169        self.inner = self.inner.set_name(input);
170        self
171    }
172    /// <p>The name for this real-time log configuration.</p>
173    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
174        self.inner.get_name()
175    }
176    /// <p>The Amazon Resource Name (ARN) for this real-time log configuration.</p>
177    pub fn arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
178        self.inner = self.inner.arn(input.into());
179        self
180    }
181    /// <p>The Amazon Resource Name (ARN) for this real-time log configuration.</p>
182    pub fn set_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
183        self.inner = self.inner.set_arn(input);
184        self
185    }
186    /// <p>The Amazon Resource Name (ARN) for this real-time log configuration.</p>
187    pub fn get_arn(&self) -> &::std::option::Option<::std::string::String> {
188        self.inner.get_arn()
189    }
190    /// <p>The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer requests that are represented in the real-time log data. You must provide an integer between 1 and 100, inclusive.</p>
191    pub fn sampling_rate(mut self, input: i64) -> Self {
192        self.inner = self.inner.sampling_rate(input);
193        self
194    }
195    /// <p>The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer requests that are represented in the real-time log data. You must provide an integer between 1 and 100, inclusive.</p>
196    pub fn set_sampling_rate(mut self, input: ::std::option::Option<i64>) -> Self {
197        self.inner = self.inner.set_sampling_rate(input);
198        self
199    }
200    /// <p>The sampling rate for this real-time log configuration. The sampling rate determines the percentage of viewer requests that are represented in the real-time log data. You must provide an integer between 1 and 100, inclusive.</p>
201    pub fn get_sampling_rate(&self) -> &::std::option::Option<i64> {
202        self.inner.get_sampling_rate()
203    }
204}