# This file is automatically generated by botocraft.  Do not edit directly.
# pylint: disable=anomalous-backslash-in-string,unsubscriptable-object,line-too-long,arguments-differ,arguments-renamed,unused-import,redefined-outer-name
# pyright: reportUnusedImport=false
# mypy: disable-error-code="index, override, assignment, union-attr, misc"
from datetime import datetime
from typing import Any, ClassVar, Dict, List, Literal, Optional, Type, cast

from pydantic import Field

from botocraft.mixins.tags import TagsDictMixin
from botocraft.services.common import Filter, Tag

from .abstract import (Boto3Model, Boto3ModelManager, PrimaryBoto3Model,
                       ReadonlyBoto3Model, ReadonlyBoto3ModelManager,
                       ReadonlyPrimaryBoto3Model)

# ===============
# Managers
# ===============


class DBInstanceManager(Boto3ModelManager):

    service_name: str = "rds"

    def create(
        self,
        model: "DBInstance",
        MasterUserPassword: Optional[str] = None,
        VpcSecurityGroupIds: Optional[List[str]] = None,
        DBSubnetGroupName: Optional[str] = None,
        DBParameterGroupName: Optional[str] = None,
        OptionGroupName: Optional[str] = None,
        TdeCredentialPassword: Optional[str] = None,
        Domain: Optional[str] = None,
        DomainFqdn: Optional[str] = None,
        DomainOu: Optional[str] = None,
        DomainAuthSecretArn: Optional[str] = None,
        DomainDnsIps: Optional[List[str]] = None,
        DomainIAMRoleName: Optional[str] = None,
        ManageMasterUserPassword: Optional[bool] = None,
        MasterUserSecretKmsKeyId: Optional[str] = None,
    ) -> "DBInstance":
        """
        Creates a new DB instance.

        Args:
            model: The :py:class:``DBInstance`` to create.

        Keyword Args:
            MasterUserPassword: The password for the master user.
            VpcSecurityGroupIds: A list of Amazon EC2 VPC security groups to associate
                with this DB instance.
            DBSubnetGroupName: A DB subnet group to associate with this DB instance.
            DBParameterGroupName: The name of the DB parameter group to associate with
                this DB instance. If you don't specify a value, then Amazon RDS uses the
                default DB parameter group for the specified DB engine and version.
            OptionGroupName: The option group to associate the DB instance with.
            TdeCredentialPassword: The password for the given ARN from the key store in
                order to access the device.
            Domain: The Active Directory directory ID to create the DB instance in.
                Currently, you can create only Db2, MySQL, Microsoft SQL Server, Oracle,
                and PostgreSQL DB instances in an Active Directory Domain.
            DomainFqdn: The fully qualified domain name (FQDN) of an Active Directory
                domain.
            DomainOu: The Active Directory organizational unit for your DB instance to
                join.
            DomainAuthSecretArn: The ARN for the Secrets Manager secret with the
                credentials for the user joining the domain.
            DomainDnsIps: The IPv4 DNS IP addresses of your primary and secondary
                Active Directory domain controllers.
            DomainIAMRoleName: The name of the IAM role to use when making API calls to
                the Directory Service.
            ManageMasterUserPassword: Specifies whether to manage the master user
                password with Amazon Web Services Secrets Manager.
            MasterUserSecretKmsKeyId: The Amazon Web Services KMS key identifier to
                encrypt a secret that is automatically generated and managed in Amazon Web
                Services Secrets Manager.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            DBInstanceIdentifier=data.get("DBInstanceIdentifier"),
            DBInstanceClass=data.get("DBInstanceClass"),
            Engine=data.get("Engine"),
            DBName=data.get("DBName"),
            AllocatedStorage=data.get("AllocatedStorage"),
            MasterUsername=data.get("MasterUsername"),
            MasterUserPassword=self.serialize(MasterUserPassword),
            VpcSecurityGroupIds=self.serialize(VpcSecurityGroupIds),
            AvailabilityZone=data.get("AvailabilityZone"),
            DBSubnetGroupName=self.serialize(DBSubnetGroupName),
            PreferredMaintenanceWindow=data.get("PreferredMaintenanceWindow"),
            DBParameterGroupName=self.serialize(DBParameterGroupName),
            BackupRetentionPeriod=data.get("BackupRetentionPeriod"),
            PreferredBackupWindow=data.get("PreferredBackupWindow"),
            DbInstancePort=data.get("DbInstancePort"),
            MultiAZ=data.get("MultiAZ"),
            EngineVersion=data.get("EngineVersion"),
            AutoMinorVersionUpgrade=data.get("AutoMinorVersionUpgrade"),
            LicenseModel=data.get("LicenseModel"),
            Iops=data.get("Iops"),
            OptionGroupName=self.serialize(OptionGroupName),
            CharacterSetName=data.get("CharacterSetName"),
            NcharCharacterSetName=data.get("NcharCharacterSetName"),
            PubliclyAccessible=data.get("PubliclyAccessible"),
            TagList=data.get("TagList"),
            DBClusterIdentifier=data.get("DBClusterIdentifier"),
            StorageType=data.get("StorageType"),
            TdeCredentialArn=data.get("TdeCredentialArn"),
            TdeCredentialPassword=self.serialize(TdeCredentialPassword),
            StorageEncrypted=data.get("StorageEncrypted"),
            KmsKeyId=data.get("KmsKeyId"),
            Domain=self.serialize(Domain),
            DomainFqdn=self.serialize(DomainFqdn),
            DomainOu=self.serialize(DomainOu),
            DomainAuthSecretArn=self.serialize(DomainAuthSecretArn),
            DomainDnsIps=self.serialize(DomainDnsIps),
            CopyTagsToSnapshot=data.get("CopyTagsToSnapshot"),
            MonitoringInterval=data.get("MonitoringInterval"),
            MonitoringRoleArn=data.get("MonitoringRoleArn"),
            DomainIAMRoleName=self.serialize(DomainIAMRoleName),
            PromotionTier=data.get("PromotionTier"),
            Timezone=data.get("Timezone"),
            IAMDatabaseAuthenticationEnabled=data.get(
                "IAMDatabaseAuthenticationEnabled"
            ),
            PerformanceInsightsEnabled=data.get("PerformanceInsightsEnabled"),
            PerformanceInsightsKMSKeyId=data.get("PerformanceInsightsKMSKeyId"),
            PerformanceInsightsRetentionPeriod=data.get(
                "PerformanceInsightsRetentionPeriod"
            ),
            EnabledCloudwatchLogsExports=data.get("EnabledCloudwatchLogsExports"),
            ProcessorFeatures=data.get("ProcessorFeatures"),
            DeletionProtection=data.get("DeletionProtection"),
            MaxAllocatedStorage=data.get("MaxAllocatedStorage"),
            CustomerOwnedIpEnabled=data.get("CustomerOwnedIpEnabled"),
            CustomIamInstanceProfile=data.get("CustomIamInstanceProfile"),
            BackupTarget=data.get("BackupTarget"),
            NetworkType=data.get("NetworkType"),
            StorageThroughput=data.get("StorageThroughput"),
            ManageMasterUserPassword=self.serialize(ManageMasterUserPassword),
            MasterUserSecretKmsKeyId=self.serialize(MasterUserSecretKmsKeyId),
            CACertificateIdentifier=data.get("CACertificateIdentifier"),
            DBSystemId=data.get("DBSystemId"),
            DedicatedLogVolume=data.get("DedicatedLogVolume"),
            MultiTenant=data.get("MultiTenant"),
            EngineLifecycleSupport=data.get("EngineLifecycleSupport"),
        )
        _response = self.client.create_db_instance(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = CreateDBInstanceResult(**_response)

        self.sessionize(response.RDSDBInstance)
        return cast("DBInstance", response.RDSDBInstance)

    def update(
        self,
        model: "DBInstance",
        DBSubnetGroupName: Optional[str] = None,
        VpcSecurityGroupIds: Optional[List[str]] = None,
        ApplyImmediately: Optional[bool] = None,
        MasterUserPassword: Optional[str] = None,
        DBParameterGroupName: Optional[str] = None,
        AllowMajorVersionUpgrade: Optional[bool] = None,
        OptionGroupName: Optional[str] = None,
        NewDBInstanceIdentifier: Optional[str] = None,
        TdeCredentialPassword: Optional[str] = None,
        Domain: Optional[str] = None,
        DomainFqdn: Optional[str] = None,
        DomainOu: Optional[str] = None,
        DomainAuthSecretArn: Optional[str] = None,
        DomainDnsIps: Optional[List[str]] = None,
        DBPortNumber: Optional[int] = None,
        DomainIAMRoleName: Optional[str] = None,
        DisableDomain: Optional[bool] = None,
        CloudwatchLogsExportConfiguration: Optional[
            "CloudwatchLogsExportConfiguration"
        ] = None,
        UseDefaultProcessorFeatures: Optional[bool] = None,
        CertificateRotationRestart: Optional[bool] = None,
        ResumeFullAutomationModeMinutes: Optional[int] = None,
        ManageMasterUserPassword: Optional[bool] = None,
        RotateMasterUserPassword: Optional[bool] = None,
        MasterUserSecretKmsKeyId: Optional[str] = None,
    ) -> "DBInstance":
        """
        Modifies settings for a DB instance. You can change one or more
        database configuration parameters by specifying these parameters and
        the new values in the request. To learn what modifications you can make
        to your DB instance, call ``DescribeValidDBInstanceModifications``
        before you call ``ModifyDBInstance``.

        Args:
            model: The :py:class:``DBInstance`` to update.

        Keyword Args:
            DBSubnetGroupName: The new DB subnet group for the DB instance. You can use
                this parameter to move your DB instance to a different VPC. If your DB
                instance isn't in a VPC, you can also use this parameter to move your DB
                instance into a VPC. For more information, see `Working with a DB instance
                in a VPC <https://docs.aws.amazon. com/AmazonRDS/latest/UserGuide/USER_VPC.
                WorkingWithRDSInstanceinaVPC.html#USER_ VPC.Non-VPC2VPC>`_ in the *Amazon
                RDS User Guide*.
            VpcSecurityGroupIds: A list of Amazon EC2 VPC security groups to associate
                with this DB instance. This change is asynchronously applied as soon as
                possible.
            ApplyImmediately: Specifies whether the modifications in this request and
                any pending modifications are asynchronously applied as soon as possible,
                regardless of the ``PreferredMaintenanceWindow`` setting for the DB
                instance. By default, this parameter is disabled.
            MasterUserPassword: The new password for the master user.
            DBParameterGroupName: The name of the DB parameter group to apply to the DB
                instance.
            AllowMajorVersionUpgrade: Specifies whether major version upgrades are
                allowed. Changing this parameter doesn't result in an outage and the change
                is asynchronously applied as soon as possible.
            OptionGroupName: The option group to associate the DB instance with.
            NewDBInstanceIdentifier: The new identifier for the DB instance when
                renaming a DB instance. When you change the DB instance identifier, an
                instance reboot occurs immediately if you enable ``ApplyImmediately``, or
                will occur during the next maintenance window if you disable
                ``ApplyImmediately``. This value is stored as a lowercase string.
            TdeCredentialPassword: The password for the given ARN from the key store in
                order to access the device.
            Domain: The Active Directory directory ID to move the DB instance to.
                Specify ``none`` to remove the instance from its current domain. You must
                create the domain before this operation. Currently, you can create only
                Db2, MySQL, Microsoft SQL Server, Oracle, and PostgreSQL DB instances in an
                Active Directory Domain.
            DomainFqdn: The fully qualified domain name (FQDN) of an Active Directory
                domain.
            DomainOu: The Active Directory organizational unit for your DB instance to
                join.
            DomainAuthSecretArn: The ARN for the Secrets Manager secret with the
                credentials for the user joining the domain.
            DomainDnsIps: The IPv4 DNS IP addresses of your primary and secondary
                Active Directory domain controllers.
            DBPortNumber: The port number on which the database accepts connections.
            DomainIAMRoleName: The name of the IAM role to use when making API calls to
                the Directory Service.
            DisableDomain: Specifies whether to remove the DB instance from the Active
                Directory domain.
            CloudwatchLogsExportConfiguration: The log types to be enabled for export
                to CloudWatch Logs for a specific DB instance.
            UseDefaultProcessorFeatures: Specifies whether the DB instance class of the
                DB instance uses its default processor features.
            CertificateRotationRestart: Specifies whether the DB instance is restarted
                when you rotate your SSL/TLS certificate.
            ResumeFullAutomationModeMinutes: The number of minutes to pause the
                automation. When the time period ends, RDS Custom resumes full automation.
            ManageMasterUserPassword: Specifies whether to manage the master user
                password with Amazon Web Services Secrets Manager.
            RotateMasterUserPassword: Specifies whether to rotate the secret managed by
                Amazon Web Services Secrets Manager for the master user password.
            MasterUserSecretKmsKeyId: The Amazon Web Services KMS key identifier to
                encrypt a secret that is automatically generated and managed in Amazon Web
                Services Secrets Manager.
        """
        data = model.model_dump(exclude_none=True, by_alias=True)
        args = dict(
            DBInstanceIdentifier=data.get("DBInstanceIdentifier"),
            AllocatedStorage=data.get("AllocatedStorage"),
            DBInstanceClass=data.get("DBInstanceClass"),
            DBSubnetGroupName=self.serialize(DBSubnetGroupName),
            VpcSecurityGroupIds=self.serialize(VpcSecurityGroupIds),
            ApplyImmediately=self.serialize(ApplyImmediately),
            MasterUserPassword=self.serialize(MasterUserPassword),
            DBParameterGroupName=self.serialize(DBParameterGroupName),
            BackupRetentionPeriod=data.get("BackupRetentionPeriod"),
            PreferredBackupWindow=data.get("PreferredBackupWindow"),
            PreferredMaintenanceWindow=data.get("PreferredMaintenanceWindow"),
            MultiAZ=data.get("MultiAZ"),
            EngineVersion=data.get("EngineVersion"),
            AllowMajorVersionUpgrade=self.serialize(AllowMajorVersionUpgrade),
            AutoMinorVersionUpgrade=data.get("AutoMinorVersionUpgrade"),
            LicenseModel=data.get("LicenseModel"),
            Iops=data.get("Iops"),
            OptionGroupName=self.serialize(OptionGroupName),
            NewDBInstanceIdentifier=self.serialize(NewDBInstanceIdentifier),
            StorageType=data.get("StorageType"),
            TdeCredentialArn=data.get("TdeCredentialArn"),
            TdeCredentialPassword=self.serialize(TdeCredentialPassword),
            CACertificateIdentifier=data.get("CACertificateIdentifier"),
            Domain=self.serialize(Domain),
            DomainFqdn=self.serialize(DomainFqdn),
            DomainOu=self.serialize(DomainOu),
            DomainAuthSecretArn=self.serialize(DomainAuthSecretArn),
            DomainDnsIps=self.serialize(DomainDnsIps),
            CopyTagsToSnapshot=data.get("CopyTagsToSnapshot"),
            MonitoringInterval=data.get("MonitoringInterval"),
            DBPortNumber=self.serialize(DBPortNumber),
            PubliclyAccessible=data.get("PubliclyAccessible"),
            MonitoringRoleArn=data.get("MonitoringRoleArn"),
            DomainIAMRoleName=self.serialize(DomainIAMRoleName),
            DisableDomain=self.serialize(DisableDomain),
            PromotionTier=data.get("PromotionTier"),
            IAMDatabaseAuthenticationEnabled=data.get(
                "IAMDatabaseAuthenticationEnabled"
            ),
            PerformanceInsightsEnabled=data.get("PerformanceInsightsEnabled"),
            PerformanceInsightsKMSKeyId=data.get("PerformanceInsightsKMSKeyId"),
            PerformanceInsightsRetentionPeriod=data.get(
                "PerformanceInsightsRetentionPeriod"
            ),
            CloudwatchLogsExportConfiguration=self.serialize(
                CloudwatchLogsExportConfiguration
            ),
            ProcessorFeatures=data.get("ProcessorFeatures"),
            UseDefaultProcessorFeatures=self.serialize(UseDefaultProcessorFeatures),
            DeletionProtection=data.get("DeletionProtection"),
            MaxAllocatedStorage=data.get("MaxAllocatedStorage"),
            CertificateRotationRestart=self.serialize(CertificateRotationRestart),
            ReplicaMode=data.get("ReplicaMode"),
            CustomerOwnedIpEnabled=data.get("CustomerOwnedIpEnabled"),
            AwsBackupRecoveryPointArn=data.get("AwsBackupRecoveryPointArn"),
            AutomationMode=data.get("AutomationMode"),
            ResumeFullAutomationModeMinutes=self.serialize(
                ResumeFullAutomationModeMinutes
            ),
            NetworkType=data.get("NetworkType"),
            StorageThroughput=data.get("StorageThroughput"),
            ManageMasterUserPassword=self.serialize(ManageMasterUserPassword),
            RotateMasterUserPassword=self.serialize(RotateMasterUserPassword),
            MasterUserSecretKmsKeyId=self.serialize(MasterUserSecretKmsKeyId),
            Engine=data.get("Engine"),
            DedicatedLogVolume=data.get("DedicatedLogVolume"),
            MultiTenant=data.get("MultiTenant"),
        )
        _response = self.client.modify_db_instance(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = ModifyDBInstanceResult(**_response)

        self.sessionize(response.RDSDBInstance)
        return cast("DBInstance", response.RDSDBInstance)

    def delete(
        self,
        DBInstanceIdentifier: str,
        *,
        SkipFinalSnapshot: Optional[bool] = None,
        FinalDBSnapshotIdentifier: Optional[str] = None,
        DeleteAutomatedBackups: Optional[bool] = None
    ) -> "DBInstance":
        """
        Deletes a previously provisioned DB instance. When you delete a DB
        instance, all automated backups for that instance are deleted and can't
        be recovered. However, manual DB snapshots of the DB instance aren't
        deleted.

        Args:
            DBInstanceIdentifier: The DB instance identifier for the DB instance to be
                deleted. This parameter isn't case-sensitive.

        Keyword Args:
            SkipFinalSnapshot: Specifies whether to skip the creation of a final DB
                snapshot before deleting the instance. If you enable this parameter, RDS
                doesn't create a DB snapshot. If you don't enable this parameter, RDS
                creates a DB snapshot before the DB instance is deleted. By default, skip
                isn't enabled, and the DB snapshot is created.
            FinalDBSnapshotIdentifier: The ``DBSnapshotIdentifier`` of the new
                ``DBSnapshot`` created when the ``SkipFinalSnapshot`` parameter is
                disabled.
            DeleteAutomatedBackups: Specifies whether to remove automated backups
                immediately after the DB instance is deleted. This parameter isn't case-
                sensitive. The default is to remove automated backups immediately after the
                DB instance is deleted.
        """
        args: Dict[str, Any] = dict(
            DBInstanceIdentifier=self.serialize(DBInstanceIdentifier),
            SkipFinalSnapshot=self.serialize(SkipFinalSnapshot),
            FinalDBSnapshotIdentifier=self.serialize(FinalDBSnapshotIdentifier),
            DeleteAutomatedBackups=self.serialize(DeleteAutomatedBackups),
        )
        _response = self.client.delete_db_instance(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DeleteDBInstanceResult(**_response)
        return cast(DBInstance, response.RDSDBInstance)

    def get(
        self, DBInstanceIdentifier: str, *, Filters: Optional[List[Filter]] = None
    ) -> Optional["DBInstance"]:
        """
        Describes provisioned RDS instances. This API supports pagination.

        Args:
            DBInstanceIdentifier: The user-supplied instance identifier or the Amazon
                Resource Name (ARN) of the DB instance. If this parameter is specified,
                information from only the specific DB instance is returned. This parameter
                isn't case-sensitive.

        Keyword Args:
            Filters: A filter that specifies one or more DB instances to describe.
        """
        args: Dict[str, Any] = dict(
            DBInstanceIdentifier=self.serialize(DBInstanceIdentifier),
            Filters=self.serialize(Filters),
        )
        _response = self.client.describe_db_instances(
            **{k: v for k, v in args.items() if v is not None}
        )
        response = DBInstanceMessage(**_response)

        if response and response.DBInstances:
            self.sessionize(response.DBInstances[0])
            return response.DBInstances[0]
        return None

    def list(
        self,
        *,
        DBInstanceIdentifier: Optional[str] = None,
        Filters: Optional[List[Filter]] = None
    ) -> List["DBInstance"]:
        """
        Describes provisioned RDS instances. This API supports pagination.

        Keyword Args:
            DBInstanceIdentifier: The user-supplied instance identifier or the Amazon
                Resource Name (ARN) of the DB instance. If this parameter is specified,
                information from only the specific DB instance is returned. This parameter
                isn't case-sensitive.
            Filters: A filter that specifies one or more DB instances to describe.
        """
        paginator = self.client.get_paginator("describe_db_instances")
        args: Dict[str, Any] = dict(
            DBInstanceIdentifier=self.serialize(DBInstanceIdentifier),
            Filters=self.serialize(Filters),
        )
        response_iterator = paginator.paginate(
            **{k: v for k, v in args.items() if v is not None}
        )
        results: List["DBInstance"] = []
        for _response in response_iterator:
            response = DBInstanceMessage(**_response)
            if response.DBInstances:
                results.extend(response.DBInstances)
            else:
                break
        self.sessionize(results)
        return results


# ==============
# Service Models
# ==============


class RDSEndpoint(Boto3Model):
    """
    The connection endpoint for the DB instance.

    The endpoint might not be shown for instances with the status of ``creating``.
    """

    Address: Optional[str] = None
    """
    Specifies the DNS address of the DB instance.
    """
    Port: Optional[int] = None
    """
    Specifies the port that the database engine is listening on.
    """
    HostedZoneId: Optional[str] = None
    """
    Specifies the ID that Amazon Route 53 assigns when you create a hosted
    zone.
    """


class DBSecurityGroupMembership(Boto3Model):
    """This data type is used as a response element in the following actions:

    * ``ModifyDBInstance``
    * ``RebootDBInstance``
    * ``RestoreDBInstanceFromDBSnapshot``
    * ``RestoreDBInstanceToPointInTime``
    """

    DBSecurityGroupName: Optional[str] = None
    """
    The name of the DB security group.
    """
    Status: Optional[str] = None
    """
    The status of the DB security group.
    """


class VpcSecurityGroupMembership(Boto3Model):
    """
    This data type is used as a response element for queries on VPC security
    group membership.
    """

    VpcSecurityGroupId: Optional[str] = None
    """
    The name of the VPC security group.
    """
    Status: Optional[str] = None
    """
    The membership status of the VPC security group.
    """


class DBParameterGroupStatus(Boto3Model):
    """
    The status of the DB parameter group.

    This data type is used as a response element in the following actions:

    * ``CreateDBInstance``
    * ``CreateDBInstanceReadReplica``
    * ``DeleteDBInstance``
    * ``ModifyDBInstance``
    * ``RebootDBInstance``
    * ``RestoreDBInstanceFromDBSnapshot``
    """

    DBParameterGroupName: Optional[str] = None
    """
    The name of the DB parameter group.
    """
    ParameterApplyStatus: Optional[str] = None
    """
    The status of parameter updates.

    Valid values are:
    """


class RDSAvailabilityZone(Boto3Model):
    """
    Contains Availability Zone information.

    This data type is used as an element in the ``OrderableDBInstanceOption`` data
    type.
    """

    Name: Optional[str] = None
    """
    The name of the Availability Zone.
    """


class Outpost(Boto3Model):
    """
    If the subnet is associated with an Outpost, this value specifies the
    Outpost.

    For more information about RDS on Outposts, see
    `Amazon RDS on Amazon Web Services Outposts <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-
    on-outposts.html>`_ in the *Amazon RDS User Guide.*
    """

    Arn: Optional[str] = None
    """
    The Amazon Resource Name (ARN) of the Outpost.
    """


class RDSSubnet(Boto3Model):
    """
    This data type is used as a response element for the
    ``DescribeDBSubnetGroups`` operation.
    """

    SubnetIdentifier: Optional[str] = None
    """
    The identifier of the subnet.
    """
    SubnetAvailabilityZone: Optional[RDSAvailabilityZone] = None
    """
    Contains Availability Zone information.
    """
    SubnetOutpost: Optional[Outpost] = None
    """
    If the subnet is associated with an Outpost, this value specifies the
    Outpost.
    """
    SubnetStatus: Optional[str] = None
    """
    The status of the subnet.
    """


class RDSDBSubnetGroup(Boto3Model):
    """
    Information about the subnet group associated with the DB instance,
    including the name, description, and subnets in the subnet group.
    """

    DBSubnetGroupName: Optional[str] = None
    """
    The name of the DB subnet group.
    """
    DBSubnetGroupDescription: Optional[str] = None
    """
    Provides the description of the DB subnet group.
    """
    VpcId: Optional[str] = None
    """
    Provides the VpcId of the DB subnet group.
    """
    SubnetGroupStatus: Optional[str] = None
    """
    Provides the status of the DB subnet group.
    """
    Subnets: Optional[List["RDSSubnet"]] = None
    """
    Contains a list of ``Subnet`` elements.
    """
    DBSubnetGroupArn: Optional[str] = None
    """
    The Amazon Resource Name (ARN) for the DB subnet group.
    """
    SupportedNetworkTypes: Optional[List[str]] = None
    """
    The network type of the DB subnet group.
    """


class RDSPendingCloudwatchLogsExports(Boto3Model):
    """
    A list of the log types whose configuration is still pending.

    In other words, these log types are in the process of being activated or
    deactivated.
    """

    LogTypesToEnable: Optional[List[str]] = None
    """
    Log types that are in the process of being deactivated.

    After they are deactivated, these log types aren't exported to CloudWatch
    Logs.
    """
    LogTypesToDisable: Optional[List[str]] = None
    """
    Log types that are in the process of being enabled.

    After they are enabled, these log types are exported to CloudWatch Logs.
    """


class ProcessorFeature(Boto3Model):
    """
    Contains the processor features of a DB instance class.

    To specify the number of CPU cores, use the ``coreCount`` feature name for the
    ``Name`` parameter. To specify the number of threads per core, use the
    ``threadsPerCore`` feature name for the ``Name`` parameter.

    You can set the processor features of the DB instance class for a DB instance
    when you call one of the following actions:

    * ``CreateDBInstance``
    * ``ModifyDBInstance``
    * ``RestoreDBInstanceFromDBSnapshot``
    * ``RestoreDBInstanceFromS3``
    * ``RestoreDBInstanceToPointInTime``

    You can view the valid processor values for a particular instance class by
    calling the ``DescribeOrderableDBInstanceOptions`` action and specifying the
    instance class for the ``DBInstanceClass`` parameter.

    In addition, you can use the following actions for DB instance class processor
    information:

    * ``DescribeDBInstances``
    * ``DescribeDBSnapshots``
    * ``DescribeValidDBInstanceModifications``

    If you call ``DescribeDBInstances``, ``ProcessorFeature`` returns non-null
    values only if the following conditions are met:

    * You are accessing an Oracle DB instance.
    * Your Oracle DB instance class supports configuring the number of CPU cores
      and threads per core.
    * The current number CPU cores and threads is set to a non-default value.

    For more information, see  `Configuring the processor for a DB instance class
    in RDS for Oracle <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Conce
    pts.DBInstanceClass.html#USER_ConfigureProcessor>`_ in the *Amazon RDS User
    Guide.*
    """

    Name: Optional[str] = None
    """
    The name of the processor feature.

    Valid names are ``coreCount`` and
    ``threadsPerCore``.
    """
    Value: Optional[str] = None
    """
    The value of a processor feature.
    """


class RDSPendingModifiedValues(Boto3Model):
    """
    Information about pending changes to the DB instance.

    This information is returned only when there are pending changes. Specific
    changes are identified by subelements.
    """

    DBInstanceClass: Optional[str] = None
    """
    The name of the compute and memory capacity class for the DB instance.
    """
    AllocatedStorage: Optional[int] = None
    """
    The allocated storage size for the DB instance specified in gibibytes
    (GiB).
    """
    MasterUserPassword: Optional[str] = None
    """
    The master credentials for the DB instance.
    """
    Port: Optional[int] = None
    """
    The port for the DB instance.
    """
    BackupRetentionPeriod: Optional[int] = None
    """
    The number of days for which automated backups are retained.
    """
    MultiAZ: Optional[bool] = None
    """
    Indicates whether the Single-AZ DB instance will change to a Multi-AZ
    deployment.
    """
    EngineVersion: Optional[str] = None
    """
    The database engine version.
    """
    LicenseModel: Optional[str] = None
    """
    The license model for the DB instance.
    """
    Iops: Optional[int] = None
    """
    The Provisioned IOPS value for the DB instance.
    """
    DBInstanceIdentifier: Optional[str] = None
    """
    The database identifier for the DB instance.
    """
    StorageType: Optional[str] = None
    """
    The storage type of the DB instance.
    """
    CACertificateIdentifier: Optional[str] = None
    """
    The identifier of the CA certificate for the DB instance.
    """
    DBSubnetGroupName: Optional[str] = None
    """
    The DB subnet group for the DB instance.
    """
    PendingCloudwatchLogsExports: Optional[RDSPendingCloudwatchLogsExports] = None
    """
    A list of the log types whose configuration is still pending.

    In other words, these log types are in the process of being activated or
    deactivated.
    """
    ProcessorFeatures: Optional[List["ProcessorFeature"]] = None
    """
    The number of CPU cores and the number of threads per core for the DB
    instance class of the DB instance.
    """
    IAMDatabaseAuthenticationEnabled: Optional[bool] = None
    """
    Indicates whether mapping of Amazon Web Services Identity and Access
    Management (IAM) accounts to database accounts is enabled.
    """
    AutomationMode: Optional[Literal["full", "all-paused"]] = None
    """
The automation mode of the RDS Custom DB instance: ``full`` or ``all-paused``.
If ``full``, the DB instance automates monitoring and instance recovery. If
``all-paused``, the instance pauses automation for the duration set by
``--resume-full-automation-mode-minutes``.
    """
    ResumeFullAutomationModeTime: Optional[datetime] = None
    """
    The number of minutes to pause the automation.

    When the time period ends, RDS Custom resumes full automation. The minimum
    value is 60 (default). The maximum value is 1,440.
    """
    StorageThroughput: Optional[int] = None
    """
    The storage throughput of the DB instance.
    """
    Engine: Optional[str] = None
    """
    The database engine of the DB instance.
    """
    DedicatedLogVolume: Optional[bool] = None
    """
    Indicates whether the DB instance has a dedicated log volume (DLV)
    enabled.>
    """
    MultiTenant: Optional[bool] = None
    """
    Indicates whether the DB instance will change to the multi-tenant
    configuration (TRUE) or the single-tenant configuration (FALSE).
    """


class OptionGroupMembership(Boto3Model):
    """
    Provides information on the option groups the DB instance is a member of.
    """

    OptionGroupName: Optional[str] = None
    """
    The name of the option group that the instance belongs to.
    """
    Status: Optional[str] = None
    """
    The status of the DB instance's option group membership.

    Valid values are:
    ``in-sync``, ``pending-apply``, ``pending-removal``, ``pending-maintenance-
    apply``, ``pending-maintenance-removal``, ``applying``, ``removing``, and
    ``failed``.
    """


class DBInstanceStatusInfo(Boto3Model):
    """
    Provides a list of status information for a DB instance.
    """

    StatusType: Optional[str] = None
    """
    This value is currently "read replication.".
    """
    Normal: Optional[bool] = None
    """
    Indicates whether the instance is operating normally (TRUE) or is in an
    error state (FALSE).
    """
    Status: Optional[str] = None
    """
    The status of the DB instance.

    For a StatusType of read replica, the values can be replicating,
    replication stop point set, replication stop point reached, error, stopped,
    or terminated.
    """
    Message: Optional[str] = None
    """
    Details of the error if there is an error for the instance.

    If the instance isn't in an error state, this value is blank.
    """


class DomainMembership(Boto3Model):
    """
    An Active Directory Domain membership record associated with the DB
    instance or cluster.
    """

    Domain: Optional[str] = None
    """
    The identifier of the Active Directory Domain.
    """
    Status: Optional[str] = None
    """
    The status of the Active Directory Domain membership for the DB instance or
    cluster.

    Values include ``joined``, ``pending-join``, ``failed``, and so on.
    """
    FQDN: Optional[str] = None
    """
    The fully qualified domain name (FQDN) of the Active Directory Domain.
    """
    IAMRoleName: Optional[str] = None
    """
    The name of the IAM role used when making API calls to the Directory
    Service.
    """
    OU: Optional[str] = None
    """
    The Active Directory organizational unit for the DB instance or cluster.
    """
    AuthSecretArn: Optional[str] = None
    """
    The ARN for the Secrets Manager secret with the credentials for the user
    that's a member of the domain.
    """
    DnsIps: Optional[List[str]] = None
    """
    The IPv4 DNS IP addresses of the primary and secondary Active Directory
    domain controllers.
    """


class DBInstanceRole(Boto3Model):
    """
    Information about an Amazon Web Services Identity and Access Management
    (IAM) role that is associated with a DB instance.
    """

    RoleArn: Optional[str] = None
    """
    The Amazon Resource Name (ARN) of the IAM role that is associated with the
    DB instance.
    """
    FeatureName: Optional[str] = None
    """
    The name of the feature associated with the Amazon Web Services Identity
    and Access Management (IAM) role.

    For information about supported feature names,
    see ``DBEngineVersion``.
    """
    Status: Optional[str] = None
    """
    Information about the state of association between the IAM role and the DB
    instance.

    The Status property returns one of the following values:
    """


class DBInstanceAutomatedBackupsReplication(Boto3Model):
    """
    Automated backups of a DB instance replicated to another Amazon Web
    Services Region.

    They consist of system backups, transaction logs, and database instance
    properties.
    """

    DBInstanceAutomatedBackupsArn: Optional[str] = None
    """
    The Amazon Resource Name (ARN) of the replicated automated backups.
    """


class RDSMasterUserSecret(Boto3Model):
    """
    The secret managed by RDS in Amazon Web Services Secrets Manager for the
    master user password.

    For more information, see
    `Password management with Amazon Web Services Secrets Manager <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/rds-secrets-
    manager.html>`_ in the *Amazon RDS User Guide.*
    """

    SecretArn: Optional[str] = None
    """
    The Amazon Resource Name (ARN) of the secret.
    """
    SecretStatus: Optional[str] = None
    """
    The status of the secret.
    """
    KmsKeyId: Optional[str] = None
    """
    The Amazon Web Services KMS key identifier that is used to encrypt the
    secret.
    """


class RDSCertificateDetails(Boto3Model):
    """
    The details of the DB instance's server certificate.
    """

    CAIdentifier: Optional[str] = None
    """
    The CA identifier of the CA certificate used for the DB instance's server
    certificate.
    """
    ValidTill: Optional[datetime] = None
    """
    The expiration date of the DB instance’s server certificate.
    """


class DBInstance(PrimaryBoto3Model):
    """
    Contains the details of an Amazon RDS DB instance.

    This data type is used as a response element in the operations
    ``CreateDBInstance``, ``CreateDBInstanceReadReplica``, ``DeleteDBInstance``,
    ``DescribeDBInstances``, ``ModifyDBInstance``, ``PromoteReadReplica``,
    ``RebootDBInstance``, ``RestoreDBInstanceFromDBSnapshot``,
    ``RestoreDBInstanceFromS3``, ``RestoreDBInstanceToPointInTime``,
    ``StartDBInstance``, and ``StopDBInstance``.
    """

    manager_class: ClassVar[Type[Boto3ModelManager]] = DBInstanceManager

    DBInstanceIdentifier: str
    """
    The user-supplied database identifier.

    This identifier is the unique key that identifies a DB instance.
    """
    DBInstanceClass: str
    """
    The name of the compute and memory capacity class of the DB instance.
    """
    MultiAZ: Optional[bool]
    """
    Indicates whether the DB instance is a Multi-AZ deployment.

    This setting doesn't apply to RDS Custom DB instances.
    """
    Engine: str
    """
    The database engine used for this DB instance.
    """
    EngineVersion: str
    """
    The version of the database engine.
    """
    AutoMinorVersionUpgrade: Optional[bool] = True
    """
    Indicates whether minor version patches are applied automatically.
    """
    PubliclyAccessible: Optional[bool]
    """
    Indicates whether the DB instance is publicly accessible.
    """
    StorageEncrypted: Optional[bool] = True
    """
    Indicates whether the DB instance is encrypted.
    """
    BackupRetentionPeriod: Optional[int] = 1
    """
    The number of days for which automatic DB snapshots are retained.
    """
    DbInstancePort: Optional[int] = None
    """
    The port that the DB instance listens on.

    If the DB instance is part of a DB cluster, this can be a different port
    than the DB cluster port.
    """
    IAMDatabaseAuthenticationEnabled: Optional[bool] = None
    """
    Indicates whether mapping of Amazon Web Services Identity and Access
    Management (IAM) accounts to database accounts is enabled for the DB
    instance.
    """
    EnabledCloudwatchLogsExports: Optional[List[str]] = None
    """
    A list of log types that this DB instance is configured to export to
    CloudWatch Logs.
    """
    TagList: Optional[List[Tag]] = None
    """
    A list of tags.
    """
    CustomerOwnedIpEnabled: Optional[bool] = None
    """
    Indicates whether a customer-owned IP address (CoIP) is enabled for an RDS
    on Outposts DB instance.
    """
    PerformanceInsightsEnabled: Optional[bool] = None
    """
    Indicates whether Performance Insights is enabled for the DB instance.
    """
    DBInstanceStatus: str = Field(default=None, frozen=True)
    """
    The current state of this database.
    """
    AutomaticRestartTime: datetime = Field(default=None, frozen=True)
    """
    The time when a stopped DB instance is restarted automatically.
    """
    MasterUsername: Optional[str] = None
    """
    The master username for the DB instance.
    """
    DBName: Optional[str] = None
    """
    The initial database name that you provided (if required) when you created
    the DB instance.

    This name is returned for the life of your DB instance. For an RDS for
    Oracle CDB instance, the name identifies the PDB rather than the CDB.
    """
    Endpoint: RDSEndpoint = Field(default=None, frozen=True)
    """
    The connection endpoint for the DB instance.
    """
    AllocatedStorage: Optional[int] = None
    """
    The amount of storage in gibibytes (GiB) allocated for the DB instance.
    """
    InstanceCreateTime: datetime = Field(default=None, frozen=True)
    """
    The date and time when the DB instance was created.
    """
    PreferredBackupWindow: Optional[str] = None
    """
    The daily time range during which automated backups are created if
    automated backups are enabled, as determined by the
    ``BackupRetentionPeriod``.
    """
    DBSecurityGroups: Optional[List["DBSecurityGroupMembership"]] = None
    """
    A list of DB security group elements containing ``DBSecurityGroup.Name``
    and ``DBSecurityGroup.Status`` subelements.
    """
    VpcSecurityGroups: List["VpcSecurityGroupMembership"] = Field(
        default=None, frozen=True
    )
    """
    The list of Amazon EC2 VPC security groups that the DB instance belongs to.
    """
    DBParameterGroups: List["DBParameterGroupStatus"] = Field(default=None, frozen=True)
    """
    The list of DB parameter groups applied to this DB instance.
    """
    AvailabilityZone: Optional[str] = None
    """
    The name of the Availability Zone where the DB instance is located.
    """
    DBSubnetGroup: RDSDBSubnetGroup = Field(default=None, frozen=True)
    """
    Information about the subnet group associated with the DB instance,
    including the name, description, and subnets in the subnet group.
    """
    PreferredMaintenanceWindow: Optional[str] = None
    """
    The weekly time range during which system maintenance can occur, in
    Universal Coordinated Time (UTC).
    """
    PendingModifiedValues: RDSPendingModifiedValues = Field(default=None, frozen=True)
    """
    Information about pending changes to the DB instance.

    This information is returned only when there are pending changes. Specific
    changes are identified by subelements.
    """
    LatestRestorableTime: datetime = Field(default=None, frozen=True)
    """
    The latest time to which a database in this DB instance can be restored
    with point-in-time restore.
    """
    ReadReplicaSourceDBInstanceIdentifier: str = Field(default=None, frozen=True)
    """
    The identifier of the source DB instance if this DB instance is a read
    replica.
    """
    ReadReplicaDBInstanceIdentifiers: List[str] = Field(default=None, frozen=True)
    """
    The identifiers of the read replicas associated with this DB instance.
    """
    ReadReplicaDBClusterIdentifiers: List[str] = Field(default=None, frozen=True)
    """
    The identifiers of Aurora DB clusters to which the RDS DB instance is
    replicated as a read replica.

    For example, when you create an Aurora read replica of an RDS for MySQL DB
    instance, the Aurora MySQL DB cluster for the Aurora read replica is shown.
    This output doesn't contain information about cross-Region Aurora read
    replicas.
    """
    ReplicaMode: Optional[Literal["open-read-only", "mounted"]] = None
    """
    The open mode of an Oracle read replica.

    The default is ``open-read-only``. For
    more information, see `Working with Oracle Read Replicas for Amazon
    RDS <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/oracle-read-
    replicas.html>`_ in the *Amazon RDS User Guide*.
    """
    LicenseModel: Optional[str] = None
    """
    The license model information for this DB instance.

    This setting doesn't apply to Amazon Aurora or RDS Custom DB instances.
    """
    Iops: Optional[int] = None
    """
    The Provisioned IOPS (I/O operations per second) value for the DB instance.
    """
    OptionGroupMemberships: List["OptionGroupMembership"] = Field(
        default=None, frozen=True
    )
    """
    The list of option group memberships for this DB instance.
    """
    CharacterSetName: Optional[str] = None
    """
    If present, specifies the name of the character set that this instance is
    associated with.
    """
    NcharCharacterSetName: Optional[str] = None
    """
    The name of the NCHAR character set for the Oracle DB instance.

    This character set specifies the Unicode encoding for data stored in table
    columns of type NCHAR, NCLOB, or NVARCHAR2.
    """
    SecondaryAvailabilityZone: str = Field(default=None, frozen=True)
    """
    If present, specifies the name of the secondary Availability Zone for a DB
    instance with multi-AZ support.
    """
    StatusInfos: List["DBInstanceStatusInfo"] = Field(default=None, frozen=True)
    """
    The status of a read replica.

    If the DB instance isn't a read replica, the value is blank.
    """
    StorageType: Optional[str] = None
    """
    The storage type associated with the DB instance.
    """
    TdeCredentialArn: Optional[str] = None
    """
    The ARN from the key store with which the instance is associated for TDE
    encryption.
    """
    DBClusterIdentifier: Optional[str] = None
    """
    If the DB instance is a member of a DB cluster, indicates the name of the
    DB cluster that the DB instance is a member of.
    """
    KmsKeyId: Optional[str] = None
    """
    If ``StorageEncrypted`` is enabled, the Amazon Web Services KMS key
    identifier for the encrypted DB instance.
    """
    DbiResourceId: str = Field(default=None, frozen=True)
    """
    The Amazon Web Services Region-unique, immutable identifier for the DB
    instance.

    This identifier is found in Amazon Web Services CloudTrail log entries
    whenever the Amazon Web Services KMS key for the DB instance is accessed.
    """
    CACertificateIdentifier: Optional[str] = None
    """
    The identifier of the CA certificate for this DB instance.
    """
    DomainMemberships: List["DomainMembership"] = Field(default=None, frozen=True)
    """
    The Active Directory Domain membership records associated with the DB
    instance.
    """
    CopyTagsToSnapshot: Optional[bool] = None
    """
    Indicates whether tags are copied from the DB instance to snapshots of the
    DB instance.
    """
    MonitoringInterval: Optional[int] = None
    """
    The interval, in seconds, between points when Enhanced Monitoring metrics
    are collected for the DB instance.
    """
    EnhancedMonitoringResourceArn: str = Field(default=None, frozen=True)
    """
    The Amazon Resource Name (ARN) of the Amazon CloudWatch Logs log stream
    that receives the Enhanced Monitoring metrics data for the DB instance.
    """
    MonitoringRoleArn: Optional[str] = None
    """
    The ARN for the IAM role that permits RDS to send Enhanced Monitoring
    metrics to Amazon CloudWatch Logs.
    """
    PromotionTier: Optional[int] = None
    """
    The order of priority in which an Aurora Replica is promoted to the primary
    instance after a failure of the existing primary instance.

    For more
    information, see  `Fault Tolerance for an Aurora DB Cluster <https://docs.aws.a
    mazon.com/AmazonRDS/latest/AuroraUserGuide/Concepts.AuroraHighAvailability.html
    #Aurora.Managing.FaultTolerance>`_ in the *Amazon Aurora User Guide*.
    """
    DBInstanceArn: str = Field(default=None, frozen=True)
    """
    The Amazon Resource Name (ARN) for the DB instance.
    """
    Timezone: Optional[str] = None
    """
    The time zone of the DB instance.

    In most cases, the ``Timezone`` element is
    empty. ``Timezone`` content appears only for RDS for Db2 and RDS for SQL Server
    DB instances that were created with a time zone specified.
    """
    PerformanceInsightsKMSKeyId: Optional[str] = None
    """
    The Amazon Web Services KMS key identifier for encryption of Performance
    Insights data.
    """
    PerformanceInsightsRetentionPeriod: Optional[int] = None
    """
    The number of days to retain Performance Insights data.
    """
    ProcessorFeatures: Optional[List["ProcessorFeature"]] = None
    """
    The number of CPU cores and the number of threads per core for the DB
    instance class of the DB instance.
    """
    DeletionProtection: Optional[bool] = None
    """
    Indicates whether the DB instance has deletion protection enabled.

    The database can't be deleted when deletion protection is enabled. For more
    information, see
    `Deleting a DB Instance <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide
    /USER_DeleteInstance.html>`_.
    """
    AssociatedRoles: List["DBInstanceRole"] = Field(default=None, frozen=True)
    """
    The Amazon Web Services Identity and Access Management (IAM) roles
    associated with the DB instance.
    """
    ListenerEndpoint: RDSEndpoint = Field(default=None, frozen=True)
    """
    The listener connection endpoint for SQL Server Always On.
    """
    MaxAllocatedStorage: Optional[int] = None
    """
    The upper limit in gibibytes (GiB) to which Amazon RDS can automatically
    scale the storage of the DB instance.
    """
    DBInstanceAutomatedBackupsReplications: List[
        "DBInstanceAutomatedBackupsReplication"
    ] = Field(default=None, frozen=True)
    """
    The list of replicated automated backups associated with the DB instance.
    """
    AwsBackupRecoveryPointArn: Optional[str] = None
    """
    The Amazon Resource Name (ARN) of the recovery point in Amazon Web Services
    Backup.
    """
    ActivityStreamStatus: Literal["stopped", "starting", "started", "stopping"] = Field(
        default=None, frozen=True
    )
    """
    The status of the database activity stream.
    """
    ActivityStreamKmsKeyId: str = Field(default=None, frozen=True)
    """
    The Amazon Web Services KMS key identifier used for encrypting messages in
    the database activity stream.

    The Amazon Web Services KMS key identifier is the key ARN, key ID, alias
    ARN, or alias name for the KMS key.
    """
    ActivityStreamKinesisStreamName: str = Field(default=None, frozen=True)
    """
    The name of the Amazon Kinesis data stream used for the database activity
    stream.
    """
    ActivityStreamMode: Literal["sync", "async"] = Field(default=None, frozen=True)
    """
    The mode of the database activity stream.

    Database events such as a change or access generate an activity stream
    event. RDS for Oracle always handles these events asynchronously.
    """
    ActivityStreamEngineNativeAuditFieldsIncluded: bool = Field(
        default=None, frozen=True
    )
    """
    Indicates whether engine-native audit fields are included in the database
    activity stream.
    """
    AutomationMode: Optional[Literal["full", "all-paused"]] = None
    """
The automation mode of the RDS Custom DB instance: ``full`` or ``all paused``.
If ``full``, the DB instance automates monitoring and instance recovery. If
``all paused``, the instance pauses automation for the duration set by
``--resume-full-automation-mode-minutes``.
    """
    ResumeFullAutomationModeTime: datetime = Field(default=None, frozen=True)
    """
    The number of minutes to pause the automation.

    When the time period ends, RDS Custom resumes full automation. The minimum
    value is 60 (default). The maximum value is 1,440.
    """
    CustomIamInstanceProfile: Optional[str] = None
    """
    The instance profile associated with the underlying Amazon EC2 instance of
    an RDS Custom DB instance.

    The instance profile must meet the following
    requirements:
    """
    BackupTarget: Optional[str] = None
    """
The location where automated backups and manual snapshots are stored: Amazon
Web Services Outposts or the Amazon Web Services Region.
    """
    NetworkType: Optional[str] = None
    """
    The network type of the DB instance.
    """
    ActivityStreamPolicyStatus: Literal[
        "locked", "unlocked", "locking-policy", "unlocking-policy"
    ] = Field(default=None, frozen=True)
    """
    The status of the policy state of the activity stream.
    """
    StorageThroughput: Optional[int] = None
    """
    The storage throughput for the DB instance.
    """
    DBSystemId: Optional[str] = None
    """
    The Oracle system ID (Oracle SID) for a container database (CDB).

    The Oracle SID is also the name of the CDB. This setting is only valid for
    RDS Custom DB instances.
    """
    MasterUserSecret: RDSMasterUserSecret = Field(default=None, frozen=True)
    """
    The secret managed by RDS in Amazon Web Services Secrets Manager for the
    master user password.
    """
    CertificateDetails: RDSCertificateDetails = Field(default=None, frozen=True)
    """
    The details of the DB instance's server certificate.
    """
    ReadReplicaSourceDBClusterIdentifier: str = Field(default=None, frozen=True)
    """
    The identifier of the source DB cluster if this DB instance is a read
    replica.
    """
    PercentProgress: str = Field(default=None, frozen=True)
    """
    The progress of the storage optimization operation as a percentage.
    """
    DedicatedLogVolume: Optional[bool] = None
    """
    Indicates whether the DB instance has a dedicated log volume (DLV) enabled.
    """
    IsStorageConfigUpgradeAvailable: bool = Field(default=None, frozen=True)
    """
    Indicates whether an upgrade is recommended for the storage file system
    configuration on the DB instance.

    To migrate to the preferred configuration,
    you can either create a blue/green deployment, or create a read replica from
    the DB instance. For more information, see `Upgrading the storage file system
    for a DB instance <https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_
    PIOPS.StorageTypes.html#USER_PIOPS.UpgradeFileSystem>`_.
    """
    MultiTenant: Optional[bool] = None
    """
    Specifies whether the DB instance is in the multi-tenant configuration
    (TRUE) or the single-tenant configuration (FALSE).
    """
    EngineLifecycleSupport: Optional[str] = None
    """
    The life cycle type for the DB instance.
    """

    @property
    def pk(self) -> Optional[str]:
        """
        Return the primary key of the model.   This is the value of the
        :py:attr:`DBInstanceArn` attribute.

        Returns:
            The primary key of the model instance.
        """
        return self.DBInstanceArn

    @property
    def arn(self) -> Optional[str]:
        """
        Return the ARN of the model.   This is the value of the
        :py:attr:`DBInstanceArn` attribute.

        Returns:
            The ARN of the model instance.
        """
        return self.DBInstanceArn

    @property
    def name(self) -> Optional[str]:
        """
        Return the name of the model.   This is the value of the
        :py:attr:`DBInstanceIdentifier` attribute.

        Returns:
            The name of the model instance.
        """
        return self.DBInstanceIdentifier


# =======================
# Request/Response Models
# =======================


class CreateDBInstanceResult(Boto3Model):
    RDSDBInstance: DBInstance = Field(default=None, serialization_alias="DBInstance")
    """
    Contains the details of an Amazon RDS DB instance.
    """


class CloudwatchLogsExportConfiguration(Boto3Model):
    """
    The log types to be enabled for export to CloudWatch Logs for a specific DB
    instance.

    A change to the ``CloudwatchLogsExportConfiguration`` parameter is always
    applied to the DB instance immediately. Therefore, the ``ApplyImmediately``
    parameter has no effect.

    This setting doesn't apply to RDS Custom DB instances.
    """

    EnableLogTypes: Optional[List[str]] = None
    """
    The list of log types to enable.
    """
    DisableLogTypes: Optional[List[str]] = None
    """
    The list of log types to disable.
    """


class ModifyDBInstanceResult(Boto3Model):
    RDSDBInstance: DBInstance = Field(default=None, serialization_alias="DBInstance")
    """
    Contains the details of an Amazon RDS DB instance.
    """


class DeleteDBInstanceResult(Boto3Model):
    RDSDBInstance: DBInstance = Field(default=None, serialization_alias="DBInstance")
    """
    Contains the details of an Amazon RDS DB instance.
    """


class DBInstanceMessage(Boto3Model):
    """
    Contains the result of a successful invocation of the
    ``DescribeDBInstances`` action.
    """

    Marker: Optional[str] = None
    """
    An optional pagination token provided by a previous request.

    If this parameter
    is specified, the response includes only records beyond the marker, up to the
    value specified by ``MaxRecords`` .
    """
    DBInstances: Optional[List["DBInstance"]] = None
    """
    A list of ``DBInstance`` instances.
    """
