# coding=utf-8
# *** WARNING: this file was generated by pulumi-language-python. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins as _builtins
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__ = [
    'GetProjectBranchesResult',
    'AwaitableGetProjectBranchesResult',
    'get_project_branches',
    'get_project_branches_output',
]

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

    @_builtins.property
    @pulumi.getter
    def branches(self) -> Sequence['outputs.GetProjectBranchesBranchResult']:
        """
        The list of branches of the project, as defined below.
        """
        return pulumi.get(self, "branches")

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

    @_builtins.property
    @pulumi.getter
    def project(self) -> _builtins.str:
        """
        ID or URL-encoded path of the project owned by the authenticated user.
        """
        return pulumi.get(self, "project")


class AwaitableGetProjectBranchesResult(GetProjectBranchesResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetProjectBranchesResult(
            branches=self.branches,
            id=self.id,
            project=self.project)


def get_project_branches(project: Optional[_builtins.str] = None,
                         opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetProjectBranchesResult:
    """
    The `get_project_branches` data source allows details of the branches of a given project to be retrieved.

    **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/branches/#list-repository-branches)


    :param _builtins.str project: ID or URL-encoded path of the project owned by the authenticated user.
    """
    __args__ = dict()
    __args__['project'] = project
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('gitlab:index/getProjectBranches:getProjectBranches', __args__, opts=opts, typ=GetProjectBranchesResult).value

    return AwaitableGetProjectBranchesResult(
        branches=pulumi.get(__ret__, 'branches'),
        id=pulumi.get(__ret__, 'id'),
        project=pulumi.get(__ret__, 'project'))
def get_project_branches_output(project: Optional[pulumi.Input[_builtins.str]] = None,
                                opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetProjectBranchesResult]:
    """
    The `get_project_branches` data source allows details of the branches of a given project to be retrieved.

    **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/branches/#list-repository-branches)


    :param _builtins.str project: ID or URL-encoded path of the project owned by the authenticated user.
    """
    __args__ = dict()
    __args__['project'] = project
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('gitlab:index/getProjectBranches:getProjectBranches', __args__, opts=opts, typ=GetProjectBranchesResult)
    return __ret__.apply(lambda __response__: GetProjectBranchesResult(
        branches=pulumi.get(__response__, 'branches'),
        id=pulumi.get(__response__, 'id'),
        project=pulumi.get(__response__, 'project')))
