# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
if sys.version_info >= (3, 11):
    from typing import NotRequired, TypedDict, TypeAlias
else:
    from typing_extensions import NotRequired, TypedDict, TypeAlias
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = [
    'GetPostgresEndpointResult',
    'AwaitableGetPostgresEndpointResult',
    'get_postgres_endpoint',
    'get_postgres_endpoint_output',
]

@pulumi.output_type
class GetPostgresEndpointResult:
    """
    A collection of values returned by getPostgresEndpoint.
    """
    def __init__(__self__, create_time=None, id=None, name=None, parent=None, provider_config=None, spec=None, status=None, uid=None, update_time=None):
        if create_time and not isinstance(create_time, str):
            raise TypeError("Expected argument 'create_time' to be a str")
        pulumi.set(__self__, "create_time", create_time)
        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 parent and not isinstance(parent, str):
            raise TypeError("Expected argument 'parent' to be a str")
        pulumi.set(__self__, "parent", parent)
        if provider_config and not isinstance(provider_config, dict):
            raise TypeError("Expected argument 'provider_config' to be a dict")
        pulumi.set(__self__, "provider_config", provider_config)
        if spec and not isinstance(spec, dict):
            raise TypeError("Expected argument 'spec' to be a dict")
        pulumi.set(__self__, "spec", spec)
        if status and not isinstance(status, dict):
            raise TypeError("Expected argument 'status' to be a dict")
        pulumi.set(__self__, "status", status)
        if uid and not isinstance(uid, str):
            raise TypeError("Expected argument 'uid' to be a str")
        pulumi.set(__self__, "uid", uid)
        if update_time and not isinstance(update_time, str):
            raise TypeError("Expected argument 'update_time' to be a str")
        pulumi.set(__self__, "update_time", update_time)

    @_builtins.property
    @pulumi.getter(name="createTime")
    def create_time(self) -> _builtins.str:
        """
        (string) - A timestamp indicating when the compute endpoint was created
        """
        return pulumi.get(self, "create_time")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        """
        (string) - Output only. The full resource path of the endpoint.
        Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter
    def parent(self) -> _builtins.str:
        """
        (string) - The branch containing this endpoint (API resource hierarchy).
        Format: projects/{project_id}/branches/{branch_id}
        """
        return pulumi.get(self, "parent")

    @_builtins.property
    @pulumi.getter(name="providerConfig")
    def provider_config(self) -> Optional['outputs.GetPostgresEndpointProviderConfigResult']:
        return pulumi.get(self, "provider_config")

    @_builtins.property
    @pulumi.getter
    def spec(self) -> 'outputs.GetPostgresEndpointSpecResult':
        """
        (EndpointSpec) - The spec contains the compute endpoint configuration, including autoscaling limits, suspend timeout, and disabled state
        """
        return pulumi.get(self, "spec")

    @_builtins.property
    @pulumi.getter
    def status(self) -> 'outputs.GetPostgresEndpointStatusResult':
        """
        (EndpointStatus) - Current operational status of the compute endpoint
        """
        return pulumi.get(self, "status")

    @_builtins.property
    @pulumi.getter
    def uid(self) -> _builtins.str:
        """
        (string) - System-generated unique ID for the endpoint
        """
        return pulumi.get(self, "uid")

    @_builtins.property
    @pulumi.getter(name="updateTime")
    def update_time(self) -> _builtins.str:
        """
        (string) - A timestamp indicating when the compute endpoint was last updated
        """
        return pulumi.get(self, "update_time")


class AwaitableGetPostgresEndpointResult(GetPostgresEndpointResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPostgresEndpointResult(
            create_time=self.create_time,
            id=self.id,
            name=self.name,
            parent=self.parent,
            provider_config=self.provider_config,
            spec=self.spec,
            status=self.status,
            uid=self.uid,
            update_time=self.update_time)


def get_postgres_endpoint(name: Optional[_builtins.str] = None,
                          provider_config: Optional[Union['GetPostgresEndpointProviderConfigArgs', 'GetPostgresEndpointProviderConfigArgsDict']] = None,
                          opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPostgresEndpointResult:
    """
    [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source retrieves a single Postgres endpoint.

    ## Example Usage

    ### Retrieve Endpoint by Name

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_postgres_endpoint(name="projects/my-project/branches/dev-branch/endpoints/primary")
    pulumi.export("endpointType", this.status.endpoint_type)
    ```


    :param _builtins.str name: Output only. The full resource path of the endpoint.
           Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
    :param Union['GetPostgresEndpointProviderConfigArgs', 'GetPostgresEndpointProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getPostgresEndpoint:getPostgresEndpoint', __args__, opts=opts, typ=GetPostgresEndpointResult).value

    return AwaitableGetPostgresEndpointResult(
        create_time=pulumi.get(__ret__, 'create_time'),
        id=pulumi.get(__ret__, 'id'),
        name=pulumi.get(__ret__, 'name'),
        parent=pulumi.get(__ret__, 'parent'),
        provider_config=pulumi.get(__ret__, 'provider_config'),
        spec=pulumi.get(__ret__, 'spec'),
        status=pulumi.get(__ret__, 'status'),
        uid=pulumi.get(__ret__, 'uid'),
        update_time=pulumi.get(__ret__, 'update_time'))
def get_postgres_endpoint_output(name: Optional[pulumi.Input[_builtins.str]] = None,
                                 provider_config: Optional[pulumi.Input[Optional[Union['GetPostgresEndpointProviderConfigArgs', 'GetPostgresEndpointProviderConfigArgsDict']]]] = None,
                                 opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPostgresEndpointResult]:
    """
    [![Public Beta](https://img.shields.io/badge/Release_Stage-Public_Beta-orange)](https://docs.databricks.com/aws/en/release-notes/release-types)

    This data source retrieves a single Postgres endpoint.

    ## Example Usage

    ### Retrieve Endpoint by Name

    ```python
    import pulumi
    import pulumi_databricks as databricks

    this = databricks.get_postgres_endpoint(name="projects/my-project/branches/dev-branch/endpoints/primary")
    pulumi.export("endpointType", this.status.endpoint_type)
    ```


    :param _builtins.str name: Output only. The full resource path of the endpoint.
           Format: projects/{project_id}/branches/{branch_id}/endpoints/{endpoint_id}
    :param Union['GetPostgresEndpointProviderConfigArgs', 'GetPostgresEndpointProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getPostgresEndpoint:getPostgresEndpoint', __args__, opts=opts, typ=GetPostgresEndpointResult)
    return __ret__.apply(lambda __response__: GetPostgresEndpointResult(
        create_time=pulumi.get(__response__, 'create_time'),
        id=pulumi.get(__response__, 'id'),
        name=pulumi.get(__response__, 'name'),
        parent=pulumi.get(__response__, 'parent'),
        provider_config=pulumi.get(__response__, 'provider_config'),
        spec=pulumi.get(__response__, 'spec'),
        status=pulumi.get(__response__, 'status'),
        uid=pulumi.get(__response__, 'uid'),
        update_time=pulumi.get(__response__, 'update_time')))
