# 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

__all__ = [
    'GetProjectLabelResult',
    'AwaitableGetProjectLabelResult',
    'get_project_label',
    'get_project_label_output',
]

@pulumi.output_type
class GetProjectLabelResult:
    """
    A collection of values returned by getProjectLabel.
    """
    def __init__(__self__, closed_issues_count=None, color=None, description=None, id=None, is_project_label=None, label_id=None, name=None, open_issues_count=None, open_merge_requests_count=None, priority=None, project=None, subscribed=None, text_color=None):
        if closed_issues_count and not isinstance(closed_issues_count, int):
            raise TypeError("Expected argument 'closed_issues_count' to be a int")
        pulumi.set(__self__, "closed_issues_count", closed_issues_count)
        if color and not isinstance(color, str):
            raise TypeError("Expected argument 'color' to be a str")
        pulumi.set(__self__, "color", color)
        if description and not isinstance(description, str):
            raise TypeError("Expected argument 'description' to be a str")
        pulumi.set(__self__, "description", description)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if is_project_label and not isinstance(is_project_label, bool):
            raise TypeError("Expected argument 'is_project_label' to be a bool")
        pulumi.set(__self__, "is_project_label", is_project_label)
        if label_id and not isinstance(label_id, int):
            raise TypeError("Expected argument 'label_id' to be a int")
        pulumi.set(__self__, "label_id", label_id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if open_issues_count and not isinstance(open_issues_count, int):
            raise TypeError("Expected argument 'open_issues_count' to be a int")
        pulumi.set(__self__, "open_issues_count", open_issues_count)
        if open_merge_requests_count and not isinstance(open_merge_requests_count, int):
            raise TypeError("Expected argument 'open_merge_requests_count' to be a int")
        pulumi.set(__self__, "open_merge_requests_count", open_merge_requests_count)
        if priority and not isinstance(priority, int):
            raise TypeError("Expected argument 'priority' to be a int")
        pulumi.set(__self__, "priority", priority)
        if project and not isinstance(project, str):
            raise TypeError("Expected argument 'project' to be a str")
        pulumi.set(__self__, "project", project)
        if subscribed and not isinstance(subscribed, bool):
            raise TypeError("Expected argument 'subscribed' to be a bool")
        pulumi.set(__self__, "subscribed", subscribed)
        if text_color and not isinstance(text_color, str):
            raise TypeError("Expected argument 'text_color' to be a str")
        pulumi.set(__self__, "text_color", text_color)

    @_builtins.property
    @pulumi.getter(name="closedIssuesCount")
    def closed_issues_count(self) -> _builtins.int:
        """
        The number of closed issues with this label.
        """
        return pulumi.get(self, "closed_issues_count")

    @_builtins.property
    @pulumi.getter
    def color(self) -> _builtins.str:
        """
        The color of the label given in 6-digit hex notation with leading '#' sign.
        """
        return pulumi.get(self, "color")

    @_builtins.property
    @pulumi.getter
    def description(self) -> _builtins.str:
        """
        The description of the label.
        """
        return pulumi.get(self, "description")

    @_builtins.property
    @pulumi.getter
    def id(self) -> _builtins.str:
        """
        The ID of the label in the format `project:label_id`.
        """
        return pulumi.get(self, "id")

    @_builtins.property
    @pulumi.getter(name="isProjectLabel")
    def is_project_label(self) -> _builtins.bool:
        """
        Whether the label is a project label.
        """
        return pulumi.get(self, "is_project_label")

    @_builtins.property
    @pulumi.getter(name="labelId")
    def label_id(self) -> _builtins.int:
        """
        The ID of the label.
        """
        return pulumi.get(self, "label_id")

    @_builtins.property
    @pulumi.getter
    def name(self) -> _builtins.str:
        """
        The name of the label.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="openIssuesCount")
    def open_issues_count(self) -> _builtins.int:
        """
        The number of open issues with this label.
        """
        return pulumi.get(self, "open_issues_count")

    @_builtins.property
    @pulumi.getter(name="openMergeRequestsCount")
    def open_merge_requests_count(self) -> _builtins.int:
        """
        The number of open merge requests with this label.
        """
        return pulumi.get(self, "open_merge_requests_count")

    @_builtins.property
    @pulumi.getter
    def priority(self) -> _builtins.int:
        """
        The priority of the label. Null if no priority is set.
        """
        return pulumi.get(self, "priority")

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

    @_builtins.property
    @pulumi.getter
    def subscribed(self) -> _builtins.bool:
        """
        Whether the authenticated user is subscribed to the label.
        """
        return pulumi.get(self, "subscribed")

    @_builtins.property
    @pulumi.getter(name="textColor")
    def text_color(self) -> _builtins.str:
        """
        The text color of the label given in 6-digit hex notation with leading '#' sign.
        """
        return pulumi.get(self, "text_color")


class AwaitableGetProjectLabelResult(GetProjectLabelResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetProjectLabelResult(
            closed_issues_count=self.closed_issues_count,
            color=self.color,
            description=self.description,
            id=self.id,
            is_project_label=self.is_project_label,
            label_id=self.label_id,
            name=self.name,
            open_issues_count=self.open_issues_count,
            open_merge_requests_count=self.open_merge_requests_count,
            priority=self.priority,
            project=self.project,
            subscribed=self.subscribed,
            text_color=self.text_color)


def get_project_label(label_id: Optional[_builtins.int] = None,
                      project: Optional[_builtins.str] = None,
                      opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetProjectLabelResult:
    """
    The `ProjectLabel` data source retrieves details about a project label.

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

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gitlab as gitlab

    # Retrieve a project label by its ID
    example = gitlab.get_project_label(project="385",
        label_id=24)
    # Retrieve using project path
    by_path = gitlab.get_project_label(project="group/project",
        label_id=25)
    ```


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

    return AwaitableGetProjectLabelResult(
        closed_issues_count=pulumi.get(__ret__, 'closed_issues_count'),
        color=pulumi.get(__ret__, 'color'),
        description=pulumi.get(__ret__, 'description'),
        id=pulumi.get(__ret__, 'id'),
        is_project_label=pulumi.get(__ret__, 'is_project_label'),
        label_id=pulumi.get(__ret__, 'label_id'),
        name=pulumi.get(__ret__, 'name'),
        open_issues_count=pulumi.get(__ret__, 'open_issues_count'),
        open_merge_requests_count=pulumi.get(__ret__, 'open_merge_requests_count'),
        priority=pulumi.get(__ret__, 'priority'),
        project=pulumi.get(__ret__, 'project'),
        subscribed=pulumi.get(__ret__, 'subscribed'),
        text_color=pulumi.get(__ret__, 'text_color'))
def get_project_label_output(label_id: Optional[pulumi.Input[_builtins.int]] = None,
                             project: Optional[pulumi.Input[_builtins.str]] = None,
                             opts: Optional[Union[pulumi.InvokeOptions, pulumi.InvokeOutputOptions]] = None) -> pulumi.Output[GetProjectLabelResult]:
    """
    The `ProjectLabel` data source retrieves details about a project label.

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

    ## Example Usage

    ```python
    import pulumi
    import pulumi_gitlab as gitlab

    # Retrieve a project label by its ID
    example = gitlab.get_project_label(project="385",
        label_id=24)
    # Retrieve using project path
    by_path = gitlab.get_project_label(project="group/project",
        label_id=25)
    ```


    :param _builtins.int label_id: The ID of the label.
    :param _builtins.str project: The ID or URL-encoded path of the project.
    """
    __args__ = dict()
    __args__['labelId'] = label_id
    __args__['project'] = project
    opts = pulumi.InvokeOutputOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke_output('gitlab:index/getProjectLabel:getProjectLabel', __args__, opts=opts, typ=GetProjectLabelResult)
    return __ret__.apply(lambda __response__: GetProjectLabelResult(
        closed_issues_count=pulumi.get(__response__, 'closed_issues_count'),
        color=pulumi.get(__response__, 'color'),
        description=pulumi.get(__response__, 'description'),
        id=pulumi.get(__response__, 'id'),
        is_project_label=pulumi.get(__response__, 'is_project_label'),
        label_id=pulumi.get(__response__, 'label_id'),
        name=pulumi.get(__response__, 'name'),
        open_issues_count=pulumi.get(__response__, 'open_issues_count'),
        open_merge_requests_count=pulumi.get(__response__, 'open_merge_requests_count'),
        priority=pulumi.get(__response__, 'priority'),
        project=pulumi.get(__response__, 'project'),
        subscribed=pulumi.get(__response__, 'subscribed'),
        text_color=pulumi.get(__response__, 'text_color')))
