aws_sdk_qldb/operation/export_journal_to_s3/
builders.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2pub use crate::operation::export_journal_to_s3::_export_journal_to_s3_output::ExportJournalToS3OutputBuilder;
3
4pub use crate::operation::export_journal_to_s3::_export_journal_to_s3_input::ExportJournalToS3InputBuilder;
5
6impl crate::operation::export_journal_to_s3::builders::ExportJournalToS3InputBuilder {
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::export_journal_to_s3::ExportJournalToS3Output,
13        ::aws_smithy_runtime_api::client::result::SdkError<
14            crate::operation::export_journal_to_s3::ExportJournalToS3Error,
15            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
16        >,
17    > {
18        let mut fluent_builder = client.export_journal_to_s3();
19        fluent_builder.inner = self;
20        fluent_builder.send().await
21    }
22}
23/// Fluent builder constructing a request to `ExportJournalToS3`.
24///
25/// <p>Exports journal contents within a date and time range from a ledger into a specified Amazon Simple Storage Service (Amazon S3) bucket. A journal export job can write the data objects in either the text or binary representation of Amazon Ion format, or in <i>JSON Lines</i> text format.</p>
26/// <p>If the ledger with the given <code>Name</code> doesn't exist, then throws <code>ResourceNotFoundException</code>.</p>
27/// <p>If the ledger with the given <code>Name</code> is in <code>CREATING</code> status, then throws <code>ResourcePreconditionNotMetException</code>.</p>
28/// <p>You can initiate up to two concurrent journal export requests for each ledger. Beyond this limit, journal export requests throw <code>LimitExceededException</code>.</p>
29#[derive(::std::clone::Clone, ::std::fmt::Debug)]
30pub struct ExportJournalToS3FluentBuilder {
31    handle: ::std::sync::Arc<crate::client::Handle>,
32    inner: crate::operation::export_journal_to_s3::builders::ExportJournalToS3InputBuilder,
33    config_override: ::std::option::Option<crate::config::Builder>,
34}
35impl
36    crate::client::customize::internal::CustomizableSend<
37        crate::operation::export_journal_to_s3::ExportJournalToS3Output,
38        crate::operation::export_journal_to_s3::ExportJournalToS3Error,
39    > for ExportJournalToS3FluentBuilder
40{
41    fn send(
42        self,
43        config_override: crate::config::Builder,
44    ) -> crate::client::customize::internal::BoxFuture<
45        crate::client::customize::internal::SendResult<
46            crate::operation::export_journal_to_s3::ExportJournalToS3Output,
47            crate::operation::export_journal_to_s3::ExportJournalToS3Error,
48        >,
49    > {
50        ::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
51    }
52}
53impl ExportJournalToS3FluentBuilder {
54    /// Creates a new `ExportJournalToS3FluentBuilder`.
55    pub(crate) fn new(handle: ::std::sync::Arc<crate::client::Handle>) -> Self {
56        Self {
57            handle,
58            inner: ::std::default::Default::default(),
59            config_override: ::std::option::Option::None,
60        }
61    }
62    /// Access the ExportJournalToS3 as a reference.
63    pub fn as_input(&self) -> &crate::operation::export_journal_to_s3::builders::ExportJournalToS3InputBuilder {
64        &self.inner
65    }
66    /// Sends the request and returns the response.
67    ///
68    /// If an error occurs, an `SdkError` will be returned with additional details that
69    /// can be matched against.
70    ///
71    /// By default, any retryable failures will be retried twice. Retry behavior
72    /// is configurable with the [RetryConfig](aws_smithy_types::retry::RetryConfig), which can be
73    /// set when configuring the client.
74    pub async fn send(
75        self,
76    ) -> ::std::result::Result<
77        crate::operation::export_journal_to_s3::ExportJournalToS3Output,
78        ::aws_smithy_runtime_api::client::result::SdkError<
79            crate::operation::export_journal_to_s3::ExportJournalToS3Error,
80            ::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
81        >,
82    > {
83        let input = self
84            .inner
85            .build()
86            .map_err(::aws_smithy_runtime_api::client::result::SdkError::construction_failure)?;
87        let runtime_plugins = crate::operation::export_journal_to_s3::ExportJournalToS3::operation_runtime_plugins(
88            self.handle.runtime_plugins.clone(),
89            &self.handle.conf,
90            self.config_override,
91        );
92        crate::operation::export_journal_to_s3::ExportJournalToS3::orchestrate(&runtime_plugins, input).await
93    }
94
95    /// Consumes this builder, creating a customizable operation that can be modified before being sent.
96    pub fn customize(
97        self,
98    ) -> crate::client::customize::CustomizableOperation<
99        crate::operation::export_journal_to_s3::ExportJournalToS3Output,
100        crate::operation::export_journal_to_s3::ExportJournalToS3Error,
101        Self,
102    > {
103        crate::client::customize::CustomizableOperation::new(self)
104    }
105    pub(crate) fn config_override(mut self, config_override: impl ::std::convert::Into<crate::config::Builder>) -> Self {
106        self.set_config_override(::std::option::Option::Some(config_override.into()));
107        self
108    }
109
110    pub(crate) fn set_config_override(&mut self, config_override: ::std::option::Option<crate::config::Builder>) -> &mut Self {
111        self.config_override = config_override;
112        self
113    }
114    /// <p>The name of the ledger.</p>
115    pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
116        self.inner = self.inner.name(input.into());
117        self
118    }
119    /// <p>The name of the ledger.</p>
120    pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
121        self.inner = self.inner.set_name(input);
122        self
123    }
124    /// <p>The name of the ledger.</p>
125    pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
126        self.inner.get_name()
127    }
128    /// <p>The inclusive start date and time for the range of journal contents to export.</p>
129    /// <p>The <code>InclusiveStartTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code>.</p>
130    /// <p>The <code>InclusiveStartTime</code> must be before <code>ExclusiveEndTime</code>.</p>
131    /// <p>If you provide an <code>InclusiveStartTime</code> that is before the ledger's <code>CreationDateTime</code>, Amazon QLDB defaults it to the ledger's <code>CreationDateTime</code>.</p>
132    pub fn inclusive_start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
133        self.inner = self.inner.inclusive_start_time(input);
134        self
135    }
136    /// <p>The inclusive start date and time for the range of journal contents to export.</p>
137    /// <p>The <code>InclusiveStartTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code>.</p>
138    /// <p>The <code>InclusiveStartTime</code> must be before <code>ExclusiveEndTime</code>.</p>
139    /// <p>If you provide an <code>InclusiveStartTime</code> that is before the ledger's <code>CreationDateTime</code>, Amazon QLDB defaults it to the ledger's <code>CreationDateTime</code>.</p>
140    pub fn set_inclusive_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
141        self.inner = self.inner.set_inclusive_start_time(input);
142        self
143    }
144    /// <p>The inclusive start date and time for the range of journal contents to export.</p>
145    /// <p>The <code>InclusiveStartTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code>.</p>
146    /// <p>The <code>InclusiveStartTime</code> must be before <code>ExclusiveEndTime</code>.</p>
147    /// <p>If you provide an <code>InclusiveStartTime</code> that is before the ledger's <code>CreationDateTime</code>, Amazon QLDB defaults it to the ledger's <code>CreationDateTime</code>.</p>
148    pub fn get_inclusive_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
149        self.inner.get_inclusive_start_time()
150    }
151    /// <p>The exclusive end date and time for the range of journal contents to export.</p>
152    /// <p>The <code>ExclusiveEndTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code>.</p>
153    /// <p>The <code>ExclusiveEndTime</code> must be less than or equal to the current UTC date and time.</p>
154    pub fn exclusive_end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
155        self.inner = self.inner.exclusive_end_time(input);
156        self
157    }
158    /// <p>The exclusive end date and time for the range of journal contents to export.</p>
159    /// <p>The <code>ExclusiveEndTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code>.</p>
160    /// <p>The <code>ExclusiveEndTime</code> must be less than or equal to the current UTC date and time.</p>
161    pub fn set_exclusive_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
162        self.inner = self.inner.set_exclusive_end_time(input);
163        self
164    }
165    /// <p>The exclusive end date and time for the range of journal contents to export.</p>
166    /// <p>The <code>ExclusiveEndTime</code> must be in <code>ISO 8601</code> date and time format and in Universal Coordinated Time (UTC). For example: <code>2019-06-13T21:36:34Z</code>.</p>
167    /// <p>The <code>ExclusiveEndTime</code> must be less than or equal to the current UTC date and time.</p>
168    pub fn get_exclusive_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
169        self.inner.get_exclusive_end_time()
170    }
171    /// <p>The configuration settings of the Amazon S3 bucket destination for your export request.</p>
172    pub fn s3_export_configuration(mut self, input: crate::types::S3ExportConfiguration) -> Self {
173        self.inner = self.inner.s3_export_configuration(input);
174        self
175    }
176    /// <p>The configuration settings of the Amazon S3 bucket destination for your export request.</p>
177    pub fn set_s3_export_configuration(mut self, input: ::std::option::Option<crate::types::S3ExportConfiguration>) -> Self {
178        self.inner = self.inner.set_s3_export_configuration(input);
179        self
180    }
181    /// <p>The configuration settings of the Amazon S3 bucket destination for your export request.</p>
182    pub fn get_s3_export_configuration(&self) -> &::std::option::Option<crate::types::S3ExportConfiguration> {
183        self.inner.get_s3_export_configuration()
184    }
185    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:</p>
186    /// <ul>
187    /// <li>
188    /// <p>Write objects into your Amazon S3 bucket.</p></li>
189    /// <li>
190    /// <p>(Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your exported data.</p></li>
191    /// </ul>
192    /// <p>To pass a role to QLDB when requesting a journal export, you must have permissions to perform the <code>iam:PassRole</code> action on the IAM role resource. This is required for all journal export requests.</p>
193    pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
194        self.inner = self.inner.role_arn(input.into());
195        self
196    }
197    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:</p>
198    /// <ul>
199    /// <li>
200    /// <p>Write objects into your Amazon S3 bucket.</p></li>
201    /// <li>
202    /// <p>(Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your exported data.</p></li>
203    /// </ul>
204    /// <p>To pass a role to QLDB when requesting a journal export, you must have permissions to perform the <code>iam:PassRole</code> action on the IAM role resource. This is required for all journal export requests.</p>
205    pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
206        self.inner = self.inner.set_role_arn(input);
207        self
208    }
209    /// <p>The Amazon Resource Name (ARN) of the IAM role that grants QLDB permissions for a journal export job to do the following:</p>
210    /// <ul>
211    /// <li>
212    /// <p>Write objects into your Amazon S3 bucket.</p></li>
213    /// <li>
214    /// <p>(Optional) Use your customer managed key in Key Management Service (KMS) for server-side encryption of your exported data.</p></li>
215    /// </ul>
216    /// <p>To pass a role to QLDB when requesting a journal export, you must have permissions to perform the <code>iam:PassRole</code> action on the IAM role resource. This is required for all journal export requests.</p>
217    pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
218        self.inner.get_role_arn()
219    }
220    /// <p>The output format of your exported journal data. A journal export job can write the data objects in either the text or binary representation of <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/ion.html">Amazon Ion</a> format, or in <a href="https://jsonlines.org/">JSON Lines</a> text format.</p>
221    /// <p>Default: <code>ION_TEXT</code></p>
222    /// <p>In JSON Lines format, each journal block in an exported data object is a valid JSON object that is delimited by a newline. You can use this format to directly integrate JSON exports with analytics tools such as Amazon Athena and Glue because these services can parse newline-delimited JSON automatically.</p>
223    pub fn output_format(mut self, input: crate::types::OutputFormat) -> Self {
224        self.inner = self.inner.output_format(input);
225        self
226    }
227    /// <p>The output format of your exported journal data. A journal export job can write the data objects in either the text or binary representation of <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/ion.html">Amazon Ion</a> format, or in <a href="https://jsonlines.org/">JSON Lines</a> text format.</p>
228    /// <p>Default: <code>ION_TEXT</code></p>
229    /// <p>In JSON Lines format, each journal block in an exported data object is a valid JSON object that is delimited by a newline. You can use this format to directly integrate JSON exports with analytics tools such as Amazon Athena and Glue because these services can parse newline-delimited JSON automatically.</p>
230    pub fn set_output_format(mut self, input: ::std::option::Option<crate::types::OutputFormat>) -> Self {
231        self.inner = self.inner.set_output_format(input);
232        self
233    }
234    /// <p>The output format of your exported journal data. A journal export job can write the data objects in either the text or binary representation of <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/ion.html">Amazon Ion</a> format, or in <a href="https://jsonlines.org/">JSON Lines</a> text format.</p>
235    /// <p>Default: <code>ION_TEXT</code></p>
236    /// <p>In JSON Lines format, each journal block in an exported data object is a valid JSON object that is delimited by a newline. You can use this format to directly integrate JSON exports with analytics tools such as Amazon Athena and Glue because these services can parse newline-delimited JSON automatically.</p>
237    pub fn get_output_format(&self) -> &::std::option::Option<crate::types::OutputFormat> {
238        self.inner.get_output_format()
239    }
240}