# 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
from . import outputs

__all__ = [
    'GetRepositoryDeploymentBranchPoliciesResult',
    'AwaitableGetRepositoryDeploymentBranchPoliciesResult',
    'get_repository_deployment_branch_policies',
    'get_repository_deployment_branch_policies_output',
]

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

    @property
    @pulumi.getter(name="deploymentBranchPolicies")
    def deployment_branch_policies(self) -> Sequence['outputs.GetRepositoryDeploymentBranchPoliciesDeploymentBranchPolicyResult']:
        """
        The list of this repository / environment deployment policies. Each element of `deployment_branch_policies` has the following attributes:
        """
        return pulumi.get(self, "deployment_branch_policies")

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

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


class AwaitableGetRepositoryDeploymentBranchPoliciesResult(GetRepositoryDeploymentBranchPoliciesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetRepositoryDeploymentBranchPoliciesResult(
            deployment_branch_policies=self.deployment_branch_policies,
            environment_name=self.environment_name,
            id=self.id,
            repository=self.repository)


def get_repository_deployment_branch_policies(environment_name: Optional[str] = None,
                                              repository: Optional[str] = None,
                                              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetRepositoryDeploymentBranchPoliciesResult:
    """
    Use this data source to retrieve deployment branch policies for a repository / environment.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_github as github

    example = github.get_repository_deployment_branch_policies(repository="example-repository",
        environment_name="env_name")
    ```


    :param str environment_name: Name of the environment to retrieve the deployment branch policies  from.
    :param str repository: Name of the repository to retrieve the deployment branch policies from.
    """
    __args__ = dict()
    __args__['environmentName'] = environment_name
    __args__['repository'] = repository
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('github:index/getRepositoryDeploymentBranchPolicies:getRepositoryDeploymentBranchPolicies', __args__, opts=opts, typ=GetRepositoryDeploymentBranchPoliciesResult).value

    return AwaitableGetRepositoryDeploymentBranchPoliciesResult(
        deployment_branch_policies=pulumi.get(__ret__, 'deployment_branch_policies'),
        environment_name=pulumi.get(__ret__, 'environment_name'),
        id=pulumi.get(__ret__, 'id'),
        repository=pulumi.get(__ret__, 'repository'))


@_utilities.lift_output_func(get_repository_deployment_branch_policies)
def get_repository_deployment_branch_policies_output(environment_name: Optional[pulumi.Input[str]] = None,
                                                     repository: Optional[pulumi.Input[str]] = None,
                                                     opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetRepositoryDeploymentBranchPoliciesResult]:
    """
    Use this data source to retrieve deployment branch policies for a repository / environment.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_github as github

    example = github.get_repository_deployment_branch_policies(repository="example-repository",
        environment_name="env_name")
    ```


    :param str environment_name: Name of the environment to retrieve the deployment branch policies  from.
    :param str repository: Name of the repository to retrieve the deployment branch policies from.
    """
    ...
