# 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__ = [
    'GetEnvironmentIamPolicyResult',
    'AwaitableGetEnvironmentIamPolicyResult',
    'get_environment_iam_policy',
    'get_environment_iam_policy_output',
]

@pulumi.output_type
class GetEnvironmentIamPolicyResult:
    """
    A collection of values returned by getEnvironmentIamPolicy.
    """
    def __init__(__self__, env_id=None, etag=None, id=None, org_id=None, policy_data=None):
        if env_id and not isinstance(env_id, str):
            raise TypeError("Expected argument 'env_id' to be a str")
        pulumi.set(__self__, "env_id", env_id)
        if etag and not isinstance(etag, str):
            raise TypeError("Expected argument 'etag' to be a str")
        pulumi.set(__self__, "etag", etag)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if org_id and not isinstance(org_id, str):
            raise TypeError("Expected argument 'org_id' to be a str")
        pulumi.set(__self__, "org_id", org_id)
        if policy_data and not isinstance(policy_data, str):
            raise TypeError("Expected argument 'policy_data' to be a str")
        pulumi.set(__self__, "policy_data", policy_data)

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

    @property
    @pulumi.getter
    def etag(self) -> str:
        """
        (Computed) The etag of the IAM policy.
        """
        return pulumi.get(self, "etag")

    @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="orgId")
    def org_id(self) -> str:
        return pulumi.get(self, "org_id")

    @property
    @pulumi.getter(name="policyData")
    def policy_data(self) -> str:
        """
        (Required only by `apigee.EnvironmentIamPolicy`) The policy data generated by
        a `organizations_get_iam_policy` data source.
        """
        return pulumi.get(self, "policy_data")


class AwaitableGetEnvironmentIamPolicyResult(GetEnvironmentIamPolicyResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetEnvironmentIamPolicyResult(
            env_id=self.env_id,
            etag=self.etag,
            id=self.id,
            org_id=self.org_id,
            policy_data=self.policy_data)


def get_environment_iam_policy(env_id: Optional[str] = None,
                               org_id: Optional[str] = None,
                               opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetEnvironmentIamPolicyResult:
    """
    Retrieves the current IAM policy data for environment

    ## example

    ```python
    import pulumi
    import pulumi_gcp as gcp

    policy = gcp.apigee.get_environment_iam_policy(org_id=google_apigee_environment["apigee_environment"]["org_id"],
        env_id=google_apigee_environment["apigee_environment"]["name"])
    ```


    :param str env_id: Used to find the parent resource to bind the IAM policy to
    """
    __args__ = dict()
    __args__['envId'] = env_id
    __args__['orgId'] = org_id
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('gcp:apigee/getEnvironmentIamPolicy:getEnvironmentIamPolicy', __args__, opts=opts, typ=GetEnvironmentIamPolicyResult).value

    return AwaitableGetEnvironmentIamPolicyResult(
        env_id=pulumi.get(__ret__, 'env_id'),
        etag=pulumi.get(__ret__, 'etag'),
        id=pulumi.get(__ret__, 'id'),
        org_id=pulumi.get(__ret__, 'org_id'),
        policy_data=pulumi.get(__ret__, 'policy_data'))


@_utilities.lift_output_func(get_environment_iam_policy)
def get_environment_iam_policy_output(env_id: Optional[pulumi.Input[str]] = None,
                                      org_id: Optional[pulumi.Input[str]] = None,
                                      opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetEnvironmentIamPolicyResult]:
    """
    Retrieves the current IAM policy data for environment

    ## example

    ```python
    import pulumi
    import pulumi_gcp as gcp

    policy = gcp.apigee.get_environment_iam_policy(org_id=google_apigee_environment["apigee_environment"]["org_id"],
        env_id=google_apigee_environment["apigee_environment"]["name"])
    ```


    :param str env_id: Used to find the parent resource to bind the IAM policy to
    """
    ...
