// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
pub use crate::operation::update_scheduled_action::_update_scheduled_action_input::UpdateScheduledActionInputBuilder;
pub use crate::operation::update_scheduled_action::_update_scheduled_action_output::UpdateScheduledActionOutputBuilder;
impl crate::operation::update_scheduled_action::builders::UpdateScheduledActionInputBuilder {
/// 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_scheduled_action::UpdateScheduledActionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_scheduled_action::UpdateScheduledActionError,
::aws_smithy_runtime_api::client::orchestrator::HttpResponse,
>,
> {
let mut fluent_builder = client.update_scheduled_action();
fluent_builder.inner = self;
fluent_builder.send().await
}
}
/// Fluent builder constructing a request to `UpdateScheduledAction`.
///
/// <p>Updates a scheduled action.</p>
#[derive(::std::clone::Clone, ::std::fmt::Debug)]
pub struct UpdateScheduledActionFluentBuilder {
handle: ::std::sync::Arc<crate::client::Handle>,
inner: crate::operation::update_scheduled_action::builders::UpdateScheduledActionInputBuilder,
config_override: ::std::option::Option<crate::config::Builder>,
}
impl
crate::client::customize::internal::CustomizableSend<
crate::operation::update_scheduled_action::UpdateScheduledActionOutput,
crate::operation::update_scheduled_action::UpdateScheduledActionError,
> for UpdateScheduledActionFluentBuilder
{
fn send(
self,
config_override: crate::config::Builder,
) -> crate::client::customize::internal::BoxFuture<
crate::client::customize::internal::SendResult<
crate::operation::update_scheduled_action::UpdateScheduledActionOutput,
crate::operation::update_scheduled_action::UpdateScheduledActionError,
>,
> {
::std::boxed::Box::pin(async move { self.config_override(config_override).send().await })
}
}
impl UpdateScheduledActionFluentBuilder {
/// Creates a new `UpdateScheduledActionFluentBuilder`.
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 UpdateScheduledAction as a reference.
pub fn as_input(&self) -> &crate::operation::update_scheduled_action::builders::UpdateScheduledActionInputBuilder {
&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_scheduled_action::UpdateScheduledActionOutput,
::aws_smithy_runtime_api::client::result::SdkError<
crate::operation::update_scheduled_action::UpdateScheduledActionError,
::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_scheduled_action::UpdateScheduledAction::operation_runtime_plugins(
self.handle.runtime_plugins.clone(),
&self.handle.conf,
self.config_override,
);
crate::operation::update_scheduled_action::UpdateScheduledAction::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_scheduled_action::UpdateScheduledActionOutput,
crate::operation::update_scheduled_action::UpdateScheduledActionError,
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>The name of the scheduled action to update to.</p>
pub fn scheduled_action_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.scheduled_action_name(input.into());
self
}
/// <p>The name of the scheduled action to update to.</p>
pub fn set_scheduled_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_scheduled_action_name(input);
self
}
/// <p>The name of the scheduled action to update to.</p>
pub fn get_scheduled_action_name(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_scheduled_action_name()
}
/// <p>A JSON format string of the Amazon Redshift Serverless API operation with input parameters. The following is an example of a target action.</p>
/// <p><code>"{"CreateSnapshot": {"NamespaceName": "sampleNamespace","SnapshotName": "sampleSnapshot", "retentionPeriod": "1"}}"</code></p>
pub fn target_action(mut self, input: crate::types::TargetAction) -> Self {
self.inner = self.inner.target_action(input);
self
}
/// <p>A JSON format string of the Amazon Redshift Serverless API operation with input parameters. The following is an example of a target action.</p>
/// <p><code>"{"CreateSnapshot": {"NamespaceName": "sampleNamespace","SnapshotName": "sampleSnapshot", "retentionPeriod": "1"}}"</code></p>
pub fn set_target_action(mut self, input: ::std::option::Option<crate::types::TargetAction>) -> Self {
self.inner = self.inner.set_target_action(input);
self
}
/// <p>A JSON format string of the Amazon Redshift Serverless API operation with input parameters. The following is an example of a target action.</p>
/// <p><code>"{"CreateSnapshot": {"NamespaceName": "sampleNamespace","SnapshotName": "sampleSnapshot", "retentionPeriod": "1"}}"</code></p>
pub fn get_target_action(&self) -> &::std::option::Option<crate::types::TargetAction> {
self.inner.get_target_action()
}
/// <p>The schedule for a one-time (at timestamp format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC.</p>
/// <ul>
/// <li>
/// <p>Format of at timestamp is <code>yyyy-mm-ddThh:mm:ss</code>. For example, <code>2016-03-04T17:27:00</code>.</p></li>
/// <li>
/// <p>Format of cron expression is <code>(Minutes Hours Day-of-month Month Day-of-week Year)</code>. For example, <code>"(0 10 ? * MON *)"</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron Expressions</a> in the <i>Amazon CloudWatch Events User Guide</i>.</p></li>
/// </ul>
pub fn schedule(mut self, input: crate::types::Schedule) -> Self {
self.inner = self.inner.schedule(input);
self
}
/// <p>The schedule for a one-time (at timestamp format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC.</p>
/// <ul>
/// <li>
/// <p>Format of at timestamp is <code>yyyy-mm-ddThh:mm:ss</code>. For example, <code>2016-03-04T17:27:00</code>.</p></li>
/// <li>
/// <p>Format of cron expression is <code>(Minutes Hours Day-of-month Month Day-of-week Year)</code>. For example, <code>"(0 10 ? * MON *)"</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron Expressions</a> in the <i>Amazon CloudWatch Events User Guide</i>.</p></li>
/// </ul>
pub fn set_schedule(mut self, input: ::std::option::Option<crate::types::Schedule>) -> Self {
self.inner = self.inner.set_schedule(input);
self
}
/// <p>The schedule for a one-time (at timestamp format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour. Times are in UTC.</p>
/// <ul>
/// <li>
/// <p>Format of at timestamp is <code>yyyy-mm-ddThh:mm:ss</code>. For example, <code>2016-03-04T17:27:00</code>.</p></li>
/// <li>
/// <p>Format of cron expression is <code>(Minutes Hours Day-of-month Month Day-of-week Year)</code>. For example, <code>"(0 10 ? * MON *)"</code>. For more information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/events/ScheduledEvents.html#CronExpressions">Cron Expressions</a> in the <i>Amazon CloudWatch Events User Guide</i>.</p></li>
/// </ul>
pub fn get_schedule(&self) -> &::std::option::Option<crate::types::Schedule> {
self.inner.get_schedule()
}
/// <p>The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">Using Identity-Based Policies for Amazon Redshift</a> in the Amazon Redshift Management Guide</p>
pub fn role_arn(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.role_arn(input.into());
self
}
/// <p>The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">Using Identity-Based Policies for Amazon Redshift</a> in the Amazon Redshift Management Guide</p>
pub fn set_role_arn(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_role_arn(input);
self
}
/// <p>The ARN of the IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift Serverless API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler to schedule creating snapshots (Principal scheduler.redshift.amazonaws.com) to assume permissions on your behalf. For more information about the IAM role to use with the Amazon Redshift scheduler, see <a href="https://docs.aws.amazon.com/redshift/latest/mgmt/redshift-iam-access-control-identity-based.html">Using Identity-Based Policies for Amazon Redshift</a> in the Amazon Redshift Management Guide</p>
pub fn get_role_arn(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_role_arn()
}
/// <p>Specifies whether to enable the scheduled action.</p>
pub fn enabled(mut self, input: bool) -> Self {
self.inner = self.inner.enabled(input);
self
}
/// <p>Specifies whether to enable the scheduled action.</p>
pub fn set_enabled(mut self, input: ::std::option::Option<bool>) -> Self {
self.inner = self.inner.set_enabled(input);
self
}
/// <p>Specifies whether to enable the scheduled action.</p>
pub fn get_enabled(&self) -> &::std::option::Option<bool> {
self.inner.get_enabled()
}
/// <p>The descripion of the scheduled action to update to.</p>
pub fn scheduled_action_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
self.inner = self.inner.scheduled_action_description(input.into());
self
}
/// <p>The descripion of the scheduled action to update to.</p>
pub fn set_scheduled_action_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
self.inner = self.inner.set_scheduled_action_description(input);
self
}
/// <p>The descripion of the scheduled action to update to.</p>
pub fn get_scheduled_action_description(&self) -> &::std::option::Option<::std::string::String> {
self.inner.get_scheduled_action_description()
}
/// <p>The start time in UTC of the scheduled action to update to.</p>
pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.start_time(input);
self
}
/// <p>The start time in UTC of the scheduled action to update to.</p>
pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_start_time(input);
self
}
/// <p>The start time in UTC of the scheduled action to update to.</p>
pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
self.inner.get_start_time()
}
/// <p>The end time in UTC of the scheduled action to update.</p>
pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
self.inner = self.inner.end_time(input);
self
}
/// <p>The end time in UTC of the scheduled action to update.</p>
pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
self.inner = self.inner.set_end_time(input);
self
}
/// <p>The end time in UTC of the scheduled action to update.</p>
pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
self.inner.get_end_time()
}
}