# 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__ = ['GroupLevelMrApprovalsArgs', 'GroupLevelMrApprovals']

@pulumi.input_type
class GroupLevelMrApprovalsArgs:
    def __init__(__self__, *,
                 group: pulumi.Input[_builtins.str],
                 allow_author_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_committer_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_overrides_to_approver_list_per_merge_request: Optional[pulumi.Input[_builtins.bool]] = None,
                 keep_settings_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 require_reauthentication_to_approve: Optional[pulumi.Input[_builtins.bool]] = None,
                 retain_approvals_on_push: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        The set of arguments for constructing a GroupLevelMrApprovals resource.
        :param pulumi.Input[_builtins.str] group: The ID or URL-encoded path of the group.
        :param pulumi.Input[_builtins.bool] allow_author_approval: Allow or prevent authors from self approving merge requests; `true` means authors can self approve.
        :param pulumi.Input[_builtins.bool] allow_committer_approval: Allow or prevent committers from self approving merge requests.
        :param pulumi.Input[_builtins.bool] allow_overrides_to_approver_list_per_merge_request: Allow or prevent overriding approvers per merge request.
        :param pulumi.Input[_builtins.bool] require_reauthentication_to_approve: Require approver to authenticate before adding the approval.
        :param pulumi.Input[_builtins.bool] retain_approvals_on_push: Retain approval count on a new push.
        """
        pulumi.set(__self__, "group", group)
        if allow_author_approval is not None:
            pulumi.set(__self__, "allow_author_approval", allow_author_approval)
        if allow_committer_approval is not None:
            pulumi.set(__self__, "allow_committer_approval", allow_committer_approval)
        if allow_overrides_to_approver_list_per_merge_request is not None:
            pulumi.set(__self__, "allow_overrides_to_approver_list_per_merge_request", allow_overrides_to_approver_list_per_merge_request)
        if keep_settings_on_destroy is not None:
            pulumi.set(__self__, "keep_settings_on_destroy", keep_settings_on_destroy)
        if require_reauthentication_to_approve is not None:
            pulumi.set(__self__, "require_reauthentication_to_approve", require_reauthentication_to_approve)
        if retain_approvals_on_push is not None:
            pulumi.set(__self__, "retain_approvals_on_push", retain_approvals_on_push)

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

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

    @_builtins.property
    @pulumi.getter(name="allowAuthorApproval")
    def allow_author_approval(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow or prevent authors from self approving merge requests; `true` means authors can self approve.
        """
        return pulumi.get(self, "allow_author_approval")

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

    @_builtins.property
    @pulumi.getter(name="allowCommitterApproval")
    def allow_committer_approval(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow or prevent committers from self approving merge requests.
        """
        return pulumi.get(self, "allow_committer_approval")

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

    @_builtins.property
    @pulumi.getter(name="allowOverridesToApproverListPerMergeRequest")
    def allow_overrides_to_approver_list_per_merge_request(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow or prevent overriding approvers per merge request.
        """
        return pulumi.get(self, "allow_overrides_to_approver_list_per_merge_request")

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

    @_builtins.property
    @pulumi.getter(name="keepSettingsOnDestroy")
    def keep_settings_on_destroy(self) -> Optional[pulumi.Input[_builtins.bool]]:
        return pulumi.get(self, "keep_settings_on_destroy")

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

    @_builtins.property
    @pulumi.getter(name="requireReauthenticationToApprove")
    def require_reauthentication_to_approve(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Require approver to authenticate before adding the approval.
        """
        return pulumi.get(self, "require_reauthentication_to_approve")

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

    @_builtins.property
    @pulumi.getter(name="retainApprovalsOnPush")
    def retain_approvals_on_push(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Retain approval count on a new push.
        """
        return pulumi.get(self, "retain_approvals_on_push")

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


@pulumi.input_type
class _GroupLevelMrApprovalsState:
    def __init__(__self__, *,
                 allow_author_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_committer_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_overrides_to_approver_list_per_merge_request: Optional[pulumi.Input[_builtins.bool]] = None,
                 group: Optional[pulumi.Input[_builtins.str]] = None,
                 keep_settings_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 require_reauthentication_to_approve: Optional[pulumi.Input[_builtins.bool]] = None,
                 retain_approvals_on_push: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        Input properties used for looking up and filtering GroupLevelMrApprovals resources.
        :param pulumi.Input[_builtins.bool] allow_author_approval: Allow or prevent authors from self approving merge requests; `true` means authors can self approve.
        :param pulumi.Input[_builtins.bool] allow_committer_approval: Allow or prevent committers from self approving merge requests.
        :param pulumi.Input[_builtins.bool] allow_overrides_to_approver_list_per_merge_request: Allow or prevent overriding approvers per merge request.
        :param pulumi.Input[_builtins.str] group: The ID or URL-encoded path of the group.
        :param pulumi.Input[_builtins.bool] require_reauthentication_to_approve: Require approver to authenticate before adding the approval.
        :param pulumi.Input[_builtins.bool] retain_approvals_on_push: Retain approval count on a new push.
        """
        if allow_author_approval is not None:
            pulumi.set(__self__, "allow_author_approval", allow_author_approval)
        if allow_committer_approval is not None:
            pulumi.set(__self__, "allow_committer_approval", allow_committer_approval)
        if allow_overrides_to_approver_list_per_merge_request is not None:
            pulumi.set(__self__, "allow_overrides_to_approver_list_per_merge_request", allow_overrides_to_approver_list_per_merge_request)
        if group is not None:
            pulumi.set(__self__, "group", group)
        if keep_settings_on_destroy is not None:
            pulumi.set(__self__, "keep_settings_on_destroy", keep_settings_on_destroy)
        if require_reauthentication_to_approve is not None:
            pulumi.set(__self__, "require_reauthentication_to_approve", require_reauthentication_to_approve)
        if retain_approvals_on_push is not None:
            pulumi.set(__self__, "retain_approvals_on_push", retain_approvals_on_push)

    @_builtins.property
    @pulumi.getter(name="allowAuthorApproval")
    def allow_author_approval(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow or prevent authors from self approving merge requests; `true` means authors can self approve.
        """
        return pulumi.get(self, "allow_author_approval")

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

    @_builtins.property
    @pulumi.getter(name="allowCommitterApproval")
    def allow_committer_approval(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow or prevent committers from self approving merge requests.
        """
        return pulumi.get(self, "allow_committer_approval")

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

    @_builtins.property
    @pulumi.getter(name="allowOverridesToApproverListPerMergeRequest")
    def allow_overrides_to_approver_list_per_merge_request(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Allow or prevent overriding approvers per merge request.
        """
        return pulumi.get(self, "allow_overrides_to_approver_list_per_merge_request")

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

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

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

    @_builtins.property
    @pulumi.getter(name="keepSettingsOnDestroy")
    def keep_settings_on_destroy(self) -> Optional[pulumi.Input[_builtins.bool]]:
        return pulumi.get(self, "keep_settings_on_destroy")

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

    @_builtins.property
    @pulumi.getter(name="requireReauthenticationToApprove")
    def require_reauthentication_to_approve(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Require approver to authenticate before adding the approval.
        """
        return pulumi.get(self, "require_reauthentication_to_approve")

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

    @_builtins.property
    @pulumi.getter(name="retainApprovalsOnPush")
    def retain_approvals_on_push(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Retain approval count on a new push.
        """
        return pulumi.get(self, "retain_approvals_on_push")

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


@pulumi.type_token("gitlab:index/groupLevelMrApprovals:GroupLevelMrApprovals")
class GroupLevelMrApprovals(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 allow_author_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_committer_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_overrides_to_approver_list_per_merge_request: Optional[pulumi.Input[_builtins.bool]] = None,
                 group: Optional[pulumi.Input[_builtins.str]] = None,
                 keep_settings_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 require_reauthentication_to_approve: Optional[pulumi.Input[_builtins.bool]] = None,
                 retain_approvals_on_push: Optional[pulumi.Input[_builtins.bool]] = None,
                 __props__=None):
        """
        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        foo = gitlab.Group("foo",
            name="test_group",
            path="test_group",
            description="An example group")
        foo_group_level_mr_approvals = gitlab.GroupLevelMrApprovals("foo",
            group=foo.id,
            allow_author_approval=True,
            allow_committer_approval=True,
            allow_overrides_to_approver_list_per_merge_request=True,
            retain_approvals_on_push=True,
            selective_code_owner_removals=False,
            require_reauthentication_to_approve=True)
        ```

        ## Import

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

        terraform

        import {

          to = gitlab_group_level_mr_approvals.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        ```sh
        $ pulumi import gitlab:index/groupLevelMrApprovals:GroupLevelMrApprovals You can import an approval configuration state using `<resource> <group_id>`.
        ```

        For example:

        ```sh
        $ pulumi import gitlab:index/groupLevelMrApprovals:GroupLevelMrApprovals foo 1234
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] allow_author_approval: Allow or prevent authors from self approving merge requests; `true` means authors can self approve.
        :param pulumi.Input[_builtins.bool] allow_committer_approval: Allow or prevent committers from self approving merge requests.
        :param pulumi.Input[_builtins.bool] allow_overrides_to_approver_list_per_merge_request: Allow or prevent overriding approvers per merge request.
        :param pulumi.Input[_builtins.str] group: The ID or URL-encoded path of the group.
        :param pulumi.Input[_builtins.bool] require_reauthentication_to_approve: Require approver to authenticate before adding the approval.
        :param pulumi.Input[_builtins.bool] retain_approvals_on_push: Retain approval count on a new push.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: GroupLevelMrApprovalsArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        foo = gitlab.Group("foo",
            name="test_group",
            path="test_group",
            description="An example group")
        foo_group_level_mr_approvals = gitlab.GroupLevelMrApprovals("foo",
            group=foo.id,
            allow_author_approval=True,
            allow_committer_approval=True,
            allow_overrides_to_approver_list_per_merge_request=True,
            retain_approvals_on_push=True,
            selective_code_owner_removals=False,
            require_reauthentication_to_approve=True)
        ```

        ## Import

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

        terraform

        import {

          to = gitlab_group_level_mr_approvals.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        ```sh
        $ pulumi import gitlab:index/groupLevelMrApprovals:GroupLevelMrApprovals You can import an approval configuration state using `<resource> <group_id>`.
        ```

        For example:

        ```sh
        $ pulumi import gitlab:index/groupLevelMrApprovals:GroupLevelMrApprovals foo 1234
        ```

        :param str resource_name: The name of the resource.
        :param GroupLevelMrApprovalsArgs 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(GroupLevelMrApprovalsArgs, 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,
                 allow_author_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_committer_approval: Optional[pulumi.Input[_builtins.bool]] = None,
                 allow_overrides_to_approver_list_per_merge_request: Optional[pulumi.Input[_builtins.bool]] = None,
                 group: Optional[pulumi.Input[_builtins.str]] = None,
                 keep_settings_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
                 require_reauthentication_to_approve: Optional[pulumi.Input[_builtins.bool]] = None,
                 retain_approvals_on_push: Optional[pulumi.Input[_builtins.bool]] = 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__ = GroupLevelMrApprovalsArgs.__new__(GroupLevelMrApprovalsArgs)

            __props__.__dict__["allow_author_approval"] = allow_author_approval
            __props__.__dict__["allow_committer_approval"] = allow_committer_approval
            __props__.__dict__["allow_overrides_to_approver_list_per_merge_request"] = allow_overrides_to_approver_list_per_merge_request
            if group is None and not opts.urn:
                raise TypeError("Missing required property 'group'")
            __props__.__dict__["group"] = group
            __props__.__dict__["keep_settings_on_destroy"] = keep_settings_on_destroy
            __props__.__dict__["require_reauthentication_to_approve"] = require_reauthentication_to_approve
            __props__.__dict__["retain_approvals_on_push"] = retain_approvals_on_push
        super(GroupLevelMrApprovals, __self__).__init__(
            'gitlab:index/groupLevelMrApprovals:GroupLevelMrApprovals',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            allow_author_approval: Optional[pulumi.Input[_builtins.bool]] = None,
            allow_committer_approval: Optional[pulumi.Input[_builtins.bool]] = None,
            allow_overrides_to_approver_list_per_merge_request: Optional[pulumi.Input[_builtins.bool]] = None,
            group: Optional[pulumi.Input[_builtins.str]] = None,
            keep_settings_on_destroy: Optional[pulumi.Input[_builtins.bool]] = None,
            require_reauthentication_to_approve: Optional[pulumi.Input[_builtins.bool]] = None,
            retain_approvals_on_push: Optional[pulumi.Input[_builtins.bool]] = None) -> 'GroupLevelMrApprovals':
        """
        Get an existing GroupLevelMrApprovals 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.bool] allow_author_approval: Allow or prevent authors from self approving merge requests; `true` means authors can self approve.
        :param pulumi.Input[_builtins.bool] allow_committer_approval: Allow or prevent committers from self approving merge requests.
        :param pulumi.Input[_builtins.bool] allow_overrides_to_approver_list_per_merge_request: Allow or prevent overriding approvers per merge request.
        :param pulumi.Input[_builtins.str] group: The ID or URL-encoded path of the group.
        :param pulumi.Input[_builtins.bool] require_reauthentication_to_approve: Require approver to authenticate before adding the approval.
        :param pulumi.Input[_builtins.bool] retain_approvals_on_push: Retain approval count on a new push.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _GroupLevelMrApprovalsState.__new__(_GroupLevelMrApprovalsState)

        __props__.__dict__["allow_author_approval"] = allow_author_approval
        __props__.__dict__["allow_committer_approval"] = allow_committer_approval
        __props__.__dict__["allow_overrides_to_approver_list_per_merge_request"] = allow_overrides_to_approver_list_per_merge_request
        __props__.__dict__["group"] = group
        __props__.__dict__["keep_settings_on_destroy"] = keep_settings_on_destroy
        __props__.__dict__["require_reauthentication_to_approve"] = require_reauthentication_to_approve
        __props__.__dict__["retain_approvals_on_push"] = retain_approvals_on_push
        return GroupLevelMrApprovals(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="allowAuthorApproval")
    def allow_author_approval(self) -> pulumi.Output[_builtins.bool]:
        """
        Allow or prevent authors from self approving merge requests; `true` means authors can self approve.
        """
        return pulumi.get(self, "allow_author_approval")

    @_builtins.property
    @pulumi.getter(name="allowCommitterApproval")
    def allow_committer_approval(self) -> pulumi.Output[_builtins.bool]:
        """
        Allow or prevent committers from self approving merge requests.
        """
        return pulumi.get(self, "allow_committer_approval")

    @_builtins.property
    @pulumi.getter(name="allowOverridesToApproverListPerMergeRequest")
    def allow_overrides_to_approver_list_per_merge_request(self) -> pulumi.Output[_builtins.bool]:
        """
        Allow or prevent overriding approvers per merge request.
        """
        return pulumi.get(self, "allow_overrides_to_approver_list_per_merge_request")

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

    @_builtins.property
    @pulumi.getter(name="keepSettingsOnDestroy")
    def keep_settings_on_destroy(self) -> pulumi.Output[_builtins.bool]:
        return pulumi.get(self, "keep_settings_on_destroy")

    @_builtins.property
    @pulumi.getter(name="requireReauthenticationToApprove")
    def require_reauthentication_to_approve(self) -> pulumi.Output[_builtins.bool]:
        """
        Require approver to authenticate before adding the approval.
        """
        return pulumi.get(self, "require_reauthentication_to_approve")

    @_builtins.property
    @pulumi.getter(name="retainApprovalsOnPush")
    def retain_approvals_on_push(self) -> pulumi.Output[_builtins.bool]:
        """
        Retain approval count on a new push.
        """
        return pulumi.get(self, "retain_approvals_on_push")

