// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_trail::_update_trail_input::UpdateTrailInputBuilder;
pub use crate::operation::update_trail::_update_trail_output::UpdateTrailOutputBuilder;
impl crate::operation::update_trail::builders::UpdateTrailInputBuilder {
/// Sends a request with this input using the given client.
pub async fn send_with(
self,
client: &crate::Client,
) -> ::std::result::Result<
crate::operation::update_trail::UpdateTrailOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_trail::UpdateTrailError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.update_trail();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `UpdateTrail`.
///
/// <p>Updates trail settings that control what events you are logging, and how to handle log files. Changes to a trail do not require stopping the CloudTrail service. Use this action to designate an existing bucket for log delivery. If the existing bucket has previously been a target for CloudTrail log files, an IAM policy exists for the bucket. <code>UpdateTrail</code> must be called from the Region in which the trail was created; otherwise, an <code>InvalidHomeRegionException</code> is thrown.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateTrailFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::update_trail::builders::UpdateTrailInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::update_trail::UpdateTrailOutput,
crate::operation::update_trail::UpdateTrailError,
> for UpdateTrailFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::update_trail::UpdateTrailOutput,
crate::operation::update_trail::UpdateTrailError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl UpdateTrailFluentBuilder {
/// Creates a new `UpdateTrailFluentBuilder`.
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 UpdateTrail as a reference.
pub fn as_input(&self) -> &crate::operation::update_trail::builders::UpdateTrailInputBuilder {
&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::update_trail::UpdateTrailOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_trail::UpdateTrailError,
::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::update_trail::UpdateTrail::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::update_trail::UpdateTrail::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::update_trail::UpdateTrailOutput,
crate::operation::update_trail::UpdateTrailError,
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
}
/// <p>Specifies the name of the trail or trail ARN. If <code>Name</code> is a trail name, the string must meet the following requirements:</p>
/// <ul>
/// <li>
/// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
/// <li>
/// <p>Start with a letter or number, and end with a letter or number</p></li>
/// <li>
/// <p>Be between 3 and 128 characters</p></li>
/// <li>
/// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
/// <li>
/// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
/// </ul>
/// <p>If <code>Name</code> is a trail ARN, it must be in the following format.</p>
/// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
pub fn name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.name(input.into());
self
}
/// <p>Specifies the name of the trail or trail ARN. If <code>Name</code> is a trail name, the string must meet the following requirements:</p>
/// <ul>
/// <li>
/// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
/// <li>
/// <p>Start with a letter or number, and end with a letter or number</p></li>
/// <li>
/// <p>Be between 3 and 128 characters</p></li>
/// <li>
/// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
/// <li>
/// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
/// </ul>
/// <p>If <code>Name</code> is a trail ARN, it must be in the following format.</p>
/// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
pub fn set_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_name(input);
self
}
/// <p>Specifies the name of the trail or trail ARN. If <code>Name</code> is a trail name, the string must meet the following requirements:</p>
/// <ul>
/// <li>
/// <p>Contain only ASCII letters (a-z, A-Z), numbers (0-9), periods (.), underscores (_), or dashes (-)</p></li>
/// <li>
/// <p>Start with a letter or number, and end with a letter or number</p></li>
/// <li>
/// <p>Be between 3 and 128 characters</p></li>
/// <li>
/// <p>Have no adjacent periods, underscores or dashes. Names like <code>my-_namespace</code> and <code>my--namespace</code> are not valid.</p></li>
/// <li>
/// <p>Not be in IP address format (for example, 192.168.5.4)</p></li>
/// </ul>
/// <p>If <code>Name</code> is a trail ARN, it must be in the following format.</p>
/// <p><code>arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail</code></p>
pub fn get_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_name()
}
/// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon S3 Bucket naming rules</a>.</p>
pub fn s3_bucket_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.s3_bucket_name(input.into());
self
}
/// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon S3 Bucket naming rules</a>.</p>
pub fn set_s3_bucket_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_s3_bucket_name(input);
self
}
/// <p>Specifies the name of the Amazon S3 bucket designated for publishing log files. See <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html">Amazon S3 Bucket naming rules</a>.</p>
pub fn get_s3_bucket_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_s3_bucket_name()
}
/// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
pub fn s3_key_prefix(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.s3_key_prefix(input.into());
self
}
/// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
pub fn set_s3_key_prefix(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_s3_key_prefix(input);
self
}
/// <p>Specifies the Amazon S3 key prefix that comes after the name of the bucket you have designated for log file delivery. For more information, see <a href="https://docs.aws.amazon.com/awscloudtrail/latest/userguide/get-and-view-cloudtrail-log-files.html#cloudtrail-find-log-files">Finding Your CloudTrail Log Files</a>. The maximum length is 200 characters.</p>
pub fn get_s3_key_prefix(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_s3_key_prefix()
}
/// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
pub fn sns_topic_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.sns_topic_name(input.into());
self
}
/// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
pub fn set_sns_topic_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_sns_topic_name(input);
self
}
/// <p>Specifies the name or ARN of the Amazon SNS topic defined for notification of log file delivery. The maximum length is 256 characters.</p>
pub fn get_sns_topic_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_sns_topic_name()
}
/// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
pub fn include_global_service_events(mut self, input: bool) -> Self {
self.inner = self.inner.include_global_service_events(input);
self
}
/// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
pub fn set_include_global_service_events(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_include_global_service_events(input);
self
}
/// <p>Specifies whether the trail is publishing events from global services such as IAM to the log files.</p>
pub fn get_include_global_service_events(&self) -> &::std::option::Option<bool> {
self.inner.get_include_global_service_events()
}
/// <p>Specifies whether the trail applies only to the current Region or to all Regions. The default is false. If the trail exists only in the current Region and this value is set to true, shadow trails (replications of the trail) will be created in the other Regions. If the trail exists in all Regions and this value is set to false, the trail will remain in the Region where it was created, and its shadow trails in other Regions will be deleted. As a best practice, consider using trails that log events in all Regions.</p>
pub fn is_multi_region_trail(mut self, input: bool) -> Self {
self.inner = self.inner.is_multi_region_trail(input);
self
}
/// <p>Specifies whether the trail applies only to the current Region or to all Regions. The default is false. If the trail exists only in the current Region and this value is set to true, shadow trails (replications of the trail) will be created in the other Regions. If the trail exists in all Regions and this value is set to false, the trail will remain in the Region where it was created, and its shadow trails in other Regions will be deleted. As a best practice, consider using trails that log events in all Regions.</p>
pub fn set_is_multi_region_trail(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_is_multi_region_trail(input);
self
}
/// <p>Specifies whether the trail applies only to the current Region or to all Regions. The default is false. If the trail exists only in the current Region and this value is set to true, shadow trails (replications of the trail) will be created in the other Regions. If the trail exists in all Regions and this value is set to false, the trail will remain in the Region where it was created, and its shadow trails in other Regions will be deleted. As a best practice, consider using trails that log events in all Regions.</p>
pub fn get_is_multi_region_trail(&self) -> &::std::option::Option<bool> {
self.inner.get_is_multi_region_trail()
}
/// <p>Specifies whether log file validation is enabled. The default is false.</p><note>
/// <p>When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.</p>
/// </note>
pub fn enable_log_file_validation(mut self, input: bool) -> Self {
self.inner = self.inner.enable_log_file_validation(input);
self
}
/// <p>Specifies whether log file validation is enabled. The default is false.</p><note>
/// <p>When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.</p>
/// </note>
pub fn set_enable_log_file_validation(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enable_log_file_validation(input);
self
}
/// <p>Specifies whether log file validation is enabled. The default is false.</p><note>
/// <p>When you disable log file integrity validation, the chain of digest files is broken after one hour. CloudTrail does not create digest files for log files that were delivered during a period in which log file integrity validation was disabled. For example, if you enable log file integrity validation at noon on January 1, disable it at noon on January 2, and re-enable it at noon on January 10, digest files will not be created for the log files delivered from noon on January 2 to noon on January 10. The same applies whenever you stop CloudTrail logging or delete a trail.</p>
/// </note>
pub fn get_enable_log_file_validation(&self) -> &::std::option::Option<bool> {
self.inner.get_enable_log_file_validation()
}
/// <p>Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. You must use a log group that exists in your account.</p>
/// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
pub fn cloud_watch_logs_log_group_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.cloud_watch_logs_log_group_arn(input.into());
self
}
/// <p>Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. You must use a log group that exists in your account.</p>
/// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
pub fn set_cloud_watch_logs_log_group_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_cloud_watch_logs_log_group_arn(input);
self
}
/// <p>Specifies a log group name using an Amazon Resource Name (ARN), a unique identifier that represents the log group to which CloudTrail logs are delivered. You must use a log group that exists in your account.</p>
/// <p>Not required unless you specify <code>CloudWatchLogsRoleArn</code>.</p>
pub fn get_cloud_watch_logs_log_group_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_cloud_watch_logs_log_group_arn()
}
/// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
pub fn cloud_watch_logs_role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.cloud_watch_logs_role_arn(input.into());
self
}
/// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
pub fn set_cloud_watch_logs_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_cloud_watch_logs_role_arn(input);
self
}
/// <p>Specifies the role for the CloudWatch Logs endpoint to assume to write to a user's log group. You must use a role that exists in your account.</p>
pub fn get_cloud_watch_logs_role_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_cloud_watch_logs_role_arn()
}
/// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
/// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
/// <p>Examples:</p>
/// <ul>
/// <li>
/// <p>alias/MyAliasName</p></li>
/// <li>
/// <p>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</p></li>
/// <li>
/// <p>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</p></li>
/// <li>
/// <p>12345678-1234-1234-1234-123456789012</p></li>
/// </ul>
pub fn kms_key_id(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.kms_key_id(input.into());
self
}
/// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
/// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
/// <p>Examples:</p>
/// <ul>
/// <li>
/// <p>alias/MyAliasName</p></li>
/// <li>
/// <p>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</p></li>
/// <li>
/// <p>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</p></li>
/// <li>
/// <p>12345678-1234-1234-1234-123456789012</p></li>
/// </ul>
pub fn set_kms_key_id(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_kms_key_id(input);
self
}
/// <p>Specifies the KMS key ID to use to encrypt the logs and digest files delivered by CloudTrail. The value can be an alias name prefixed by "alias/", a fully specified ARN to an alias, a fully specified ARN to a key, or a globally unique identifier.</p>
/// <p>CloudTrail also supports KMS multi-Region keys. For more information about multi-Region keys, see <a href="https://docs.aws.amazon.com/kms/latest/developerguide/multi-region-keys-overview.html">Using multi-Region keys</a> in the <i>Key Management Service Developer Guide</i>.</p>
/// <p>Examples:</p>
/// <ul>
/// <li>
/// <p>alias/MyAliasName</p></li>
/// <li>
/// <p>arn:aws:kms:us-east-2:123456789012:alias/MyAliasName</p></li>
/// <li>
/// <p>arn:aws:kms:us-east-2:123456789012:key/12345678-1234-1234-1234-123456789012</p></li>
/// <li>
/// <p>12345678-1234-1234-1234-123456789012</p></li>
/// </ul>
pub fn get_kms_key_id(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_kms_key_id()
}
/// <p>Specifies whether the trail is applied to all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations. If the trail is not an organization trail and this is set to <code>true</code>, the trail will be created in all Amazon Web Services accounts that belong to the organization. If the trail is an organization trail and this is set to <code>false</code>, the trail will remain in the current Amazon Web Services account but be deleted from all member accounts in the organization.</p><note>
/// <p>Only the management account for the organization can convert an organization trail to a non-organization trail, or convert a non-organization trail to an organization trail.</p>
/// </note>
pub fn is_organization_trail(mut self, input: bool) -> Self {
self.inner = self.inner.is_organization_trail(input);
self
}
/// <p>Specifies whether the trail is applied to all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations. If the trail is not an organization trail and this is set to <code>true</code>, the trail will be created in all Amazon Web Services accounts that belong to the organization. If the trail is an organization trail and this is set to <code>false</code>, the trail will remain in the current Amazon Web Services account but be deleted from all member accounts in the organization.</p><note>
/// <p>Only the management account for the organization can convert an organization trail to a non-organization trail, or convert a non-organization trail to an organization trail.</p>
/// </note>
pub fn set_is_organization_trail(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_is_organization_trail(input);
self
}
/// <p>Specifies whether the trail is applied to all accounts in an organization in Organizations, or only for the current Amazon Web Services account. The default is false, and cannot be true unless the call is made on behalf of an Amazon Web Services account that is the management account for an organization in Organizations. If the trail is not an organization trail and this is set to <code>true</code>, the trail will be created in all Amazon Web Services accounts that belong to the organization. If the trail is an organization trail and this is set to <code>false</code>, the trail will remain in the current Amazon Web Services account but be deleted from all member accounts in the organization.</p><note>
/// <p>Only the management account for the organization can convert an organization trail to a non-organization trail, or convert a non-organization trail to an organization trail.</p>
/// </note>
pub fn get_is_organization_trail(&self) -> &::std::option::Option<bool> {
self.inner.get_is_organization_trail()
}
}