aws-sdk-rds 1.132.0

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

/// <p></p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct CopyOptionGroupInput {
    /// <p>The identifier for the source option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must specify a valid option group.</p></li>
    /// </ul>
    pub source_option_group_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The identifier for the copied option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Can't be null, empty, or blank</p></li>
    /// <li>
    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens</p></li>
    /// <li>
    /// <p>First character must be a letter</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
    /// </ul>
    /// <p>Example: <code>my-option-group</code></p>
    pub target_option_group_identifier: ::std::option::Option<::std::string::String>,
    /// <p>The description for the copied option group.</p>
    pub target_option_group_description: ::std::option::Option<::std::string::String>,
    /// <p>A list of tags.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html">Tagging Amazon RDS resources</a> in the <i>Amazon RDS User Guide</i> or <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html">Tagging Amazon Aurora and Amazon RDS resources</a> in the <i>Amazon Aurora User Guide</i>.</p>
    pub tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CopyOptionGroupInput {
    /// <p>The identifier for the source option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must specify a valid option group.</p></li>
    /// </ul>
    pub fn source_option_group_identifier(&self) -> ::std::option::Option<&str> {
        self.source_option_group_identifier.as_deref()
    }
    /// <p>The identifier for the copied option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Can't be null, empty, or blank</p></li>
    /// <li>
    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens</p></li>
    /// <li>
    /// <p>First character must be a letter</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
    /// </ul>
    /// <p>Example: <code>my-option-group</code></p>
    pub fn target_option_group_identifier(&self) -> ::std::option::Option<&str> {
        self.target_option_group_identifier.as_deref()
    }
    /// <p>The description for the copied option group.</p>
    pub fn target_option_group_description(&self) -> ::std::option::Option<&str> {
        self.target_option_group_description.as_deref()
    }
    /// <p>A list of tags.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html">Tagging Amazon RDS resources</a> in the <i>Amazon RDS User Guide</i> or <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html">Tagging Amazon Aurora and Amazon RDS resources</a> in the <i>Amazon Aurora User Guide</i>.</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 CopyOptionGroupInput {
    /// Creates a new builder-style object to manufacture [`CopyOptionGroupInput`](crate::operation::copy_option_group::CopyOptionGroupInput).
    pub fn builder() -> crate::operation::copy_option_group::builders::CopyOptionGroupInputBuilder {
        crate::operation::copy_option_group::builders::CopyOptionGroupInputBuilder::default()
    }
}

/// A builder for [`CopyOptionGroupInput`](crate::operation::copy_option_group::CopyOptionGroupInput).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct CopyOptionGroupInputBuilder {
    pub(crate) source_option_group_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) target_option_group_identifier: ::std::option::Option<::std::string::String>,
    pub(crate) target_option_group_description: ::std::option::Option<::std::string::String>,
    pub(crate) tags: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>,
}
impl CopyOptionGroupInputBuilder {
    /// <p>The identifier for the source option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must specify a valid option group.</p></li>
    /// </ul>
    /// This field is required.
    pub fn source_option_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.source_option_group_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the source option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must specify a valid option group.</p></li>
    /// </ul>
    pub fn set_source_option_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.source_option_group_identifier = input;
        self
    }
    /// <p>The identifier for the source option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Must specify a valid option group.</p></li>
    /// </ul>
    pub fn get_source_option_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.source_option_group_identifier
    }
    /// <p>The identifier for the copied option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Can't be null, empty, or blank</p></li>
    /// <li>
    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens</p></li>
    /// <li>
    /// <p>First character must be a letter</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
    /// </ul>
    /// <p>Example: <code>my-option-group</code></p>
    /// This field is required.
    pub fn target_option_group_identifier(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target_option_group_identifier = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The identifier for the copied option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Can't be null, empty, or blank</p></li>
    /// <li>
    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens</p></li>
    /// <li>
    /// <p>First character must be a letter</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
    /// </ul>
    /// <p>Example: <code>my-option-group</code></p>
    pub fn set_target_option_group_identifier(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target_option_group_identifier = input;
        self
    }
    /// <p>The identifier for the copied option group.</p>
    /// <p>Constraints:</p>
    /// <ul>
    /// <li>
    /// <p>Can't be null, empty, or blank</p></li>
    /// <li>
    /// <p>Must contain from 1 to 255 letters, numbers, or hyphens</p></li>
    /// <li>
    /// <p>First character must be a letter</p></li>
    /// <li>
    /// <p>Can't end with a hyphen or contain two consecutive hyphens</p></li>
    /// </ul>
    /// <p>Example: <code>my-option-group</code></p>
    pub fn get_target_option_group_identifier(&self) -> &::std::option::Option<::std::string::String> {
        &self.target_option_group_identifier
    }
    /// <p>The description for the copied option group.</p>
    /// This field is required.
    pub fn target_option_group_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.target_option_group_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description for the copied option group.</p>
    pub fn set_target_option_group_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.target_option_group_description = input;
        self
    }
    /// <p>The description for the copied option group.</p>
    pub fn get_target_option_group_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.target_option_group_description
    }
    /// Appends an item to `tags`.
    ///
    /// To override the contents of this collection use [`set_tags`](Self::set_tags).
    ///
    /// <p>A list of tags.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html">Tagging Amazon RDS resources</a> in the <i>Amazon RDS User Guide</i> or <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html">Tagging Amazon Aurora and Amazon RDS resources</a> in the <i>Amazon Aurora User Guide</i>.</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>A list of tags.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html">Tagging Amazon RDS resources</a> in the <i>Amazon RDS User Guide</i> or <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html">Tagging Amazon Aurora and Amazon RDS resources</a> in the <i>Amazon Aurora User Guide</i>.</p>
    pub fn set_tags(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::Tag>>) -> Self {
        self.tags = input;
        self
    }
    /// <p>A list of tags.</p>
    /// <p>For more information, see <a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_Tagging.html">Tagging Amazon RDS resources</a> in the <i>Amazon RDS User Guide</i> or <a href="https://docs.aws.amazon.com/AmazonRDS/latest/AuroraUserGuide/USER_Tagging.html">Tagging Amazon Aurora and Amazon RDS resources</a> in the <i>Amazon Aurora User Guide</i>.</p>
    pub fn get_tags(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::Tag>> {
        &self.tags
    }
    /// Consumes the builder and constructs a [`CopyOptionGroupInput`](crate::operation::copy_option_group::CopyOptionGroupInput).
    pub fn build(
        self,
    ) -> ::std::result::Result<crate::operation::copy_option_group::CopyOptionGroupInput, ::aws_smithy_types::error::operation::BuildError> {
        ::std::result::Result::Ok(crate::operation::copy_option_group::CopyOptionGroupInput {
            source_option_group_identifier: self.source_option_group_identifier,
            target_option_group_identifier: self.target_option_group_identifier,
            target_option_group_description: self.target_option_group_description,
            tags: self.tags,
        })
    }
}