aws-sdk-computeoptimizerautomation 1.3.0

AWS SDK for Compute Optimizer Automation
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.

/// <p>Configuration for scheduling when automation rules should execute, including timing and execution windows.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Schedule {
    /// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
    /// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
    /// </note>
    pub schedule_expression: ::std::option::Option<::std::string::String>,
    /// <p>The timezone to use when interpreting the schedule expression.</p>
    pub schedule_expression_timezone: ::std::option::Option<::std::string::String>,
    /// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
    pub execution_window_in_minutes: ::std::option::Option<i32>,
}
impl Schedule {
    /// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
    /// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
    /// </note>
    pub fn schedule_expression(&self) -> ::std::option::Option<&str> {
        self.schedule_expression.as_deref()
    }
    /// <p>The timezone to use when interpreting the schedule expression.</p>
    pub fn schedule_expression_timezone(&self) -> ::std::option::Option<&str> {
        self.schedule_expression_timezone.as_deref()
    }
    /// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
    pub fn execution_window_in_minutes(&self) -> ::std::option::Option<i32> {
        self.execution_window_in_minutes
    }
}
impl Schedule {
    /// Creates a new builder-style object to manufacture [`Schedule`](crate::types::Schedule).
    pub fn builder() -> crate::types::builders::ScheduleBuilder {
        crate::types::builders::ScheduleBuilder::default()
    }
}

/// A builder for [`Schedule`](crate::types::Schedule).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct ScheduleBuilder {
    pub(crate) schedule_expression: ::std::option::Option<::std::string::String>,
    pub(crate) schedule_expression_timezone: ::std::option::Option<::std::string::String>,
    pub(crate) execution_window_in_minutes: ::std::option::Option<i32>,
}
impl ScheduleBuilder {
    /// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
    /// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
    /// </note>
    pub fn schedule_expression(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.schedule_expression = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
    /// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
    /// </note>
    pub fn set_schedule_expression(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.schedule_expression = input;
        self
    }
    /// <p>The expression that defines when the schedule runs. <code>cron</code> expression is supported. A <code>cron</code> expression consists of six fields separated by white spaces: (<code>minutes</code> <code>hours</code> <code>day_of_month</code> <code>month</code> <code>day_of_week</code> <code>year</code>)</p><note>
    /// <p>You can schedule rules to run at most once per day. Your cron expression must use specific values (not wildcards) for the minutes and hours fields. For example: (<code>30 12 * * *</code>) runs daily at 12:30 PM UTC.</p>
    /// </note>
    pub fn get_schedule_expression(&self) -> &::std::option::Option<::std::string::String> {
        &self.schedule_expression
    }
    /// <p>The timezone to use when interpreting the schedule expression.</p>
    pub fn schedule_expression_timezone(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.schedule_expression_timezone = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The timezone to use when interpreting the schedule expression.</p>
    pub fn set_schedule_expression_timezone(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.schedule_expression_timezone = input;
        self
    }
    /// <p>The timezone to use when interpreting the schedule expression.</p>
    pub fn get_schedule_expression_timezone(&self) -> &::std::option::Option<::std::string::String> {
        &self.schedule_expression_timezone
    }
    /// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
    pub fn execution_window_in_minutes(mut self, input: i32) -> Self {
        self.execution_window_in_minutes = ::std::option::Option::Some(input);
        self
    }
    /// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
    pub fn set_execution_window_in_minutes(mut self, input: ::std::option::Option<i32>) -> Self {
        self.execution_window_in_minutes = input;
        self
    }
    /// <p>The time window in minutes during which the automation rule can start implementing recommended actions.</p>
    pub fn get_execution_window_in_minutes(&self) -> &::std::option::Option<i32> {
        &self.execution_window_in_minutes
    }
    /// Consumes the builder and constructs a [`Schedule`](crate::types::Schedule).
    pub fn build(self) -> crate::types::Schedule {
        crate::types::Schedule {
            schedule_expression: self.schedule_expression,
            schedule_expression_timezone: self.schedule_expression_timezone,
            execution_window_in_minutes: self.execution_window_in_minutes,
        }
    }
}