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.
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CreateSnapshotScheduleInput {
    /// <p>The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)".</p>
    pub schedule_definitions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    /// <p>A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.</p>
    pub schedule_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The description of the snapshot schedule.</p>
    pub schedule_description: ::std::option::Option<::std::string::String>,
    /// <p>An optional set of tags you can use to search for the schedule.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    /// <p></p>
    pub dry_run: ::std::option::Option<bool>,
    /// <p></p>
    pub next_invocations: ::std::option::Option<i32>,
}
impl CreateSnapshotScheduleInput {
    /// <p>The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)".</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 `.schedule_definitions.is_none()`.
    pub fn schedule_definitions(&self) -> &[::std::string::String] {
        self.schedule_definitions.as_deref().unwrap_or_default()
    }
    /// <p>A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.</p>
    pub fn schedule_identifier(&self) -> ::std::option::Option<&str> {
        self.schedule_identifier.as_deref()
    }
    /// <p>The description of the snapshot schedule.</p>
    pub fn schedule_description(&self) -> ::std::option::Option<&str> {
        self.schedule_description.as_deref()
    }
    /// <p>An optional set of tags you can use to search for the schedule.</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()
    }
    /// <p></p>
    pub fn dry_run(&self) -> ::std::option::Option<bool> {
        self.dry_run
    }
    /// <p></p>
    pub fn next_invocations(&self) -> ::std::option::Option<i32> {
        self.next_invocations
    }
}
impl CreateSnapshotScheduleInput {
    /// Creates a new builder-style object to manufacture [`CreateSnapshotScheduleInput`](crate::operation::create_snapshot_schedule::CreateSnapshotScheduleInput).
    pub fn builder() -> crate::operation::create_snapshot_schedule::builders::CreateSnapshotScheduleInputBuilder {
        crate::operation::create_snapshot_schedule::builders::CreateSnapshotScheduleInputBuilder::default()
    }
}

/// A builder for [`CreateSnapshotScheduleInput`](crate::operation::create_snapshot_schedule::CreateSnapshotScheduleInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CreateSnapshotScheduleInputBuilder {
    pub(crate) schedule_definitions: ::std::option::Option<::std::vec::Vec<::std::string::String>>,
    pub(crate) schedule_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) schedule_description: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
    pub(crate) dry_run: ::std::option::Option<bool>,
    pub(crate) next_invocations: ::std::option::Option<i32>,
}
impl CreateSnapshotScheduleInputBuilder {
    /// Appends an item to `schedule_definitions`.
    ///
    /// To override the contents of this collection use [`set_schedule_definitions`](Self::set_schedule_definitions).
    ///
    /// <p>The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)".</p>
    pub fn schedule_definitions(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        let mut v = self.schedule_definitions.unwrap_or_default();
        v.push(input.into());
        self.schedule_definitions = ::std::option::Option::Some(v);
        self
    }
    /// <p>The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)".</p>
    pub fn set_schedule_definitions(mut self, input: ::std::option::Option<::std::vec::Vec<::std::string::String>>) -> Self {
        self.schedule_definitions = input;
        self
    }
    /// <p>The definition of the snapshot schedule. The definition is made up of schedule expressions, for example "cron(30 12 *)" or "rate(12 hours)".</p>
    pub fn get_schedule_definitions(&self) -> &::std::option::Option<::std::vec::Vec<::std::string::String>> {
        &self.schedule_definitions
    }
    /// <p>A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.</p>
    pub fn schedule_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.schedule_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.</p>
    pub fn set_schedule_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.schedule_identifier = input;
        self
    }
    /// <p>A unique identifier for a snapshot schedule. Only alphanumeric characters are allowed for the identifier.</p>
    pub fn get_schedule_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.schedule_identifier
    }
    /// <p>The description of the snapshot schedule.</p>
    pub fn schedule_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.schedule_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the snapshot schedule.</p>
    pub fn set_schedule_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.schedule_description = input;
        self
    }
    /// <p>The description of the snapshot schedule.</p>
    pub fn get_schedule_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.schedule_description
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>An optional set of tags you can use to search for the schedule.</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>An optional set of tags you can use to search for the schedule.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>An optional set of tags you can use to search for the schedule.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// <p></p>
    pub fn dry_run(mut self, input: bool) -> Self {
        self.dry_run = ::std::option::Option::Some(input);
        self
    }
    /// <p></p>
    pub fn set_dry_run(mut self, input: ::std::option::Option<bool>) -> Self {
        self.dry_run = input;
        self
    }
    /// <p></p>
    pub fn get_dry_run(&self) -> &::std::option::Option<bool> {
        &self.dry_run
    }
    /// <p></p>
    pub fn next_invocations(mut self, input: i32) -> Self {
        self.next_invocations = ::std::option::Option::Some(input);
        self
    }
    /// <p></p>
    pub fn set_next_invocations(mut self, input: ::std::option::Option<i32>) -> Self {
        self.next_invocations = input;
        self
    }
    /// <p></p>
    pub fn get_next_invocations(&self) -> &::std::option::Option<i32> {
        &self.next_invocations
    }
    /// Consumes the builder and constructs a [`CreateSnapshotScheduleInput`](crate::operation::create_snapshot_schedule::CreateSnapshotScheduleInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<
        crate::operation::create_snapshot_schedule::CreateSnapshotScheduleInput,
        ::aws_smithy_types::error::operation::BuildError,
    > {
        ::std::result::Result::Ok(crate::operation::create_snapshot_schedule::CreateSnapshotScheduleInput {
            schedule_definitions: self.schedule_definitions,
            schedule_identifier: self.schedule_identifier,
            schedule_description: self.schedule_description,
            tags: self.tags,
            dry_run: self.dry_run,
            next_invocations: self.next_invocations,
        })
    }
}