# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

__all__ = [
    'GetPluggableDatabaseResult',
    'AwaitableGetPluggableDatabaseResult',
    'get_pluggable_database',
    'get_pluggable_database_output',
]

@pulumi.output_type
class GetPluggableDatabaseResult:
    """
    A collection of values returned by getPluggableDatabase.
    """
    def __init__(__self__, compartment_id=None, connection_strings=None, container_database_id=None, defined_tags=None, freeform_tags=None, id=None, is_restricted=None, lifecycle_details=None, open_mode=None, pdb_admin_password=None, pdb_name=None, pluggable_database_id=None, pluggable_database_management_configs=None, should_pdb_admin_account_be_locked=None, state=None, tde_wallet_password=None, time_created=None):
        if compartment_id and not isinstance(compartment_id, str):
            raise TypeError("Expected argument 'compartment_id' to be a str")
        pulumi.set(__self__, "compartment_id", compartment_id)
        if connection_strings and not isinstance(connection_strings, list):
            raise TypeError("Expected argument 'connection_strings' to be a list")
        pulumi.set(__self__, "connection_strings", connection_strings)
        if container_database_id and not isinstance(container_database_id, str):
            raise TypeError("Expected argument 'container_database_id' to be a str")
        pulumi.set(__self__, "container_database_id", container_database_id)
        if defined_tags and not isinstance(defined_tags, dict):
            raise TypeError("Expected argument 'defined_tags' to be a dict")
        pulumi.set(__self__, "defined_tags", defined_tags)
        if freeform_tags and not isinstance(freeform_tags, dict):
            raise TypeError("Expected argument 'freeform_tags' to be a dict")
        pulumi.set(__self__, "freeform_tags", freeform_tags)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_restricted and not isinstance(is_restricted, bool):
            raise TypeError("Expected argument 'is_restricted' to be a bool")
        pulumi.set(__self__, "is_restricted", is_restricted)
        if lifecycle_details and not isinstance(lifecycle_details, str):
            raise TypeError("Expected argument 'lifecycle_details' to be a str")
        pulumi.set(__self__, "lifecycle_details", lifecycle_details)
        if open_mode and not isinstance(open_mode, str):
            raise TypeError("Expected argument 'open_mode' to be a str")
        pulumi.set(__self__, "open_mode", open_mode)
        if pdb_admin_password and not isinstance(pdb_admin_password, str):
            raise TypeError("Expected argument 'pdb_admin_password' to be a str")
        pulumi.set(__self__, "pdb_admin_password", pdb_admin_password)
        if pdb_name and not isinstance(pdb_name, str):
            raise TypeError("Expected argument 'pdb_name' to be a str")
        pulumi.set(__self__, "pdb_name", pdb_name)
        if pluggable_database_id and not isinstance(pluggable_database_id, str):
            raise TypeError("Expected argument 'pluggable_database_id' to be a str")
        pulumi.set(__self__, "pluggable_database_id", pluggable_database_id)
        if pluggable_database_management_configs and not isinstance(pluggable_database_management_configs, list):
            raise TypeError("Expected argument 'pluggable_database_management_configs' to be a list")
        pulumi.set(__self__, "pluggable_database_management_configs", pluggable_database_management_configs)
        if should_pdb_admin_account_be_locked and not isinstance(should_pdb_admin_account_be_locked, bool):
            raise TypeError("Expected argument 'should_pdb_admin_account_be_locked' to be a bool")
        pulumi.set(__self__, "should_pdb_admin_account_be_locked", should_pdb_admin_account_be_locked)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        if tde_wallet_password and not isinstance(tde_wallet_password, str):
            raise TypeError("Expected argument 'tde_wallet_password' to be a str")
        pulumi.set(__self__, "tde_wallet_password", tde_wallet_password)
        if time_created and not isinstance(time_created, str):
            raise TypeError("Expected argument 'time_created' to be a str")
        pulumi.set(__self__, "time_created", time_created)

    @property
    @pulumi.getter(name="compartmentId")
    def compartment_id(self) -> str:
        """
        The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the compartment.
        """
        return pulumi.get(self, "compartment_id")

    @property
    @pulumi.getter(name="connectionStrings")
    def connection_strings(self) -> Sequence['outputs.GetPluggableDatabaseConnectionStringResult']:
        """
        Connection strings to connect to an Oracle Pluggable Database.
        """
        return pulumi.get(self, "connection_strings")

    @property
    @pulumi.getter(name="containerDatabaseId")
    def container_database_id(self) -> str:
        """
        The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the CDB.
        """
        return pulumi.get(self, "container_database_id")

    @property
    @pulumi.getter(name="definedTags")
    def defined_tags(self) -> Mapping[str, Any]:
        """
        Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).
        """
        return pulumi.get(self, "defined_tags")

    @property
    @pulumi.getter(name="freeformTags")
    def freeform_tags(self) -> Mapping[str, Any]:
        """
        Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see [Resource Tags](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/resourcetags.htm).  Example: `{"Department": "Finance"}`
        """
        return pulumi.get(self, "freeform_tags")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm) of the pluggable database.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="isRestricted")
    def is_restricted(self) -> bool:
        """
        The restricted mode of the pluggable database. If a pluggable database is opened in restricted mode, the user needs both create a session and have restricted session privileges to connect to it.
        """
        return pulumi.get(self, "is_restricted")

    @property
    @pulumi.getter(name="lifecycleDetails")
    def lifecycle_details(self) -> str:
        """
        Detailed message for the lifecycle state.
        """
        return pulumi.get(self, "lifecycle_details")

    @property
    @pulumi.getter(name="openMode")
    def open_mode(self) -> str:
        """
        The mode that pluggable database is in. Open mode can only be changed to READ_ONLY or MIGRATE directly from the backend (within the Oracle Database software).
        """
        return pulumi.get(self, "open_mode")

    @property
    @pulumi.getter(name="pdbAdminPassword")
    def pdb_admin_password(self) -> str:
        return pulumi.get(self, "pdb_admin_password")

    @property
    @pulumi.getter(name="pdbName")
    def pdb_name(self) -> str:
        """
        The name for the pluggable database (PDB). The name is unique in the context of a [container database](https://docs.cloud.oracle.com/iaas/api/#/en/database/latest/Database/). The name must begin with an alphabetic character and can contain a maximum of thirty alphanumeric characters. Special characters are not permitted. The pluggable database name should not be same as the container database name.
        """
        return pulumi.get(self, "pdb_name")

    @property
    @pulumi.getter(name="pluggableDatabaseId")
    def pluggable_database_id(self) -> str:
        return pulumi.get(self, "pluggable_database_id")

    @property
    @pulumi.getter(name="pluggableDatabaseManagementConfigs")
    def pluggable_database_management_configs(self) -> Sequence['outputs.GetPluggableDatabasePluggableDatabaseManagementConfigResult']:
        """
        The configuration of the Pluggable Database Management service.
        """
        return pulumi.get(self, "pluggable_database_management_configs")

    @property
    @pulumi.getter(name="shouldPdbAdminAccountBeLocked")
    def should_pdb_admin_account_be_locked(self) -> bool:
        return pulumi.get(self, "should_pdb_admin_account_be_locked")

    @property
    @pulumi.getter
    def state(self) -> str:
        """
        The current state of the pluggable database.
        """
        return pulumi.get(self, "state")

    @property
    @pulumi.getter(name="tdeWalletPassword")
    def tde_wallet_password(self) -> str:
        return pulumi.get(self, "tde_wallet_password")

    @property
    @pulumi.getter(name="timeCreated")
    def time_created(self) -> str:
        """
        The date and time the pluggable database was created.
        """
        return pulumi.get(self, "time_created")


class AwaitableGetPluggableDatabaseResult(GetPluggableDatabaseResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPluggableDatabaseResult(
            compartment_id=self.compartment_id,
            connection_strings=self.connection_strings,
            container_database_id=self.container_database_id,
            defined_tags=self.defined_tags,
            freeform_tags=self.freeform_tags,
            id=self.id,
            is_restricted=self.is_restricted,
            lifecycle_details=self.lifecycle_details,
            open_mode=self.open_mode,
            pdb_admin_password=self.pdb_admin_password,
            pdb_name=self.pdb_name,
            pluggable_database_id=self.pluggable_database_id,
            pluggable_database_management_configs=self.pluggable_database_management_configs,
            should_pdb_admin_account_be_locked=self.should_pdb_admin_account_be_locked,
            state=self.state,
            tde_wallet_password=self.tde_wallet_password,
            time_created=self.time_created)


def get_pluggable_database(pluggable_database_id: Optional[str] = None,
                           opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPluggableDatabaseResult:
    """
    This data source provides details about a specific Pluggable Database resource in Oracle Cloud Infrastructure Database service.

    Gets information about the specified pluggable database.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_pluggable_database = oci.Database.get_pluggable_database(pluggable_database_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str pluggable_database_id: The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
    """
    __args__ = dict()
    __args__['pluggableDatabaseId'] = pluggable_database_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:Database/getPluggableDatabase:getPluggableDatabase', __args__, opts=opts, typ=GetPluggableDatabaseResult).value

    return AwaitableGetPluggableDatabaseResult(
        compartment_id=__ret__.compartment_id,
        connection_strings=__ret__.connection_strings,
        container_database_id=__ret__.container_database_id,
        defined_tags=__ret__.defined_tags,
        freeform_tags=__ret__.freeform_tags,
        id=__ret__.id,
        is_restricted=__ret__.is_restricted,
        lifecycle_details=__ret__.lifecycle_details,
        open_mode=__ret__.open_mode,
        pdb_admin_password=__ret__.pdb_admin_password,
        pdb_name=__ret__.pdb_name,
        pluggable_database_id=__ret__.pluggable_database_id,
        pluggable_database_management_configs=__ret__.pluggable_database_management_configs,
        should_pdb_admin_account_be_locked=__ret__.should_pdb_admin_account_be_locked,
        state=__ret__.state,
        tde_wallet_password=__ret__.tde_wallet_password,
        time_created=__ret__.time_created)


@_utilities.lift_output_func(get_pluggable_database)
def get_pluggable_database_output(pluggable_database_id: Optional[pulumi.Input[str]] = None,
                                  opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetPluggableDatabaseResult]:
    """
    This data source provides details about a specific Pluggable Database resource in Oracle Cloud Infrastructure Database service.

    Gets information about the specified pluggable database.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_pluggable_database = oci.Database.get_pluggable_database(pluggable_database_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str pluggable_database_id: The database [OCID](https://docs.cloud.oracle.com/iaas/Content/General/Concepts/identifiers.htm).
    """
    ...
