# 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

__all__ = [
    'GetNetworkPeeringResult',
    'AwaitableGetNetworkPeeringResult',
    'get_network_peering',
    'get_network_peering_output',
]

@pulumi.output_type
class GetNetworkPeeringResult:
    """
    A collection of values returned by getNetworkPeering.
    """
    def __init__(__self__, export_custom_routes=None, export_subnet_routes_with_public_ip=None, id=None, import_custom_routes=None, import_subnet_routes_with_public_ip=None, name=None, network=None, peer_network=None, state=None, state_details=None):
        if export_custom_routes and not isinstance(export_custom_routes, bool):
            raise TypeError("Expected argument 'export_custom_routes' to be a bool")
        pulumi.set(__self__, "export_custom_routes", export_custom_routes)
        if export_subnet_routes_with_public_ip and not isinstance(export_subnet_routes_with_public_ip, bool):
            raise TypeError("Expected argument 'export_subnet_routes_with_public_ip' to be a bool")
        pulumi.set(__self__, "export_subnet_routes_with_public_ip", export_subnet_routes_with_public_ip)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if import_custom_routes and not isinstance(import_custom_routes, bool):
            raise TypeError("Expected argument 'import_custom_routes' to be a bool")
        pulumi.set(__self__, "import_custom_routes", import_custom_routes)
        if import_subnet_routes_with_public_ip and not isinstance(import_subnet_routes_with_public_ip, bool):
            raise TypeError("Expected argument 'import_subnet_routes_with_public_ip' to be a bool")
        pulumi.set(__self__, "import_subnet_routes_with_public_ip", import_subnet_routes_with_public_ip)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if network and not isinstance(network, str):
            raise TypeError("Expected argument 'network' to be a str")
        pulumi.set(__self__, "network", network)
        if peer_network and not isinstance(peer_network, str):
            raise TypeError("Expected argument 'peer_network' to be a str")
        pulumi.set(__self__, "peer_network", peer_network)
        if state and not isinstance(state, str):
            raise TypeError("Expected argument 'state' to be a str")
        pulumi.set(__self__, "state", state)
        if state_details and not isinstance(state_details, str):
            raise TypeError("Expected argument 'state_details' to be a str")
        pulumi.set(__self__, "state_details", state_details)

    @property
    @pulumi.getter(name="exportCustomRoutes")
    def export_custom_routes(self) -> bool:
        return pulumi.get(self, "export_custom_routes")

    @property
    @pulumi.getter(name="exportSubnetRoutesWithPublicIp")
    def export_subnet_routes_with_public_ip(self) -> bool:
        return pulumi.get(self, "export_subnet_routes_with_public_ip")

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

    @property
    @pulumi.getter(name="importCustomRoutes")
    def import_custom_routes(self) -> bool:
        return pulumi.get(self, "import_custom_routes")

    @property
    @pulumi.getter(name="importSubnetRoutesWithPublicIp")
    def import_subnet_routes_with_public_ip(self) -> bool:
        return pulumi.get(self, "import_subnet_routes_with_public_ip")

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

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

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

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

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


class AwaitableGetNetworkPeeringResult(GetNetworkPeeringResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetNetworkPeeringResult(
            export_custom_routes=self.export_custom_routes,
            export_subnet_routes_with_public_ip=self.export_subnet_routes_with_public_ip,
            id=self.id,
            import_custom_routes=self.import_custom_routes,
            import_subnet_routes_with_public_ip=self.import_subnet_routes_with_public_ip,
            name=self.name,
            network=self.network,
            peer_network=self.peer_network,
            state=self.state,
            state_details=self.state_details)


def get_network_peering(name: Optional[str] = None,
                        network: Optional[str] = None,
                        opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetNetworkPeeringResult:
    """
    Get information of a specified compute network peering. For more information see
    [the official documentation](https://cloud.google.com/compute/docs/vpc/vpc-peering)
    and
    [API](https://cloud.google.com/compute/docs/reference/latest/networks).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gcp as gcp

    default = gcp.compute.Network("default", auto_create_subnetworks=False)
    other = gcp.compute.Network("other", auto_create_subnetworks=False)
    peering1 = gcp.compute.NetworkPeering("peering1",
        network=default.self_link,
        peer_network=other.self_link)
    peering2 = gcp.compute.NetworkPeering("peering2",
        network=other.self_link,
        peer_network=default.self_link)
    peering1_ds = gcp.compute.get_network_peering_output(name=peering1.name,
        network=peering1.network)
    ```


    :param str name: Name of the peering.
    :param str network: The primary network of the peering.
    """
    __args__ = dict()
    __args__['name'] = name
    __args__['network'] = network
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('gcp:compute/getNetworkPeering:getNetworkPeering', __args__, opts=opts, typ=GetNetworkPeeringResult).value

    return AwaitableGetNetworkPeeringResult(
        export_custom_routes=__ret__.export_custom_routes,
        export_subnet_routes_with_public_ip=__ret__.export_subnet_routes_with_public_ip,
        id=__ret__.id,
        import_custom_routes=__ret__.import_custom_routes,
        import_subnet_routes_with_public_ip=__ret__.import_subnet_routes_with_public_ip,
        name=__ret__.name,
        network=__ret__.network,
        peer_network=__ret__.peer_network,
        state=__ret__.state,
        state_details=__ret__.state_details)


@_utilities.lift_output_func(get_network_peering)
def get_network_peering_output(name: Optional[pulumi.Input[str]] = None,
                               network: Optional[pulumi.Input[str]] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetNetworkPeeringResult]:
    """
    Get information of a specified compute network peering. For more information see
    [the official documentation](https://cloud.google.com/compute/docs/vpc/vpc-peering)
    and
    [API](https://cloud.google.com/compute/docs/reference/latest/networks).

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gcp as gcp

    default = gcp.compute.Network("default", auto_create_subnetworks=False)
    other = gcp.compute.Network("other", auto_create_subnetworks=False)
    peering1 = gcp.compute.NetworkPeering("peering1",
        network=default.self_link,
        peer_network=other.self_link)
    peering2 = gcp.compute.NetworkPeering("peering2",
        network=other.self_link,
        peer_network=default.self_link)
    peering1_ds = gcp.compute.get_network_peering_output(name=peering1.name,
        network=peering1.network)
    ```


    :param str name: Name of the peering.
    :param str network: The primary network of the peering.
    """
    ...
