# 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__ = [
    'GetMysqlBackupResult',
    'AwaitableGetMysqlBackupResult',
    'get_mysql_backup',
    'get_mysql_backup_output',
]

@pulumi.output_type
class GetMysqlBackupResult:
    """
    A collection of values returned by getMysqlBackup.
    """
    def __init__(__self__, backup_id=None, backup_size_in_gbs=None, backup_type=None, compartment_id=None, creation_type=None, data_storage_size_in_gb=None, db_system_id=None, db_system_snapshots=None, defined_tags=None, description=None, display_name=None, freeform_tags=None, id=None, lifecycle_details=None, mysql_version=None, retention_in_days=None, shape_name=None, state=None, time_created=None, time_updated=None):
        if backup_id and not isinstance(backup_id, str):
            raise TypeError("Expected argument 'backup_id' to be a str")
        pulumi.set(__self__, "backup_id", backup_id)
        if backup_size_in_gbs and not isinstance(backup_size_in_gbs, int):
            raise TypeError("Expected argument 'backup_size_in_gbs' to be a int")
        pulumi.set(__self__, "backup_size_in_gbs", backup_size_in_gbs)
        if backup_type and not isinstance(backup_type, str):
            raise TypeError("Expected argument 'backup_type' to be a str")
        pulumi.set(__self__, "backup_type", backup_type)
        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 creation_type and not isinstance(creation_type, str):
            raise TypeError("Expected argument 'creation_type' to be a str")
        pulumi.set(__self__, "creation_type", creation_type)
        if data_storage_size_in_gb and not isinstance(data_storage_size_in_gb, int):
            raise TypeError("Expected argument 'data_storage_size_in_gb' to be a int")
        pulumi.set(__self__, "data_storage_size_in_gb", data_storage_size_in_gb)
        if db_system_id and not isinstance(db_system_id, str):
            raise TypeError("Expected argument 'db_system_id' to be a str")
        pulumi.set(__self__, "db_system_id", db_system_id)
        if db_system_snapshots and not isinstance(db_system_snapshots, list):
            raise TypeError("Expected argument 'db_system_snapshots' to be a list")
        pulumi.set(__self__, "db_system_snapshots", db_system_snapshots)
        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 description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if display_name and not isinstance(display_name, str):
            raise TypeError("Expected argument 'display_name' to be a str")
        pulumi.set(__self__, "display_name", display_name)
        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 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 mysql_version and not isinstance(mysql_version, str):
            raise TypeError("Expected argument 'mysql_version' to be a str")
        pulumi.set(__self__, "mysql_version", mysql_version)
        if retention_in_days and not isinstance(retention_in_days, int):
            raise TypeError("Expected argument 'retention_in_days' to be a int")
        pulumi.set(__self__, "retention_in_days", retention_in_days)
        if shape_name and not isinstance(shape_name, str):
            raise TypeError("Expected argument 'shape_name' to be a str")
        pulumi.set(__self__, "shape_name", shape_name)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        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)
        if time_updated and not isinstance(time_updated, str):
            raise TypeError("Expected argument 'time_updated' to be a str")
        pulumi.set(__self__, "time_updated", time_updated)

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

    @property
    @pulumi.getter(name="backupSizeInGbs")
    def backup_size_in_gbs(self) -> int:
        """
        The size of the backup in base-2 (IEC) gibibytes. (GiB).
        """
        return pulumi.get(self, "backup_size_in_gbs")

    @property
    @pulumi.getter(name="backupType")
    def backup_type(self) -> str:
        """
        The type of backup.
        """
        return pulumi.get(self, "backup_type")

    @property
    @pulumi.getter(name="compartmentId")
    def compartment_id(self) -> str:
        """
        The OCID of the compartment the DB System belongs in.
        """
        return pulumi.get(self, "compartment_id")

    @property
    @pulumi.getter(name="creationType")
    def creation_type(self) -> str:
        """
        Indicates how the backup was created: manually, automatic, or by an Operator.
        """
        return pulumi.get(self, "creation_type")

    @property
    @pulumi.getter(name="dataStorageSizeInGb")
    def data_storage_size_in_gb(self) -> int:
        """
        Initial size of the data volume in GiBs that will be created and attached.
        """
        return pulumi.get(self, "data_storage_size_in_gb")

    @property
    @pulumi.getter(name="dbSystemId")
    def db_system_id(self) -> str:
        """
        The OCID of the DB System the backup is associated with.
        """
        return pulumi.get(self, "db_system_id")

    @property
    @pulumi.getter(name="dbSystemSnapshots")
    def db_system_snapshots(self) -> Sequence['outputs.GetMysqlBackupDbSystemSnapshotResult']:
        """
        Snapshot of the DbSystem details at the time of the backup
        """
        return pulumi.get(self, "db_system_snapshots")

    @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. Example: `{"foo-namespace.bar-key": "value"}`
        """
        return pulumi.get(self, "defined_tags")

    @property
    @pulumi.getter
    def description(self) -> str:
        """
        A user-supplied description for the backup.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter(name="displayName")
    def display_name(self) -> str:
        """
        A user-supplied display name for the backup.
        """
        return pulumi.get(self, "display_name")

    @property
    @pulumi.getter(name="freeformTags")
    def freeform_tags(self) -> Mapping[str, Any]:
        """
        Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. Example: `{"bar-key": "value"}`
        """
        return pulumi.get(self, "freeform_tags")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        OCID of the backup itself
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="lifecycleDetails")
    def lifecycle_details(self) -> str:
        """
        Additional information about the current lifecycleState.
        """
        return pulumi.get(self, "lifecycle_details")

    @property
    @pulumi.getter(name="mysqlVersion")
    def mysql_version(self) -> str:
        """
        The MySQL server version of the DB System used for backup.
        """
        return pulumi.get(self, "mysql_version")

    @property
    @pulumi.getter(name="retentionInDays")
    def retention_in_days(self) -> int:
        """
        Number of days to retain this backup.
        """
        return pulumi.get(self, "retention_in_days")

    @property
    @pulumi.getter(name="shapeName")
    def shape_name(self) -> str:
        """
        The shape of the DB System instance used for backup.
        """
        return pulumi.get(self, "shape_name")

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

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

    @property
    @pulumi.getter(name="timeUpdated")
    def time_updated(self) -> str:
        """
        The time at which the backup was updated.
        """
        return pulumi.get(self, "time_updated")


class AwaitableGetMysqlBackupResult(GetMysqlBackupResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetMysqlBackupResult(
            backup_id=self.backup_id,
            backup_size_in_gbs=self.backup_size_in_gbs,
            backup_type=self.backup_type,
            compartment_id=self.compartment_id,
            creation_type=self.creation_type,
            data_storage_size_in_gb=self.data_storage_size_in_gb,
            db_system_id=self.db_system_id,
            db_system_snapshots=self.db_system_snapshots,
            defined_tags=self.defined_tags,
            description=self.description,
            display_name=self.display_name,
            freeform_tags=self.freeform_tags,
            id=self.id,
            lifecycle_details=self.lifecycle_details,
            mysql_version=self.mysql_version,
            retention_in_days=self.retention_in_days,
            shape_name=self.shape_name,
            state=self.state,
            time_created=self.time_created,
            time_updated=self.time_updated)


def get_mysql_backup(backup_id: Optional[str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetMysqlBackupResult:
    """
    This data source provides details about a specific Mysql Backup resource in Oracle Cloud Infrastructure MySQL Database service.

    Get information about the specified Backup

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_mysql_backup = oci.Mysql.get_mysql_backup(backup_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str backup_id: The OCID of the Backup
    """
    __args__ = dict()
    __args__['backupId'] = backup_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('oci:Mysql/getMysqlBackup:getMysqlBackup', __args__, opts=opts, typ=GetMysqlBackupResult).value

    return AwaitableGetMysqlBackupResult(
        backup_id=__ret__.backup_id,
        backup_size_in_gbs=__ret__.backup_size_in_gbs,
        backup_type=__ret__.backup_type,
        compartment_id=__ret__.compartment_id,
        creation_type=__ret__.creation_type,
        data_storage_size_in_gb=__ret__.data_storage_size_in_gb,
        db_system_id=__ret__.db_system_id,
        db_system_snapshots=__ret__.db_system_snapshots,
        defined_tags=__ret__.defined_tags,
        description=__ret__.description,
        display_name=__ret__.display_name,
        freeform_tags=__ret__.freeform_tags,
        id=__ret__.id,
        lifecycle_details=__ret__.lifecycle_details,
        mysql_version=__ret__.mysql_version,
        retention_in_days=__ret__.retention_in_days,
        shape_name=__ret__.shape_name,
        state=__ret__.state,
        time_created=__ret__.time_created,
        time_updated=__ret__.time_updated)


@_utilities.lift_output_func(get_mysql_backup)
def get_mysql_backup_output(backup_id: Optional[pulumi.Input[str]] = None,
                            opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetMysqlBackupResult]:
    """
    This data source provides details about a specific Mysql Backup resource in Oracle Cloud Infrastructure MySQL Database service.

    Get information about the specified Backup

    ## Example Usage

    ```python
    import pulumi
    import pulumi_oci as oci

    test_mysql_backup = oci.Mysql.get_mysql_backup(backup_id=%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
    ```


    :param str backup_id: The OCID of the Backup
    """
    ...
