// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::start_import::_start_import_input::StartImportInputBuilder;
pub use crate::operation::start_import::_start_import_output::StartImportOutputBuilder;
impl crate::operation::start_import::builders::StartImportInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::start_import::StartImportOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_import::StartImportError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.start_import();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `StartImport`.
///
/// <p>Starts an import of logged trail events from a source S3 bucket to a destination event data store. By default, CloudTrail only imports events contained in the S3 bucket's <code>CloudTrail</code> prefix and the prefixes inside the <code>CloudTrail</code> prefix, and does not check prefixes for other Amazon Web Services services. If you want to import CloudTrail events contained in another prefix, you must include the prefix in the <code>S3LocationUri</code>. For more considerations about importing trail events, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-copy-trail-to-lake.html#cloudtrail-trail-copy-considerations">Considerations for copying trail events</a> in the <i>CloudTrail User Guide</i>.</p>
/// <p>When you start a new import, the <code>Destinations</code> and <code>ImportSource</code> parameters are required. Before starting a new import, disable any access control lists (ACLs) attached to the source S3 bucket. For more information about disabling ACLs, see <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html">Controlling ownership of objects and disabling ACLs for your bucket</a>.</p>
/// <p>When you retry an import, the <code>ImportID</code> parameter is required.</p><note>
/// <p>If the destination event data store is for an organization, you must use the management account to import trail events. You cannot use the delegated administrator account for the organization.</p>
/// </note>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct StartImportFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::start_import::builders::StartImportInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::start_import::StartImportOutput,
crate::operation::start_import::StartImportError,
> for StartImportFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::start_import::StartImportOutput,
crate::operation::start_import::StartImportError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl StartImportFluentBuilder {
/// Creates a new `StartImportFluentBuilder`.
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 StartImport as a reference.
pub fn as_input(&self) -> &crate::operation::start_import::builders::StartImportInputBuilder {
&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::start_import::StartImportOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::start_import::StartImportError,
::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::start_import::StartImport::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::start_import::StartImport::orchestrate(&runtime_plugins, input).await
}
/// Consumes this builder, creating a customizable operation that can be modified before being sent.
pub fn customize(
self,
) -> crate::client::customize::CustomizableOperation<
crate::operation::start_import::StartImportOutput,
crate::operation::start_import::StartImportError,
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
}
///
/// Appends an item to `Destinations`.
///
/// To override the contents of this collection use [`set_destinations`](Self::set_destinations).
///
/// <p>The ARN of the destination event data store. Use this parameter for a new import.</p>
pub fn destinations(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.destinations(input.into());
self
}
/// <p>The ARN of the destination event data store. Use this parameter for a new import.</p>
pub fn set_destinations(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
self.inner = self.inner.set_destinations(input);
self
}
/// <p>The ARN of the destination event data store. Use this parameter for a new import.</p>
pub fn get_destinations(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
self.inner.get_destinations()
}
/// <p>The source S3 bucket for the import. Use this parameter for a new import.</p>
pub fn import_source(mut self, input: crate::types::ImportSource) -> Self {
self.inner = self.inner.import_source(input);
self
}
/// <p>The source S3 bucket for the import. Use this parameter for a new import.</p>
pub fn set_import_source(mut self, input: ::std::option::Option<crate::types::ImportSource>) -> Self {
self.inner = self.inner.set_import_source(input);
self
}
/// <p>The source S3 bucket for the import. Use this parameter for a new import.</p>
pub fn get_import_source(&self) -> &::std::option::Option<crate::types::ImportSource> {
self.inner.get_import_source()
}
/// <p>Use with <code>EndEventTime</code> to bound a <code>StartImport</code> request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified <code>StartEventTime</code> and <code>EndEventTime</code> before attempting to import events.</p>
pub fn start_event_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_event_time(input);
self
}
/// <p>Use with <code>EndEventTime</code> to bound a <code>StartImport</code> request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified <code>StartEventTime</code> and <code>EndEventTime</code> before attempting to import events.</p>
pub fn set_start_event_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_start_event_time(input);
self
}
/// <p>Use with <code>EndEventTime</code> to bound a <code>StartImport</code> request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified <code>StartEventTime</code> and <code>EndEventTime</code> before attempting to import events.</p>
pub fn get_start_event_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
self.inner.get_start_event_time()
}
/// <p>Use with <code>StartEventTime</code> to bound a <code>StartImport</code> request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified <code>StartEventTime</code> and <code>EndEventTime</code> before attempting to import events.</p>
pub fn end_event_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_event_time(input);
self
}
/// <p>Use with <code>StartEventTime</code> to bound a <code>StartImport</code> request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified <code>StartEventTime</code> and <code>EndEventTime</code> before attempting to import events.</p>
pub fn set_end_event_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_end_event_time(input);
self
}
/// <p>Use with <code>StartEventTime</code> to bound a <code>StartImport</code> request, and limit imported trail events to only those events logged within a specified time period. When you specify a time range, CloudTrail checks the prefix and log file names to verify the names contain a date between the specified <code>StartEventTime</code> and <code>EndEventTime</code> before attempting to import events.</p>
pub fn get_end_event_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
self.inner.get_end_event_time()
}
/// <p>The ID of the import. Use this parameter when you are retrying an import.</p>
pub fn import_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.import_id(input.into());
self
}
/// <p>The ID of the import. Use this parameter when you are retrying an import.</p>
pub fn set_import_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_import_id(input);
self
}
/// <p>The ID of the import. Use this parameter when you are retrying an import.</p>
pub fn get_import_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_import_id()
}
}