# 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__ = [
    'GetProjectLabelsResult',
    'AwaitableGetProjectLabelsResult',
    'get_project_labels',
    'get_project_labels_output',
]

@pulumi.output_type
class GetProjectLabelsResult:
    """
    A collection of values returned by getProjectLabels.
    """
    def __init__(__self__, id=None, labels=None, project=None):
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if labels and not isinstance(labels, list):
            raise TypeError("Expected argument 'labels' to be a list")
        pulumi.set(__self__, "labels", labels)
        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 id(self) -> _builtins.str:
        """
        The ID of this data source.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter
    def labels(self) -> Sequence['outputs.GetProjectLabelsLabelResult']:
        """
        The list of labels in the project.
        """
        return pulumi.get(self, "labels")

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


class AwaitableGetProjectLabelsResult(GetProjectLabelsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetProjectLabelsResult(
            id=self.id,
            labels=self.labels,
            project=self.project)


def get_project_labels(project: Optional[_builtins.str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetProjectLabelsResult:
    """
    The `get_project_labels` data source retrieves a list of labels for a project.

    **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/labels/)

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gitlab as gitlab

    example = gitlab.get_project_labels(project="385")
    ```


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

    return AwaitableGetProjectLabelsResult(
        id=pulumi.get(__ret__, 'id'),
        labels=pulumi.get(__ret__, 'labels'),
        project=pulumi.get(__ret__, 'project'))
def get_project_labels_output(project: Optional[pulumi.Input[_builtins.str]] = None,
                              opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetProjectLabelsResult]:
    """
    The `get_project_labels` data source retrieves a list of labels for a project.

    **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/labels/)

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gitlab as gitlab

    example = gitlab.get_project_labels(project="385")
    ```


    :param _builtins.str project: The ID or URL-encoded path of the project.
    """
    __args__ = dict()
    __args__['project'] = project
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('gitlab:index/getProjectLabels:getProjectLabels', __args__, opts=opts, typ=GetProjectLabelsResult)
    return __ret__.apply(lambda __response__: GetProjectLabelsResult(
        id=pulumi.get(__response__, 'id'),
        labels=pulumi.get(__response__, 'labels'),
        project=pulumi.get(__response__, 'project')))
