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>The details of an option.</p>
#[non_exhaustive]
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
pub struct Option {
    /// <p>The name of the option.</p>
    pub option_name: ::std::option::Option<::std::string::String>,
    /// <p>The description of the option.</p>
    pub option_description: ::std::option::Option<::std::string::String>,
    /// <p>Indicates whether this option is persistent.</p>
    pub persistent: ::std::option::Option<bool>,
    /// <p>Indicates whether this option is permanent.</p>
    pub permanent: ::std::option::Option<bool>,
    /// <p>If required, the port configured for this option to use.</p>
    pub port: ::std::option::Option<i32>,
    /// <p>The version of the option.</p>
    pub option_version: ::std::option::Option<::std::string::String>,
    /// <p>The option settings for this option.</p>
    pub option_settings: ::std::option::Option<::std::vec::Vec<crate::types::OptionSetting>>,
    /// <p>If the option requires access to a port, then this DB security group allows access to the port.</p>
    pub db_security_group_memberships: ::std::option::Option<::std::vec::Vec<crate::types::DbSecurityGroupMembership>>,
    /// <p>If the option requires access to a port, then this VPC security group allows access to the port.</p>
    pub vpc_security_group_memberships: ::std::option::Option<::std::vec::Vec<crate::types::VpcSecurityGroupMembership>>,
}
impl Option {
    /// <p>The name of the option.</p>
    pub fn option_name(&self) -> ::std::option::Option<&str> {
        self.option_name.as_deref()
    }
    /// <p>The description of the option.</p>
    pub fn option_description(&self) -> ::std::option::Option<&str> {
        self.option_description.as_deref()
    }
    /// <p>Indicates whether this option is persistent.</p>
    pub fn persistent(&self) -> ::std::option::Option<bool> {
        self.persistent
    }
    /// <p>Indicates whether this option is permanent.</p>
    pub fn permanent(&self) -> ::std::option::Option<bool> {
        self.permanent
    }
    /// <p>If required, the port configured for this option to use.</p>
    pub fn port(&self) -> ::std::option::Option<i32> {
        self.port
    }
    /// <p>The version of the option.</p>
    pub fn option_version(&self) -> ::std::option::Option<&str> {
        self.option_version.as_deref()
    }
    /// <p>The option settings for this option.</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 `.option_settings.is_none()`.
    pub fn option_settings(&self) -> &[crate::types::OptionSetting] {
        self.option_settings.as_deref().unwrap_or_default()
    }
    /// <p>If the option requires access to a port, then this DB security group allows access to the port.</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 `.db_security_group_memberships.is_none()`.
    pub fn db_security_group_memberships(&self) -> &[crate::types::DbSecurityGroupMembership] {
        self.db_security_group_memberships.as_deref().unwrap_or_default()
    }
    /// <p>If the option requires access to a port, then this VPC security group allows access to the port.</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 `.vpc_security_group_memberships.is_none()`.
    pub fn vpc_security_group_memberships(&self) -> &[crate::types::VpcSecurityGroupMembership] {
        self.vpc_security_group_memberships.as_deref().unwrap_or_default()
    }
}
impl Option {
    /// Creates a new builder-style object to manufacture [`Option`](crate::types::Option).
    pub fn builder() -> crate::types::builders::OptionBuilder {
        crate::types::builders::OptionBuilder::default()
    }
}

/// A builder for [`Option`](crate::types::Option).
#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
#[non_exhaustive]
pub struct OptionBuilder {
    pub(crate) option_name: ::std::option::Option<::std::string::String>,
    pub(crate) option_description: ::std::option::Option<::std::string::String>,
    pub(crate) persistent: ::std::option::Option<bool>,
    pub(crate) permanent: ::std::option::Option<bool>,
    pub(crate) port: ::std::option::Option<i32>,
    pub(crate) option_version: ::std::option::Option<::std::string::String>,
    pub(crate) option_settings: ::std::option::Option<::std::vec::Vec<crate::types::OptionSetting>>,
    pub(crate) db_security_group_memberships: ::std::option::Option<::std::vec::Vec<crate::types::DbSecurityGroupMembership>>,
    pub(crate) vpc_security_group_memberships: ::std::option::Option<::std::vec::Vec<crate::types::VpcSecurityGroupMembership>>,
}
impl OptionBuilder {
    /// <p>The name of the option.</p>
    pub fn option_name(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.option_name = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The name of the option.</p>
    pub fn set_option_name(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.option_name = input;
        self
    }
    /// <p>The name of the option.</p>
    pub fn get_option_name(&self) -> &::std::option::Option<::std::string::String> {
        &self.option_name
    }
    /// <p>The description of the option.</p>
    pub fn option_description(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.option_description = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The description of the option.</p>
    pub fn set_option_description(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.option_description = input;
        self
    }
    /// <p>The description of the option.</p>
    pub fn get_option_description(&self) -> &::std::option::Option<::std::string::String> {
        &self.option_description
    }
    /// <p>Indicates whether this option is persistent.</p>
    pub fn persistent(mut self, input: bool) -> Self {
        self.persistent = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether this option is persistent.</p>
    pub fn set_persistent(mut self, input: ::std::option::Option<bool>) -> Self {
        self.persistent = input;
        self
    }
    /// <p>Indicates whether this option is persistent.</p>
    pub fn get_persistent(&self) -> &::std::option::Option<bool> {
        &self.persistent
    }
    /// <p>Indicates whether this option is permanent.</p>
    pub fn permanent(mut self, input: bool) -> Self {
        self.permanent = ::std::option::Option::Some(input);
        self
    }
    /// <p>Indicates whether this option is permanent.</p>
    pub fn set_permanent(mut self, input: ::std::option::Option<bool>) -> Self {
        self.permanent = input;
        self
    }
    /// <p>Indicates whether this option is permanent.</p>
    pub fn get_permanent(&self) -> &::std::option::Option<bool> {
        &self.permanent
    }
    /// <p>If required, the port configured for this option to use.</p>
    pub fn port(mut self, input: i32) -> Self {
        self.port = ::std::option::Option::Some(input);
        self
    }
    /// <p>If required, the port configured for this option to use.</p>
    pub fn set_port(mut self, input: ::std::option::Option<i32>) -> Self {
        self.port = input;
        self
    }
    /// <p>If required, the port configured for this option to use.</p>
    pub fn get_port(&self) -> &::std::option::Option<i32> {
        &self.port
    }
    /// <p>The version of the option.</p>
    pub fn option_version(mut self, input: impl ::std::convert::Into<::std::string::String>) -> Self {
        self.option_version = ::std::option::Option::Some(input.into());
        self
    }
    /// <p>The version of the option.</p>
    pub fn set_option_version(mut self, input: ::std::option::Option<::std::string::String>) -> Self {
        self.option_version = input;
        self
    }
    /// <p>The version of the option.</p>
    pub fn get_option_version(&self) -> &::std::option::Option<::std::string::String> {
        &self.option_version
    }
    /// Appends an item to `option_settings`.
    ///
    /// To override the contents of this collection use [`set_option_settings`](Self::set_option_settings).
    ///
    /// <p>The option settings for this option.</p>
    pub fn option_settings(mut self, input: crate::types::OptionSetting) -> Self {
        let mut v = self.option_settings.unwrap_or_default();
        v.push(input);
        self.option_settings = ::std::option::Option::Some(v);
        self
    }
    /// <p>The option settings for this option.</p>
    pub fn set_option_settings(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::OptionSetting>>) -> Self {
        self.option_settings = input;
        self
    }
    /// <p>The option settings for this option.</p>
    pub fn get_option_settings(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::OptionSetting>> {
        &self.option_settings
    }
    /// Appends an item to `db_security_group_memberships`.
    ///
    /// To override the contents of this collection use [`set_db_security_group_memberships`](Self::set_db_security_group_memberships).
    ///
    /// <p>If the option requires access to a port, then this DB security group allows access to the port.</p>
    pub fn db_security_group_memberships(mut self, input: crate::types::DbSecurityGroupMembership) -> Self {
        let mut v = self.db_security_group_memberships.unwrap_or_default();
        v.push(input);
        self.db_security_group_memberships = ::std::option::Option::Some(v);
        self
    }
    /// <p>If the option requires access to a port, then this DB security group allows access to the port.</p>
    pub fn set_db_security_group_memberships(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::DbSecurityGroupMembership>>,
    ) -> Self {
        self.db_security_group_memberships = input;
        self
    }
    /// <p>If the option requires access to a port, then this DB security group allows access to the port.</p>
    pub fn get_db_security_group_memberships(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::DbSecurityGroupMembership>> {
        &self.db_security_group_memberships
    }
    /// Appends an item to `vpc_security_group_memberships`.
    ///
    /// To override the contents of this collection use [`set_vpc_security_group_memberships`](Self::set_vpc_security_group_memberships).
    ///
    /// <p>If the option requires access to a port, then this VPC security group allows access to the port.</p>
    pub fn vpc_security_group_memberships(mut self, input: crate::types::VpcSecurityGroupMembership) -> Self {
        let mut v = self.vpc_security_group_memberships.unwrap_or_default();
        v.push(input);
        self.vpc_security_group_memberships = ::std::option::Option::Some(v);
        self
    }
    /// <p>If the option requires access to a port, then this VPC security group allows access to the port.</p>
    pub fn set_vpc_security_group_memberships(
        mut self,
        input: ::std::option::Option<::std::vec::Vec<crate::types::VpcSecurityGroupMembership>>,
    ) -> Self {
        self.vpc_security_group_memberships = input;
        self
    }
    /// <p>If the option requires access to a port, then this VPC security group allows access to the port.</p>
    pub fn get_vpc_security_group_memberships(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::VpcSecurityGroupMembership>> {
        &self.vpc_security_group_memberships
    }
    /// Consumes the builder and constructs a [`Option`](crate::types::Option).
    pub fn build(self) -> crate::types::Option {
        crate::types::Option {
            option_name: self.option_name,
            option_description: self.option_description,
            persistent: self.persistent,
            permanent: self.permanent,
            port: self.port,
            option_version: self.option_version,
            option_settings: self.option_settings,
            db_security_group_memberships: self.db_security_group_memberships,
            vpc_security_group_memberships: self.vpc_security_group_memberships,
        }
    }
}