# 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
from ._inputs import *

__all__ = [
    'GetDatabaseURIResult',
    'AwaitableGetDatabaseURIResult',
    'get_database_uri',
    'get_database_uri_output',
]

@pulumi.output_type
class GetDatabaseURIResult:
    """
    A collection of values returned by getDatabaseURI.
    """
    def __init__(__self__, id=None, name=None, timeouts=None, type=None, uri=None, zone=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if timeouts and not isinstance(timeouts, dict):
            raise TypeError("Expected argument 'timeouts' to be a dict")
        pulumi.set(__self__, "timeouts", timeouts)
        if type and not isinstance(type, str):
            raise TypeError("Expected argument 'type' to be a str")
        pulumi.set(__self__, "type", type)
        if uri and not isinstance(uri, str):
            raise TypeError("Expected argument 'uri' to be a str")
        pulumi.set(__self__, "uri", uri)
        if zone and not isinstance(zone, str):
            raise TypeError("Expected argument 'zone' to be a str")
        pulumi.set(__self__, "zone", zone)

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The ID of this resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        The database name to match.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def timeouts(self) -> Optional['outputs.GetDatabaseURITimeoutsResult']:
        return pulumi.get(self, "timeouts")

    @property
    @pulumi.getter
    def type(self) -> str:
        """
        The type of the database service (`kafka`, `mysql`, `opensearch`, `pg`, `redis`).
        """
        return pulumi.get(self, "type")

    @property
    @pulumi.getter
    def uri(self) -> str:
        """
        The database service connection URI.
        """
        return pulumi.get(self, "uri")

    @property
    @pulumi.getter
    def zone(self) -> str:
        """
        The Exoscale Zone name.
        """
        return pulumi.get(self, "zone")


class AwaitableGetDatabaseURIResult(GetDatabaseURIResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetDatabaseURIResult(
            id=self.id,
            name=self.name,
            timeouts=self.timeouts,
            type=self.type,
            uri=self.uri,
            zone=self.zone)


def get_database_uri(name: Optional[str] = None,
                     timeouts: Optional[pulumi.InputType['GetDatabaseURITimeoutsArgs']] = None,
                     type: Optional[str] = None,
                     zone: Optional[str] = None,
                     opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetDatabaseURIResult:
    """
    Use this data source to access information about an existing resource.

    :param str name: The database name to match.
    :param str type: The type of the database service (`kafka`, `mysql`, `opensearch`, `pg`, `redis`).
    :param str zone: The Exoscale Zone name.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['timeouts'] = timeouts
    __args__['type'] = type
    __args__['zone'] = zone
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('exoscale:index/getDatabaseURI:getDatabaseURI', __args__, opts=opts, typ=GetDatabaseURIResult).value

    return AwaitableGetDatabaseURIResult(
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        timeouts=pulumi.get(__ret__, 'timeouts'),
        type=pulumi.get(__ret__, 'type'),
        uri=pulumi.get(__ret__, 'uri'),
        zone=pulumi.get(__ret__, 'zone'))


@_utilities.lift_output_func(get_database_uri)
def get_database_uri_output(name: Optional[pulumi.Input[str]] = None,
                            timeouts: Optional[pulumi.Input[Optional[pulumi.InputType['GetDatabaseURITimeoutsArgs']]]] = None,
                            type: Optional[pulumi.Input[str]] = None,
                            zone: Optional[pulumi.Input[str]] = None,
                            opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetDatabaseURIResult]:
    """
    Use this data source to access information about an existing resource.

    :param str name: The database name to match.
    :param str type: The type of the database service (`kafka`, `mysql`, `opensearch`, `pg`, `redis`).
    :param str zone: The Exoscale Zone name.
    """
    ...
