aws_sdk_lightsail/operation/get_relational_database_log_events/builders.rs
1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::get_relational_database_log_events::_get_relational_database_log_events_output::GetRelationalDatabaseLogEventsOutputBuilder;
3
4pub use crate::operation::get_relational_database_log_events::_get_relational_database_log_events_input::GetRelationalDatabaseLogEventsInputBuilder;
5
6impl crate::operation::get_relational_database_log_events::builders::GetRelationalDatabaseLogEventsInputBuilder {
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_relational_database_log_events::GetRelationalDatabaseLogEventsOutput,
13 ::aws_smithy_runtime_api::client::result::SdkError<
14 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsError,
15 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16 >,
17 > {
18 let mut fluent_builder = client.get_relational_database_log_events();
19 fluent_builder.inner = self;
20 fluent_builder.send().await
21 }
22}
23/// Fluent builder constructing a request to `GetRelationalDatabaseLogEvents`.
24///
25/// <p>Returns a list of log events for a database in Amazon Lightsail.</p>
26#[derive(::std::clone::Clone, ::std::fmt::Debug)]
27pub struct GetRelationalDatabaseLogEventsFluentBuilder {
28 handle: ::std::sync::Arc<crate::client::Handle>,
29 inner: crate::operation::get_relational_database_log_events::builders::GetRelationalDatabaseLogEventsInputBuilder,
30 config_override: ::std::option::Option<crate::config::Builder>,
31}
32impl
33 crate::client::customize::internal::CustomizableSend<
34 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsOutput,
35 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsError,
36 > for GetRelationalDatabaseLogEventsFluentBuilder
37{
38 fn send(
39 self,
40 config_override: crate::config::Builder,
41 ) -> crate::client::customize::internal::BoxFuture<
42 crate::client::customize::internal::SendResult<
43 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsOutput,
44 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsError,
45 >,
46 > {
47 ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
48 }
49}
50impl GetRelationalDatabaseLogEventsFluentBuilder {
51 /// Creates a new `GetRelationalDatabaseLogEventsFluentBuilder`.
52 pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
53 Self {
54 handle,
55 inner: ::std::default::Default::default(),
56 config_override: ::std::option::Option::None,
57 }
58 }
59 /// Access the GetRelationalDatabaseLogEvents as a reference.
60 pub fn as_input(&self) -> &crate::operation::get_relational_database_log_events::builders::GetRelationalDatabaseLogEventsInputBuilder {
61 &self.inner
62 }
63 /// Sends the request and returns the response.
64 ///
65 /// If an error occurs, an `SdkError` will be returned with additional details that
66 /// can be matched against.
67 ///
68 /// By default, any retryable failures will be retried twice. Retry behavior
69 /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
70 /// set when configuring the client.
71 pub async fn send(
72 self,
73 ) -> ::std::result::Result<
74 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsOutput,
75 ::aws_smithy_runtime_api::client::result::SdkError<
76 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsError,
77 ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
78 >,
79 > {
80 let input = self
81 .inner
82 .build()
83 .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
84 let runtime_plugins = crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEvents::operation_runtime_plugins(
85 self.handle.runtime_plugins.clone(),
86 &self.handle.conf,
87 self.config_override,
88 );
89 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEvents::orchestrate(&runtime_plugins, input).await
90 }
91
92 /// Consumes this builder, creating a customizable operation that can be modified before being sent.
93 pub fn customize(
94 self,
95 ) -> crate::client::customize::CustomizableOperation<
96 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsOutput,
97 crate::operation::get_relational_database_log_events::GetRelationalDatabaseLogEventsError,
98 Self,
99 > {
100 crate::client::customize::CustomizableOperation::new(self)
101 }
102 pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
103 self.set_config_override(::std::option::Option::Some(config_override.into()));
104 self
105 }
106
107 pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
108 self.config_override = config_override;
109 self
110 }
111 /// <p>The name of your database for which to get log events.</p>
112 pub fn relational_database_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
113 self.inner = self.inner.relational_database_name(input.into());
114 self
115 }
116 /// <p>The name of your database for which to get log events.</p>
117 pub fn set_relational_database_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
118 self.inner = self.inner.set_relational_database_name(input);
119 self
120 }
121 /// <p>The name of your database for which to get log events.</p>
122 pub fn get_relational_database_name(&self) -> &::std::option::Option<::std::string::String> {
123 self.inner.get_relational_database_name()
124 }
125 /// <p>The name of the log stream.</p>
126 /// <p>Use the <code>get relational database log streams</code> operation to get a list of available log streams.</p>
127 pub fn log_stream_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
128 self.inner = self.inner.log_stream_name(input.into());
129 self
130 }
131 /// <p>The name of the log stream.</p>
132 /// <p>Use the <code>get relational database log streams</code> operation to get a list of available log streams.</p>
133 pub fn set_log_stream_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
134 self.inner = self.inner.set_log_stream_name(input);
135 self
136 }
137 /// <p>The name of the log stream.</p>
138 /// <p>Use the <code>get relational database log streams</code> operation to get a list of available log streams.</p>
139 pub fn get_log_stream_name(&self) -> &::std::option::Option<::std::string::String> {
140 self.inner.get_log_stream_name()
141 }
142 /// <p>The start of the time interval from which to get log events.</p>
143 /// <p>Constraints:</p>
144 /// <ul>
145 /// <li>
146 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
147 /// <li>
148 /// <p>Specified in the Unix time format.</p>
149 /// <p>For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the start time.</p></li>
150 /// </ul>
151 pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
152 self.inner = self.inner.start_time(input);
153 self
154 }
155 /// <p>The start of the time interval from which to get log events.</p>
156 /// <p>Constraints:</p>
157 /// <ul>
158 /// <li>
159 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
160 /// <li>
161 /// <p>Specified in the Unix time format.</p>
162 /// <p>For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the start time.</p></li>
163 /// </ul>
164 pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
165 self.inner = self.inner.set_start_time(input);
166 self
167 }
168 /// <p>The start of the time interval from which to get log events.</p>
169 /// <p>Constraints:</p>
170 /// <ul>
171 /// <li>
172 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
173 /// <li>
174 /// <p>Specified in the Unix time format.</p>
175 /// <p>For example, if you wish to use a start time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the start time.</p></li>
176 /// </ul>
177 pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
178 self.inner.get_start_time()
179 }
180 /// <p>The end of the time interval from which to get log events.</p>
181 /// <p>Constraints:</p>
182 /// <ul>
183 /// <li>
184 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
185 /// <li>
186 /// <p>Specified in the Unix time format.</p>
187 /// <p>For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the end time.</p></li>
188 /// </ul>
189 pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
190 self.inner = self.inner.end_time(input);
191 self
192 }
193 /// <p>The end of the time interval from which to get log events.</p>
194 /// <p>Constraints:</p>
195 /// <ul>
196 /// <li>
197 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
198 /// <li>
199 /// <p>Specified in the Unix time format.</p>
200 /// <p>For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the end time.</p></li>
201 /// </ul>
202 pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
203 self.inner = self.inner.set_end_time(input);
204 self
205 }
206 /// <p>The end of the time interval from which to get log events.</p>
207 /// <p>Constraints:</p>
208 /// <ul>
209 /// <li>
210 /// <p>Specified in Coordinated Universal Time (UTC).</p></li>
211 /// <li>
212 /// <p>Specified in the Unix time format.</p>
213 /// <p>For example, if you wish to use an end time of October 1, 2018, at 8 PM UTC, then you input <code>1538424000</code> as the end time.</p></li>
214 /// </ul>
215 pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
216 self.inner.get_end_time()
217 }
218 /// <p>Parameter to specify if the log should start from head or tail. If <code>true</code> is specified, the log event starts from the head of the log. If <code>false</code> is specified, the log event starts from the tail of the log.</p><note>
219 /// <p>For PostgreSQL, the default value of <code>false</code> is the only option available.</p>
220 /// </note>
221 pub fn start_from_head(mut self, input: bool) -> Self {
222 self.inner = self.inner.start_from_head(input);
223 self
224 }
225 /// <p>Parameter to specify if the log should start from head or tail. If <code>true</code> is specified, the log event starts from the head of the log. If <code>false</code> is specified, the log event starts from the tail of the log.</p><note>
226 /// <p>For PostgreSQL, the default value of <code>false</code> is the only option available.</p>
227 /// </note>
228 pub fn set_start_from_head(mut self, input: ::std::option::Option<bool>) -> Self {
229 self.inner = self.inner.set_start_from_head(input);
230 self
231 }
232 /// <p>Parameter to specify if the log should start from head or tail. If <code>true</code> is specified, the log event starts from the head of the log. If <code>false</code> is specified, the log event starts from the tail of the log.</p><note>
233 /// <p>For PostgreSQL, the default value of <code>false</code> is the only option available.</p>
234 /// </note>
235 pub fn get_start_from_head(&self) -> &::std::option::Option<bool> {
236 self.inner.get_start_from_head()
237 }
238 /// <p>The token to advance to the next or previous page of results from your request.</p>
239 /// <p>To get a page token, perform an initial <code>GetRelationalDatabaseLogEvents</code> request. If your results are paginated, the response will return a next forward token and/or next backward token that you can specify as the page token in a subsequent request.</p>
240 pub fn page_token(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
241 self.inner = self.inner.page_token(input.into());
242 self
243 }
244 /// <p>The token to advance to the next or previous page of results from your request.</p>
245 /// <p>To get a page token, perform an initial <code>GetRelationalDatabaseLogEvents</code> request. If your results are paginated, the response will return a next forward token and/or next backward token that you can specify as the page token in a subsequent request.</p>
246 pub fn set_page_token(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
247 self.inner = self.inner.set_page_token(input);
248 self
249 }
250 /// <p>The token to advance to the next or previous page of results from your request.</p>
251 /// <p>To get a page token, perform an initial <code>GetRelationalDatabaseLogEvents</code> request. If your results are paginated, the response will return a next forward token and/or next backward token that you can specify as the page token in a subsequent request.</p>
252 pub fn get_page_token(&self) -> &::std::option::Option<::std::string::String> {
253 self.inner.get_page_token()
254 }
255}