# 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__ = [
    'GetPostgresEndpointsResult',
    'AwaitableGetPostgresEndpointsResult',
    'get_postgres_endpoints',
    'get_postgres_endpoints_output',
]

@pulumi.output_type
class GetPostgresEndpointsResult:
    """
    A collection of values returned by getPostgresEndpoints.
    """
    def __init__(__self__, endpoints=None, id=None, page_size=None, parent=None, provider_config=None):
        if endpoints and not isinstance(endpoints, list):
            raise TypeError("Expected argument 'endpoints' to be a list")
        pulumi.set(__self__, "endpoints", endpoints)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if page_size and not isinstance(page_size, int):
            raise TypeError("Expected argument 'page_size' to be a int")
        pulumi.set(__self__, "page_size", page_size)
        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)

    @_builtins.property
    @pulumi.getter
    def endpoints(self) -> Sequence['outputs.GetPostgresEndpointsEndpointResult']:
        return pulumi.get(self, "endpoints")

    @_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(name="pageSize")
    def page_size(self) -> Optional[_builtins.int]:
        return pulumi.get(self, "page_size")

    @_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.GetPostgresEndpointsProviderConfigResult']:
        return pulumi.get(self, "provider_config")


class AwaitableGetPostgresEndpointsResult(GetPostgresEndpointsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPostgresEndpointsResult(
            endpoints=self.endpoints,
            id=self.id,
            page_size=self.page_size,
            parent=self.parent,
            provider_config=self.provider_config)


def get_postgres_endpoints(page_size: Optional[_builtins.int] = None,
                           parent: Optional[_builtins.str] = None,
                           provider_config: Optional[Union['GetPostgresEndpointsProviderConfigArgs', 'GetPostgresEndpointsProviderConfigArgsDict']] = None,
                           opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPostgresEndpointsResult:
    """
    [![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 lists all Postgres endpoints in a branch.

    ## Example Usage

    ### List All Endpoints in a Branch

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_postgres_endpoints(parent="projects/my-project/branches/dev-branch")
    pulumi.export("endpointNames", [endpoint.name for endpoint in all.endpoints])
    pulumi.export("endpointTypes", [endpoint.status.endpoint_type for endpoint in all.endpoints])
    ```


    :param _builtins.int page_size: Upper bound for items returned. Cannot be negative
    :param _builtins.str parent: The Branch that owns this collection of endpoints.
           Format: projects/{project_id}/branches/{branch_id}
    :param Union['GetPostgresEndpointsProviderConfigArgs', 'GetPostgresEndpointsProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['pageSize'] = page_size
    __args__['parent'] = parent
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('databricks:index/getPostgresEndpoints:getPostgresEndpoints', __args__, opts=opts, typ=GetPostgresEndpointsResult).value

    return AwaitableGetPostgresEndpointsResult(
        endpoints=pulumi.get(__ret__, 'endpoints'),
        id=pulumi.get(__ret__, 'id'),
        page_size=pulumi.get(__ret__, 'page_size'),
        parent=pulumi.get(__ret__, 'parent'),
        provider_config=pulumi.get(__ret__, 'provider_config'))
def get_postgres_endpoints_output(page_size: Optional[pulumi.Input[Optional[_builtins.int]]] = None,
                                  parent: Optional[pulumi.Input[_builtins.str]] = None,
                                  provider_config: Optional[pulumi.Input[Optional[Union['GetPostgresEndpointsProviderConfigArgs', 'GetPostgresEndpointsProviderConfigArgsDict']]]] = None,
                                  opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPostgresEndpointsResult]:
    """
    [![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 lists all Postgres endpoints in a branch.

    ## Example Usage

    ### List All Endpoints in a Branch

    ```python
    import pulumi
    import pulumi_databricks as databricks

    all = databricks.get_postgres_endpoints(parent="projects/my-project/branches/dev-branch")
    pulumi.export("endpointNames", [endpoint.name for endpoint in all.endpoints])
    pulumi.export("endpointTypes", [endpoint.status.endpoint_type for endpoint in all.endpoints])
    ```


    :param _builtins.int page_size: Upper bound for items returned. Cannot be negative
    :param _builtins.str parent: The Branch that owns this collection of endpoints.
           Format: projects/{project_id}/branches/{branch_id}
    :param Union['GetPostgresEndpointsProviderConfigArgs', 'GetPostgresEndpointsProviderConfigArgsDict'] provider_config: Configure the provider for management through account provider.
    """
    __args__ = dict()
    __args__['pageSize'] = page_size
    __args__['parent'] = parent
    __args__['providerConfig'] = provider_config
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('databricks:index/getPostgresEndpoints:getPostgresEndpoints', __args__, opts=opts, typ=GetPostgresEndpointsResult)
    return __ret__.apply(lambda __response__: GetPostgresEndpointsResult(
        endpoints=pulumi.get(__response__, 'endpoints'),
        id=pulumi.get(__response__, 'id'),
        page_size=pulumi.get(__response__, 'page_size'),
        parent=pulumi.get(__response__, 'parent'),
        provider_config=pulumi.get(__response__, 'provider_config')))
