# 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 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

__all__ = [
    'GetPeeringsResult',
    'AwaitableGetPeeringsResult',
    'get_peerings',
    'get_peerings_output',
]

@pulumi.output_type
class GetPeeringsResult:
    """
    A collection of values returned by getPeerings.
    """
    def __init__(__self__, id=None, partition=None, peers=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if partition and not isinstance(partition, str):
            raise TypeError("Expected argument 'partition' to be a str")
        pulumi.set(__self__, "partition", partition)
        if peers and not isinstance(peers, list):
            raise TypeError("Expected argument 'peers' to be a list")
        pulumi.set(__self__, "peers", peers)

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

    @property
    @pulumi.getter
    def partition(self) -> Optional[str]:
        return pulumi.get(self, "partition")

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


class AwaitableGetPeeringsResult(GetPeeringsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPeeringsResult(
            id=self.id,
            partition=self.partition,
            peers=self.peers)


def get_peerings(partition: Optional[str] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetPeeringsResult:
    """
    ## Example Usage

    ```python
    import pulumi
    import pulumi_consul as consul

    peers = consul.get_peerings()
    ```
    """
    __args__ = dict()
    __args__['partition'] = partition
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('consul:index/getPeerings:getPeerings', __args__, opts=opts, typ=GetPeeringsResult).value

    return AwaitableGetPeeringsResult(
        id=pulumi.get(__ret__, 'id'),
        partition=pulumi.get(__ret__, 'partition'),
        peers=pulumi.get(__ret__, 'peers'))
def get_peerings_output(partition: Optional[pulumi.Input[Optional[str]]] = None,
                        opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPeeringsResult]:
    """
    ## Example Usage

    ```python
    import pulumi
    import pulumi_consul as consul

    peers = consul.get_peerings()
    ```
    """
    __args__ = dict()
    __args__['partition'] = partition
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('consul:index/getPeerings:getPeerings', __args__, opts=opts, typ=GetPeeringsResult)
    return __ret__.apply(lambda __response__: GetPeeringsResult(
        id=pulumi.get(__response__, 'id'),
        partition=pulumi.get(__response__, 'partition'),
        peers=pulumi.get(__response__, 'peers')))
