aws-sdk-redshift 1.106.0

AWS SDK for Amazon Redshift
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Describes a scheduled action. You can use a scheduled action to trigger some Amazon Redshift API operations on a schedule. For information about which API operations can be scheduled, see <code>ScheduledActionType</code>.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateScheduledActionOutput {
    /// <p>The name of the scheduled action.</p>
    pub scheduled_action_name: ::std::option::Option<::std::string::String>,
    /// <p>A JSON format string of the Amazon Redshift API operation with input parameters.</p>
    /// <p>"<code>{\"ResizeCluster\":{\"NodeType\":\"ra3.4xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}</code>".</p>
    pub target_action: ::std::option::Option<crate::types::ScheduledActionType>,
    /// <p>The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.</p>
    /// <p>Format of at expressions is "<code>at(yyyy-mm-ddThh:mm:ss)</code>". For example, "<code>at(2016-03-04T17:27:00)</code>".</p>
    /// <p>Format of cron expressions is "<code>cron(Minutes Hours Day-of-month Month Day-of-week Year)</code>". For example, "<code>cron(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>
    pub schedule: ::std::option::Option<::std::string::String>,
    /// <p>The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (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 <i>Amazon Redshift Cluster Management Guide</i>.</p>
    pub iam_role: ::std::option::Option<::std::string::String>,
    /// <p>The description of the scheduled action.</p>
    pub scheduled_action_description: ::std::option::Option<::std::string::String>,
    /// <p>The state of the scheduled action. For example, <code>DISABLED</code>.</p>
    pub state: ::std::option::Option<crate::types::ScheduledActionState>,
    /// <p>List of times when the scheduled action will run.</p>
    pub next_invocations: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::DateTime>>,
    /// <p>The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.</p>
    pub start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    /// <p>The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.</p>
    pub end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateScheduledActionOutput {
    /// <p>The name of the scheduled action.</p>
    pub fn scheduled_action_name(&self) -> ::std::option::Option<&str> {
        self.scheduled_action_name.as_deref()
    }
    /// <p>A JSON format string of the Amazon Redshift API operation with input parameters.</p>
    /// <p>"<code>{\"ResizeCluster\":{\"NodeType\":\"ra3.4xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}</code>".</p>
    pub fn target_action(&self) -> ::std::option::Option<&crate::types::ScheduledActionType> {
        self.target_action.as_ref()
    }
    /// <p>The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.</p>
    /// <p>Format of at expressions is "<code>at(yyyy-mm-ddThh:mm:ss)</code>". For example, "<code>at(2016-03-04T17:27:00)</code>".</p>
    /// <p>Format of cron expressions is "<code>cron(Minutes Hours Day-of-month Month Day-of-week Year)</code>". For example, "<code>cron(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>
    pub fn schedule(&self) -> ::std::option::Option<&str> {
        self.schedule.as_deref()
    }
    /// <p>The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (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 <i>Amazon Redshift Cluster Management Guide</i>.</p>
    pub fn iam_role(&self) -> ::std::option::Option<&str> {
        self.iam_role.as_deref()
    }
    /// <p>The description of the scheduled action.</p>
    pub fn scheduled_action_description(&self) -> ::std::option::Option<&str> {
        self.scheduled_action_description.as_deref()
    }
    /// <p>The state of the scheduled action. For example, <code>DISABLED</code>.</p>
    pub fn state(&self) -> ::std::option::Option<&crate::types::ScheduledActionState> {
        self.state.as_ref()
    }
    /// <p>List of times when the scheduled action will run.</p>
    ///
    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.next_invocations.is_none()`.
    pub fn next_invocations(&self) -> &[::aws_smithy_types::DateTime] {
        self.next_invocations.as_deref().unwrap_or_default()
    }
    /// <p>The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.</p>
    pub fn start_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.start_time.as_ref()
    }
    /// <p>The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.</p>
    pub fn end_time(&self) -> ::std::option::Option<&::aws_smithy_types::DateTime> {
        self.end_time.as_ref()
    }
}
impl ::aws_types::request_id::RequestId for CreateScheduledActionOutput {
    fn request_id(&self) -> Option<&str> {
        self._request_id.as_deref()
    }
}
impl CreateScheduledActionOutput {
    /// Creates a new builder-style object to manufacture [`CreateScheduledActionOutput`](crate::operation::create_scheduled_action::CreateScheduledActionOutput).
    pub fn builder() -> crate::operation::create_scheduled_action::builders::CreateScheduledActionOutputBuilder {
        crate::operation::create_scheduled_action::builders::CreateScheduledActionOutputBuilder::default()
    }
}

/// A builder for [`CreateScheduledActionOutput`](crate::operation::create_scheduled_action::CreateScheduledActionOutput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateScheduledActionOutputBuilder {
    pub(crate) scheduled_action_name: ::std::option::Option<::std::string::String>,
    pub(crate) target_action: ::std::option::Option<crate::types::ScheduledActionType>,
    pub(crate) schedule: ::std::option::Option<::std::string::String>,
    pub(crate) iam_role: ::std::option::Option<::std::string::String>,
    pub(crate) scheduled_action_description: ::std::option::Option<::std::string::String>,
    pub(crate) state: ::std::option::Option<crate::types::ScheduledActionState>,
    pub(crate) next_invocations: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::DateTime>>,
    pub(crate) start_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    pub(crate) end_time: ::std::option::Option<::aws_smithy_types::DateTime>,
    _request_id: Option<String>,
}
impl CreateScheduledActionOutputBuilder {
    /// <p>The name of the scheduled action.</p>
    pub fn scheduled_action_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.scheduled_action_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the scheduled action.</p>
    pub fn set_scheduled_action_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.scheduled_action_name = input;
        self
    }
    /// <p>The name of the scheduled action.</p>
    pub fn get_scheduled_action_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.scheduled_action_name
    }
    /// <p>A JSON format string of the Amazon Redshift API operation with input parameters.</p>
    /// <p>"<code>{\"ResizeCluster\":{\"NodeType\":\"ra3.4xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}</code>".</p>
    pub fn target_action(mut self, input: crate::types::ScheduledActionType) -> Self {
        self.target_action = ::std::option::Option::Some(input);
        self
    }
    /// <p>A JSON format string of the Amazon Redshift API operation with input parameters.</p>
    /// <p>"<code>{\"ResizeCluster\":{\"NodeType\":\"ra3.4xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}</code>".</p>
    pub fn set_target_action(mut self, input: ::std::option::Option<crate::types::ScheduledActionType>) -> Self {
        self.target_action = input;
        self
    }
    /// <p>A JSON format string of the Amazon Redshift API operation with input parameters.</p>
    /// <p>"<code>{\"ResizeCluster\":{\"NodeType\":\"ra3.4xlarge\",\"ClusterIdentifier\":\"my-test-cluster\",\"NumberOfNodes\":3}}</code>".</p>
    pub fn get_target_action(&self) -> &::std::option::Option<crate::types::ScheduledActionType> {
        &self.target_action
    }
    /// <p>The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.</p>
    /// <p>Format of at expressions is "<code>at(yyyy-mm-ddThh:mm:ss)</code>". For example, "<code>at(2016-03-04T17:27:00)</code>".</p>
    /// <p>Format of cron expressions is "<code>cron(Minutes Hours Day-of-month Month Day-of-week Year)</code>". For example, "<code>cron(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>
    pub fn schedule(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.schedule = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.</p>
    /// <p>Format of at expressions is "<code>at(yyyy-mm-ddThh:mm:ss)</code>". For example, "<code>at(2016-03-04T17:27:00)</code>".</p>
    /// <p>Format of cron expressions is "<code>cron(Minutes Hours Day-of-month Month Day-of-week Year)</code>". For example, "<code>cron(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>
    pub fn set_schedule(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.schedule = input;
        self
    }
    /// <p>The schedule for a one-time (at format) or recurring (cron format) scheduled action. Schedule invocations must be separated by at least one hour.</p>
    /// <p>Format of at expressions is "<code>at(yyyy-mm-ddThh:mm:ss)</code>". For example, "<code>at(2016-03-04T17:27:00)</code>".</p>
    /// <p>Format of cron expressions is "<code>cron(Minutes Hours Day-of-month Month Day-of-week Year)</code>". For example, "<code>cron(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>
    pub fn get_schedule(&self) -> &::std::option::Option<::std::string::String> {
        &self.schedule
    }
    /// <p>The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (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 <i>Amazon Redshift Cluster Management Guide</i>.</p>
    pub fn iam_role(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.iam_role = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (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 <i>Amazon Redshift Cluster Management Guide</i>.</p>
    pub fn set_iam_role(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.iam_role = input;
        self
    }
    /// <p>The IAM role to assume to run the scheduled action. This IAM role must have permission to run the Amazon Redshift API operation in the scheduled action. This IAM role must allow the Amazon Redshift scheduler (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 <i>Amazon Redshift Cluster Management Guide</i>.</p>
    pub fn get_iam_role(&self) -> &::std::option::Option<::std::string::String> {
        &self.iam_role
    }
    /// <p>The description of the scheduled action.</p>
    pub fn scheduled_action_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.scheduled_action_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the scheduled action.</p>
    pub fn set_scheduled_action_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.scheduled_action_description = input;
        self
    }
    /// <p>The description of the scheduled action.</p>
    pub fn get_scheduled_action_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.scheduled_action_description
    }
    /// <p>The state of the scheduled action. For example, <code>DISABLED</code>.</p>
    pub fn state(mut self, input: crate::types::ScheduledActionState) -> Self {
        self.state = ::std::option::Option::Some(input);
        self
    }
    /// <p>The state of the scheduled action. For example, <code>DISABLED</code>.</p>
    pub fn set_state(mut self, input: ::std::option::Option<crate::types::ScheduledActionState>) -> Self {
        self.state = input;
        self
    }
    /// <p>The state of the scheduled action. For example, <code>DISABLED</code>.</p>
    pub fn get_state(&self) -> &::std::option::Option<crate::types::ScheduledActionState> {
        &self.state
    }
    /// Appends an item to `next_invocations`.
    ///
    /// To override the contents of this collection use [`set_next_invocations`](Self::set_next_invocations).
    ///
    /// <p>List of times when the scheduled action will run.</p>
    pub fn next_invocations(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        let mut v = self.next_invocations.unwrap_or_default();
        v.push(input);
        self.next_invocations = ::std::option::Option::Some(v);
        self
    }
    /// <p>List of times when the scheduled action will run.</p>
    pub fn set_next_invocations(mut self, input: ::std::option::Option<::std::vec::Vec<::aws_smithy_types::DateTime>>) -> Self {
        self.next_invocations = input;
        self
    }
    /// <p>List of times when the scheduled action will run.</p>
    pub fn get_next_invocations(&self) -> &::std::option::Option<::std::vec::Vec<::aws_smithy_types::DateTime>> {
        &self.next_invocations
    }
    /// <p>The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.</p>
    pub fn start_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.start_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.</p>
    pub fn set_start_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.start_time = input;
        self
    }
    /// <p>The start time in UTC when the schedule is active. Before this time, the scheduled action does not trigger.</p>
    pub fn get_start_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.start_time
    }
    /// <p>The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.</p>
    pub fn end_time(mut self, input: ::aws_smithy_types::DateTime) -> Self {
        self.end_time = ::std::option::Option::Some(input);
        self
    }
    /// <p>The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.</p>
    pub fn set_end_time(mut self, input: ::std::option::Option<::aws_smithy_types::DateTime>) -> Self {
        self.end_time = input;
        self
    }
    /// <p>The end time in UTC when the schedule is no longer active. After this time, the scheduled action does not trigger.</p>
    pub fn get_end_time(&self) -> &::std::option::Option<::aws_smithy_types::DateTime> {
        &self.end_time
    }
    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
        self._request_id = Some(request_id.into());
        self
    }

    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
        self._request_id = request_id;
        self
    }
    /// Consumes the builder and constructs a [`CreateScheduledActionOutput`](crate::operation::create_scheduled_action::CreateScheduledActionOutput).
    pub fn build(self) -> crate::operation::create_scheduled_action::CreateScheduledActionOutput {
        crate::operation::create_scheduled_action::CreateScheduledActionOutput {
            scheduled_action_name: self.scheduled_action_name,
            target_action: self.target_action,
            schedule: self.schedule,
            iam_role: self.iam_role,
            scheduled_action_description: self.scheduled_action_description,
            state: self.state,
            next_invocations: self.next_invocations,
            start_time: self.start_time,
            end_time: self.end_time,
            _request_id: self._request_id,
        }
    }
}