# 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

__all__ = [
    'GetPeeringResult',
    'AwaitableGetPeeringResult',
    'get_peering',
    'get_peering_output',
]

@pulumi.output_type
class GetPeeringResult:
    """
    A collection of values returned by getPeering.
    """
    def __init__(__self__, deleted_at=None, id=None, meta=None, partition=None, peer_ca_pems=None, peer_id=None, peer_name=None, peer_server_addresses=None, peer_server_name=None, state=None):
        if deleted_at and not isinstance(deleted_at, str):
            raise TypeError("Expected argument 'deleted_at' to be a str")
        pulumi.set(__self__, "deleted_at", deleted_at)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if meta and not isinstance(meta, dict):
            raise TypeError("Expected argument 'meta' to be a dict")
        pulumi.set(__self__, "meta", meta)
        if partition and not isinstance(partition, str):
            raise TypeError("Expected argument 'partition' to be a str")
        pulumi.set(__self__, "partition", partition)
        if peer_ca_pems and not isinstance(peer_ca_pems, list):
            raise TypeError("Expected argument 'peer_ca_pems' to be a list")
        pulumi.set(__self__, "peer_ca_pems", peer_ca_pems)
        if peer_id and not isinstance(peer_id, str):
            raise TypeError("Expected argument 'peer_id' to be a str")
        pulumi.set(__self__, "peer_id", peer_id)
        if peer_name and not isinstance(peer_name, str):
            raise TypeError("Expected argument 'peer_name' to be a str")
        pulumi.set(__self__, "peer_name", peer_name)
        if peer_server_addresses and not isinstance(peer_server_addresses, list):
            raise TypeError("Expected argument 'peer_server_addresses' to be a list")
        pulumi.set(__self__, "peer_server_addresses", peer_server_addresses)
        if peer_server_name and not isinstance(peer_server_name, str):
            raise TypeError("Expected argument 'peer_server_name' to be a str")
        pulumi.set(__self__, "peer_server_name", peer_server_name)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)

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

    @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 meta(self) -> Mapping[str, str]:
        return pulumi.get(self, "meta")

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

    @property
    @pulumi.getter(name="peerCaPems")
    def peer_ca_pems(self) -> Sequence[str]:
        return pulumi.get(self, "peer_ca_pems")

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

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

    @property
    @pulumi.getter(name="peerServerAddresses")
    def peer_server_addresses(self) -> Sequence[str]:
        return pulumi.get(self, "peer_server_addresses")

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

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


class AwaitableGetPeeringResult(GetPeeringResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetPeeringResult(
            deleted_at=self.deleted_at,
            id=self.id,
            meta=self.meta,
            partition=self.partition,
            peer_ca_pems=self.peer_ca_pems,
            peer_id=self.peer_id,
            peer_name=self.peer_name,
            peer_server_addresses=self.peer_server_addresses,
            peer_server_name=self.peer_server_name,
            state=self.state)


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

    ```python
    import pulumi
    import pulumi_consul as consul

    basic = consul.get_peering(peer_name="peered-cluster")
    ```
    """
    __args__ = dict()
    __args__['partition'] = partition
    __args__['peerName'] = peer_name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('consul:index/getPeering:getPeering', __args__, opts=opts, typ=GetPeeringResult).value

    return AwaitableGetPeeringResult(
        deleted_at=pulumi.get(__ret__, 'deleted_at'),
        id=pulumi.get(__ret__, 'id'),
        meta=pulumi.get(__ret__, 'meta'),
        partition=pulumi.get(__ret__, 'partition'),
        peer_ca_pems=pulumi.get(__ret__, 'peer_ca_pems'),
        peer_id=pulumi.get(__ret__, 'peer_id'),
        peer_name=pulumi.get(__ret__, 'peer_name'),
        peer_server_addresses=pulumi.get(__ret__, 'peer_server_addresses'),
        peer_server_name=pulumi.get(__ret__, 'peer_server_name'),
        state=pulumi.get(__ret__, 'state'))
def get_peering_output(partition: Optional[pulumi.Input[Optional[str]]] = None,
                       peer_name: Optional[pulumi.Input[str]] = None,
                       opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetPeeringResult]:
    """
    ## Example Usage

    ```python
    import pulumi
    import pulumi_consul as consul

    basic = consul.get_peering(peer_name="peered-cluster")
    ```
    """
    __args__ = dict()
    __args__['partition'] = partition
    __args__['peerName'] = peer_name
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('consul:index/getPeering:getPeering', __args__, opts=opts, typ=GetPeeringResult)
    return __ret__.apply(lambda __response__: GetPeeringResult(
        deleted_at=pulumi.get(__response__, 'deleted_at'),
        id=pulumi.get(__response__, 'id'),
        meta=pulumi.get(__response__, 'meta'),
        partition=pulumi.get(__response__, 'partition'),
        peer_ca_pems=pulumi.get(__response__, 'peer_ca_pems'),
        peer_id=pulumi.get(__response__, 'peer_id'),
        peer_name=pulumi.get(__response__, 'peer_name'),
        peer_server_addresses=pulumi.get(__response__, 'peer_server_addresses'),
        peer_server_name=pulumi.get(__response__, 'peer_server_name'),
        state=pulumi.get(__response__, 'state')))
