# 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__ = ['ProjectExternalStatusCheckArgs', 'ProjectExternalStatusCheck']

@pulumi.input_type
class ProjectExternalStatusCheckArgs:
    def __init__(__self__, *,
                 external_url: pulumi.Input[_builtins.str],
                 project_id: pulumi.Input[_builtins.int],
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 protected_branch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]] = None,
                 shared_secret: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a ProjectExternalStatusCheck resource.
        :param pulumi.Input[_builtins.str] external_url: The URL of the external status check service.
        :param pulumi.Input[_builtins.int] project_id: The ID of the project.
        :param pulumi.Input[_builtins.str] name: The display name of the external status check service.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.int]]] protected_branch_ids: The list of IDs of protected branches to scope the rule by.
        :param pulumi.Input[_builtins.str] shared_secret: The HMAC secret for the external status check.  If this is set, then removed from the config, the value will get set to empty in the state.
        """
        pulumi.set(__self__, "external_url", external_url)
        pulumi.set(__self__, "project_id", project_id)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if protected_branch_ids is not None:
            pulumi.set(__self__, "protected_branch_ids", protected_branch_ids)
        if shared_secret is not None:
            pulumi.set(__self__, "shared_secret", shared_secret)

    @_builtins.property
    @pulumi.getter(name="externalUrl")
    def external_url(self) -> pulumi.Input[_builtins.str]:
        """
        The URL of the external status check service.
        """
        return pulumi.get(self, "external_url")

    @external_url.setter
    def external_url(self, value: pulumi.Input[_builtins.str]):
        pulumi.set(self, "external_url", value)

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Input[_builtins.int]:
        """
        The ID of the project.
        """
        return pulumi.get(self, "project_id")

    @project_id.setter
    def project_id(self, value: pulumi.Input[_builtins.int]):
        pulumi.set(self, "project_id", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The display name of the external status check service.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="protectedBranchIds")
    def protected_branch_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]]:
        """
        The list of IDs of protected branches to scope the rule by.
        """
        return pulumi.get(self, "protected_branch_ids")

    @protected_branch_ids.setter
    def protected_branch_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]]):
        pulumi.set(self, "protected_branch_ids", value)

    @_builtins.property
    @pulumi.getter(name="sharedSecret")
    def shared_secret(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The HMAC secret for the external status check.  If this is set, then removed from the config, the value will get set to empty in the state.
        """
        return pulumi.get(self, "shared_secret")

    @shared_secret.setter
    def shared_secret(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "shared_secret", value)


@pulumi.input_type
class _ProjectExternalStatusCheckState:
    def __init__(__self__, *,
                 external_url: Optional[pulumi.Input[_builtins.str]] = None,
                 hmac: Optional[pulumi.Input[_builtins.bool]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.int]] = None,
                 protected_branch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]] = None,
                 shared_secret: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering ProjectExternalStatusCheck resources.
        :param pulumi.Input[_builtins.str] external_url: The URL of the external status check service.
        :param pulumi.Input[_builtins.bool] hmac: True if the external status check uses an HMAC secret.
        :param pulumi.Input[_builtins.str] name: The display name of the external status check service.
        :param pulumi.Input[_builtins.int] project_id: The ID of the project.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.int]]] protected_branch_ids: The list of IDs of protected branches to scope the rule by.
        :param pulumi.Input[_builtins.str] shared_secret: The HMAC secret for the external status check.  If this is set, then removed from the config, the value will get set to empty in the state.
        """
        if external_url is not None:
            pulumi.set(__self__, "external_url", external_url)
        if hmac is not None:
            pulumi.set(__self__, "hmac", hmac)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if project_id is not None:
            pulumi.set(__self__, "project_id", project_id)
        if protected_branch_ids is not None:
            pulumi.set(__self__, "protected_branch_ids", protected_branch_ids)
        if shared_secret is not None:
            pulumi.set(__self__, "shared_secret", shared_secret)

    @_builtins.property
    @pulumi.getter(name="externalUrl")
    def external_url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The URL of the external status check service.
        """
        return pulumi.get(self, "external_url")

    @external_url.setter
    def external_url(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "external_url", value)

    @_builtins.property
    @pulumi.getter
    def hmac(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        True if the external status check uses an HMAC secret.
        """
        return pulumi.get(self, "hmac")

    @hmac.setter
    def hmac(self, value: Optional[pulumi.Input[_builtins.bool]]):
        pulumi.set(self, "hmac", value)

    @_builtins.property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The display name of the external status check service.
        """
        return pulumi.get(self, "name")

    @name.setter
    def name(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "name", value)

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The ID of the project.
        """
        return pulumi.get(self, "project_id")

    @project_id.setter
    def project_id(self, value: Optional[pulumi.Input[_builtins.int]]):
        pulumi.set(self, "project_id", value)

    @_builtins.property
    @pulumi.getter(name="protectedBranchIds")
    def protected_branch_ids(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]]:
        """
        The list of IDs of protected branches to scope the rule by.
        """
        return pulumi.get(self, "protected_branch_ids")

    @protected_branch_ids.setter
    def protected_branch_ids(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]]):
        pulumi.set(self, "protected_branch_ids", value)

    @_builtins.property
    @pulumi.getter(name="sharedSecret")
    def shared_secret(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The HMAC secret for the external status check.  If this is set, then removed from the config, the value will get set to empty in the state.
        """
        return pulumi.get(self, "shared_secret")

    @shared_secret.setter
    def shared_secret(self, value: Optional[pulumi.Input[_builtins.str]]):
        pulumi.set(self, "shared_secret", value)


@pulumi.type_token("gitlab:index/projectExternalStatusCheck:ProjectExternalStatusCheck")
class ProjectExternalStatusCheck(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 external_url: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.int]] = None,
                 protected_branch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]] = None,
                 shared_secret: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        The `ProjectExternalStatusCheck` resource allows you to manage the lifecycle of an external status check service on a project.

        > This resource requires a GitLab Enterprise instance with an Ultimate license.

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

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        foo = gitlab.ProjectExternalStatusCheck("foo",
            project_id=123,
            name="foo",
            external_url="https://example.gitlab.com")
        bar = gitlab.ProjectExternalStatusCheck("bar",
            project_id=456,
            name="bar",
            external_url="https://example.gitlab.com",
            shared_secret="secret",
            protected_branch_ids=[
                6,
                28,
            ])
        ```

        ## Import

        Starting in Terraform v1.5.0, you can use an import block to import `gitlab_project_external_status_check`. For example:

        terraform

        import {

          to = gitlab_project_external_status_check.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        GitLab project external status checks can be imported using an id made up of `<project-id>:<external-check-id>`, e.g.

        ```sh
        $ pulumi import gitlab:index/projectExternalStatusCheck:ProjectExternalStatusCheck foo "123:42"
        ```

        NOTE: the `shared_secret` resource attribute is not available for imported resources as this information cannot be read from the GitLab API.

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] external_url: The URL of the external status check service.
        :param pulumi.Input[_builtins.str] name: The display name of the external status check service.
        :param pulumi.Input[_builtins.int] project_id: The ID of the project.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.int]]] protected_branch_ids: The list of IDs of protected branches to scope the rule by.
        :param pulumi.Input[_builtins.str] shared_secret: The HMAC secret for the external status check.  If this is set, then removed from the config, the value will get set to empty in the state.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ProjectExternalStatusCheckArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `ProjectExternalStatusCheck` resource allows you to manage the lifecycle of an external status check service on a project.

        > This resource requires a GitLab Enterprise instance with an Ultimate license.

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

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        foo = gitlab.ProjectExternalStatusCheck("foo",
            project_id=123,
            name="foo",
            external_url="https://example.gitlab.com")
        bar = gitlab.ProjectExternalStatusCheck("bar",
            project_id=456,
            name="bar",
            external_url="https://example.gitlab.com",
            shared_secret="secret",
            protected_branch_ids=[
                6,
                28,
            ])
        ```

        ## Import

        Starting in Terraform v1.5.0, you can use an import block to import `gitlab_project_external_status_check`. For example:

        terraform

        import {

          to = gitlab_project_external_status_check.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        GitLab project external status checks can be imported using an id made up of `<project-id>:<external-check-id>`, e.g.

        ```sh
        $ pulumi import gitlab:index/projectExternalStatusCheck:ProjectExternalStatusCheck foo "123:42"
        ```

        NOTE: the `shared_secret` resource attribute is not available for imported resources as this information cannot be read from the GitLab API.

        :param str resource_name: The name of the resource.
        :param ProjectExternalStatusCheckArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(ProjectExternalStatusCheckArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 external_url: Optional[pulumi.Input[_builtins.str]] = None,
                 name: Optional[pulumi.Input[_builtins.str]] = None,
                 project_id: Optional[pulumi.Input[_builtins.int]] = None,
                 protected_branch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]] = None,
                 shared_secret: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        opts = pulumi.ResourceOptions.merge(_utilities.get_resource_opts_defaults(), opts)
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = ProjectExternalStatusCheckArgs.__new__(ProjectExternalStatusCheckArgs)

            if external_url is None and not opts.urn:
                raise TypeError("Missing required property 'external_url'")
            __props__.__dict__["external_url"] = external_url
            __props__.__dict__["name"] = name
            if project_id is None and not opts.urn:
                raise TypeError("Missing required property 'project_id'")
            __props__.__dict__["project_id"] = project_id
            __props__.__dict__["protected_branch_ids"] = protected_branch_ids
            __props__.__dict__["shared_secret"] = None if shared_secret is None else pulumi.Output.secret(shared_secret)
            __props__.__dict__["hmac"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["sharedSecret"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(ProjectExternalStatusCheck, __self__).__init__(
            'gitlab:index/projectExternalStatusCheck:ProjectExternalStatusCheck',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            external_url: Optional[pulumi.Input[_builtins.str]] = None,
            hmac: Optional[pulumi.Input[_builtins.bool]] = None,
            name: Optional[pulumi.Input[_builtins.str]] = None,
            project_id: Optional[pulumi.Input[_builtins.int]] = None,
            protected_branch_ids: Optional[pulumi.Input[Sequence[pulumi.Input[_builtins.int]]]] = None,
            shared_secret: Optional[pulumi.Input[_builtins.str]] = None) -> 'ProjectExternalStatusCheck':
        """
        Get an existing ProjectExternalStatusCheck resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] external_url: The URL of the external status check service.
        :param pulumi.Input[_builtins.bool] hmac: True if the external status check uses an HMAC secret.
        :param pulumi.Input[_builtins.str] name: The display name of the external status check service.
        :param pulumi.Input[_builtins.int] project_id: The ID of the project.
        :param pulumi.Input[Sequence[pulumi.Input[_builtins.int]]] protected_branch_ids: The list of IDs of protected branches to scope the rule by.
        :param pulumi.Input[_builtins.str] shared_secret: The HMAC secret for the external status check.  If this is set, then removed from the config, the value will get set to empty in the state.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ProjectExternalStatusCheckState.__new__(_ProjectExternalStatusCheckState)

        __props__.__dict__["external_url"] = external_url
        __props__.__dict__["hmac"] = hmac
        __props__.__dict__["name"] = name
        __props__.__dict__["project_id"] = project_id
        __props__.__dict__["protected_branch_ids"] = protected_branch_ids
        __props__.__dict__["shared_secret"] = shared_secret
        return ProjectExternalStatusCheck(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="externalUrl")
    def external_url(self) -> pulumi.Output[_builtins.str]:
        """
        The URL of the external status check service.
        """
        return pulumi.get(self, "external_url")

    @_builtins.property
    @pulumi.getter
    def hmac(self) -> pulumi.Output[_builtins.bool]:
        """
        True if the external status check uses an HMAC secret.
        """
        return pulumi.get(self, "hmac")

    @_builtins.property
    @pulumi.getter
    def name(self) -> pulumi.Output[_builtins.str]:
        """
        The display name of the external status check service.
        """
        return pulumi.get(self, "name")

    @_builtins.property
    @pulumi.getter(name="projectId")
    def project_id(self) -> pulumi.Output[_builtins.int]:
        """
        The ID of the project.
        """
        return pulumi.get(self, "project_id")

    @_builtins.property
    @pulumi.getter(name="protectedBranchIds")
    def protected_branch_ids(self) -> pulumi.Output[Sequence[_builtins.int]]:
        """
        The list of IDs of protected branches to scope the rule by.
        """
        return pulumi.get(self, "protected_branch_ids")

    @_builtins.property
    @pulumi.getter(name="sharedSecret")
    def shared_secret(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The HMAC secret for the external status check.  If this is set, then removed from the config, the value will get set to empty in the state.
        """
        return pulumi.get(self, "shared_secret")

