aws-sdk-iot 1.112.0

AWS SDK for AWS IoT
Documentation
// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateScheduledAuditInput {
    /// <p>How often the scheduled audit takes place, either <code>DAILY</code>, <code>WEEKLY</code>, <code>BIWEEKLY</code> or <code>MONTHLY</code>. The start time of each audit is determined by the system.</p>
    pub frequency: ::std::option::Option<crate::types::AuditFrequency>,
    /// <p>The day of the month on which the scheduled audit takes place. This can be "1" through "31" or "LAST". This field is required if the "frequency" parameter is set to <code>MONTHLY</code>. If days 29 to 31 are specified, and the month doesn't have that many days, the audit takes place on the <code>LAST</code> day of the month.</p>
    pub day_of_month: ::std::option::Option<::std::string::String>,
    /// <p>The day of the week on which the scheduled audit takes place, either <code>SUN</code>, <code>MON</code>, <code>TUE</code>, <code>WED</code>, <code>THU</code>, <code>FRI</code>, or <code>SAT</code>. This field is required if the <code>frequency</code> parameter is set to <code>WEEKLY</code> or <code>BIWEEKLY</code>.</p>
    pub day_of_week: ::std::option::Option<crate::types::DayOfWeek>,
    /// <p>Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use <code>DescribeAccountAuditConfiguration</code> to see the list of all checks, including those that are enabled or use <code>UpdateAccountAuditConfiguration</code> to select which checks are enabled.)</p>
    pub target_check_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>The name you want to give to the scheduled audit. (Max. 128 chars)</p>
    pub scheduled_audit_name: ::std::option::Option<::std::string::String>,
    /// <p>Metadata that can be used to manage the scheduled audit.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateScheduledAuditInput {
    /// <p>How often the scheduled audit takes place, either <code>DAILY</code>, <code>WEEKLY</code>, <code>BIWEEKLY</code> or <code>MONTHLY</code>. The start time of each audit is determined by the system.</p>
    pub fn frequency(&self) -> ::std::option::Option<&crate::types::AuditFrequency> {
        self.frequency.as_ref()
    }
    /// <p>The day of the month on which the scheduled audit takes place. This can be "1" through "31" or "LAST". This field is required if the "frequency" parameter is set to <code>MONTHLY</code>. If days 29 to 31 are specified, and the month doesn't have that many days, the audit takes place on the <code>LAST</code> day of the month.</p>
    pub fn day_of_month(&self) -> ::std::option::Option<&str> {
        self.day_of_month.as_deref()
    }
    /// <p>The day of the week on which the scheduled audit takes place, either <code>SUN</code>, <code>MON</code>, <code>TUE</code>, <code>WED</code>, <code>THU</code>, <code>FRI</code>, or <code>SAT</code>. This field is required if the <code>frequency</code> parameter is set to <code>WEEKLY</code> or <code>BIWEEKLY</code>.</p>
    pub fn day_of_week(&self) -> ::std::option::Option<&crate::types::DayOfWeek> {
        self.day_of_week.as_ref()
    }
    /// <p>Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use <code>DescribeAccountAuditConfiguration</code> to see the list of all checks, including those that are enabled or use <code>UpdateAccountAuditConfiguration</code> to select which checks are enabled.)</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 `.target_check_names.is_none()`.
    pub fn target_check_names(&self) -> &[::std::string::String] {
        self.target_check_names.as_deref().unwrap_or_default()
    }
    /// <p>The name you want to give to the scheduled audit. (Max. 128 chars)</p>
    pub fn scheduled_audit_name(&self) -> ::std::option::Option<&str> {
        self.scheduled_audit_name.as_deref()
    }
    /// <p>Metadata that can be used to manage the scheduled audit.</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 `.tags.is_none()`.
    pub fn tags(&self) -> &[crate::types::Tag] {
        self.tags.as_deref().unwrap_or_default()
    }
}
impl CreateScheduledAuditInput {
    /// Creates a new builder-style object to manufacture [`CreateScheduledAuditInput`](crate::operation::create_scheduled_audit::CreateScheduledAuditInput).
    pub fn builder() -> crate::operation::create_scheduled_audit::builders::CreateScheduledAuditInputBuilder {
        crate::operation::create_scheduled_audit::builders::CreateScheduledAuditInputBuilder::default()
    }
}

/// A builder for [`CreateScheduledAuditInput`](crate::operation::create_scheduled_audit::CreateScheduledAuditInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateScheduledAuditInputBuilder {
    pub(crate) frequency: ::std::option::Option<crate::types::AuditFrequency>,
    pub(crate) day_of_month: ::std::option::Option<::std::string::String>,
    pub(crate) day_of_week: ::std::option::Option<crate::types::DayOfWeek>,
    pub(crate) target_check_names: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) scheduled_audit_name: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CreateScheduledAuditInputBuilder {
    /// <p>How often the scheduled audit takes place, either <code>DAILY</code>, <code>WEEKLY</code>, <code>BIWEEKLY</code> or <code>MONTHLY</code>. The start time of each audit is determined by the system.</p>
    /// This field is required.
    pub fn frequency(mut self, input: crate::types::AuditFrequency) -> Self {
        self.frequency = ::std::option::Option::Some(input);
        self
    }
    /// <p>How often the scheduled audit takes place, either <code>DAILY</code>, <code>WEEKLY</code>, <code>BIWEEKLY</code> or <code>MONTHLY</code>. The start time of each audit is determined by the system.</p>
    pub fn set_frequency(mut self, input: ::std::option::Option<crate::types::AuditFrequency>) -> Self {
        self.frequency = input;
        self
    }
    /// <p>How often the scheduled audit takes place, either <code>DAILY</code>, <code>WEEKLY</code>, <code>BIWEEKLY</code> or <code>MONTHLY</code>. The start time of each audit is determined by the system.</p>
    pub fn get_frequency(&self) -> &::std::option::Option<crate::types::AuditFrequency> {
        &self.frequency
    }
    /// <p>The day of the month on which the scheduled audit takes place. This can be "1" through "31" or "LAST". This field is required if the "frequency" parameter is set to <code>MONTHLY</code>. If days 29 to 31 are specified, and the month doesn't have that many days, the audit takes place on the <code>LAST</code> day of the month.</p>
    pub fn day_of_month(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.day_of_month = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The day of the month on which the scheduled audit takes place. This can be "1" through "31" or "LAST". This field is required if the "frequency" parameter is set to <code>MONTHLY</code>. If days 29 to 31 are specified, and the month doesn't have that many days, the audit takes place on the <code>LAST</code> day of the month.</p>
    pub fn set_day_of_month(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.day_of_month = input;
        self
    }
    /// <p>The day of the month on which the scheduled audit takes place. This can be "1" through "31" or "LAST". This field is required if the "frequency" parameter is set to <code>MONTHLY</code>. If days 29 to 31 are specified, and the month doesn't have that many days, the audit takes place on the <code>LAST</code> day of the month.</p>
    pub fn get_day_of_month(&self) -> &::std::option::Option<::std::string::String> {
        &self.day_of_month
    }
    /// <p>The day of the week on which the scheduled audit takes place, either <code>SUN</code>, <code>MON</code>, <code>TUE</code>, <code>WED</code>, <code>THU</code>, <code>FRI</code>, or <code>SAT</code>. This field is required if the <code>frequency</code> parameter is set to <code>WEEKLY</code> or <code>BIWEEKLY</code>.</p>
    pub fn day_of_week(mut self, input: crate::types::DayOfWeek) -> Self {
        self.day_of_week = ::std::option::Option::Some(input);
        self
    }
    /// <p>The day of the week on which the scheduled audit takes place, either <code>SUN</code>, <code>MON</code>, <code>TUE</code>, <code>WED</code>, <code>THU</code>, <code>FRI</code>, or <code>SAT</code>. This field is required if the <code>frequency</code> parameter is set to <code>WEEKLY</code> or <code>BIWEEKLY</code>.</p>
    pub fn set_day_of_week(mut self, input: ::std::option::Option<crate::types::DayOfWeek>) -> Self {
        self.day_of_week = input;
        self
    }
    /// <p>The day of the week on which the scheduled audit takes place, either <code>SUN</code>, <code>MON</code>, <code>TUE</code>, <code>WED</code>, <code>THU</code>, <code>FRI</code>, or <code>SAT</code>. This field is required if the <code>frequency</code> parameter is set to <code>WEEKLY</code> or <code>BIWEEKLY</code>.</p>
    pub fn get_day_of_week(&self) -> &::std::option::Option<crate::types::DayOfWeek> {
        &self.day_of_week
    }
    /// Appends an item to `target_check_names`.
    ///
    /// To override the contents of this collection use [`set_target_check_names`](Self::set_target_check_names).
    ///
    /// <p>Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use <code>DescribeAccountAuditConfiguration</code> to see the list of all checks, including those that are enabled or use <code>UpdateAccountAuditConfiguration</code> to select which checks are enabled.)</p>
    pub fn target_check_names(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.target_check_names.unwrap_or_default();
        v.push(input.into());
        self.target_check_names = ::std::option::Option::Some(v);
        self
    }
    /// <p>Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use <code>DescribeAccountAuditConfiguration</code> to see the list of all checks, including those that are enabled or use <code>UpdateAccountAuditConfiguration</code> to select which checks are enabled.)</p>
    pub fn set_target_check_names(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.target_check_names = input;
        self
    }
    /// <p>Which checks are performed during the scheduled audit. Checks must be enabled for your account. (Use <code>DescribeAccountAuditConfiguration</code> to see the list of all checks, including those that are enabled or use <code>UpdateAccountAuditConfiguration</code> to select which checks are enabled.)</p>
    pub fn get_target_check_names(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.target_check_names
    }
    /// <p>The name you want to give to the scheduled audit. (Max. 128 chars)</p>
    /// This field is required.
    pub fn scheduled_audit_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.scheduled_audit_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name you want to give to the scheduled audit. (Max. 128 chars)</p>
    pub fn set_scheduled_audit_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.scheduled_audit_name = input;
        self
    }
    /// <p>The name you want to give to the scheduled audit. (Max. 128 chars)</p>
    pub fn get_scheduled_audit_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.scheduled_audit_name
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>Metadata that can be used to manage the scheduled audit.</p>
    pub fn tags(mut self, input: crate::types::Tag) -> Self {
        let mut v = self.tags.unwrap_or_default();
        v.push(input);
        self.tags = ::std::option::Option::Some(v);
        self
    }
    /// <p>Metadata that can be used to manage the scheduled audit.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>Metadata that can be used to manage the scheduled audit.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CreateScheduledAuditInput`](crate::operation::create_scheduled_audit::CreateScheduledAuditInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::create_scheduled_audit::CreateScheduledAuditInput, ::aws_smithy_types::error::operation::BuildError>
    {
        ::std::result::Result::Ok(crate::operation::create_scheduled_audit::CreateScheduledAuditInput {
            frequency: self.frequency,
            day_of_month: self.day_of_month,
            day_of_week: self.day_of_week,
            target_check_names: self.target_check_names,
            scheduled_audit_name: self.scheduled_audit_name,
            tags: self.tags,
        })
    }
}