# 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__ = ['ProjectPullMirrorArgs', 'ProjectPullMirror']

@pulumi.input_type
class ProjectPullMirrorArgs:
    def __init__(__self__, *,
                 project: pulumi.Input[_builtins.str],
                 url: pulumi.Input[_builtins.str],
                 auth_password: Optional[pulumi.Input[_builtins.str]] = None,
                 auth_user: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
                 mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
                 mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
                 only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None):
        """
        The set of arguments for constructing a ProjectPullMirror resource.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
        :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
        :param pulumi.Input[_builtins.str] auth_password: Authentication password or token for the remote repository.
        :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
        :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
        :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
        :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
        :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
        :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
        """
        pulumi.set(__self__, "project", project)
        pulumi.set(__self__, "url", url)
        if auth_password is not None:
            pulumi.set(__self__, "auth_password", auth_password)
        if auth_user is not None:
            pulumi.set(__self__, "auth_user", auth_user)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if mirror_branch_regex is not None:
            pulumi.set(__self__, "mirror_branch_regex", mirror_branch_regex)
        if mirror_overwrites_diverged_branches is not None:
            pulumi.set(__self__, "mirror_overwrites_diverged_branches", mirror_overwrites_diverged_branches)
        if mirror_trigger_builds is not None:
            pulumi.set(__self__, "mirror_trigger_builds", mirror_trigger_builds)
        if only_mirror_protected_branches is not None:
            pulumi.set(__self__, "only_mirror_protected_branches", only_mirror_protected_branches)

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

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

    @_builtins.property
    @pulumi.getter
    def url(self) -> pulumi.Input[_builtins.str]:
        """
        The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
        """
        return pulumi.get(self, "url")

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

    @_builtins.property
    @pulumi.getter(name="authPassword")
    def auth_password(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Authentication password or token for the remote repository.
        """
        return pulumi.get(self, "auth_password")

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

    @_builtins.property
    @pulumi.getter(name="authUser")
    def auth_user(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Authentication username for the remote repository.
        """
        return pulumi.get(self, "auth_user")

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

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Enable or disable the pull mirror. Defaults to `true`.
        """
        return pulumi.get(self, "enabled")

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

    @_builtins.property
    @pulumi.getter(name="mirrorBranchRegex")
    def mirror_branch_regex(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
        """
        return pulumi.get(self, "mirror_branch_regex")

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

    @_builtins.property
    @pulumi.getter(name="mirrorOverwritesDivergedBranches")
    def mirror_overwrites_diverged_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Overwrite diverged branches on the target project.
        """
        return pulumi.get(self, "mirror_overwrites_diverged_branches")

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

    @_builtins.property
    @pulumi.getter(name="mirrorTriggerBuilds")
    def mirror_trigger_builds(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Trigger CI/CD pipelines when the mirror updates.
        """
        return pulumi.get(self, "mirror_trigger_builds")

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

    @_builtins.property
    @pulumi.getter(name="onlyMirrorProtectedBranches")
    def only_mirror_protected_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
        """
        return pulumi.get(self, "only_mirror_protected_branches")

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


@pulumi.input_type
class _ProjectPullMirrorState:
    def __init__(__self__, *,
                 auth_password: Optional[pulumi.Input[_builtins.str]] = None,
                 auth_user: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 last_error: Optional[pulumi.Input[_builtins.str]] = None,
                 last_successful_update_at: Optional[pulumi.Input[_builtins.str]] = None,
                 last_update_at: Optional[pulumi.Input[_builtins.str]] = None,
                 last_update_started_at: Optional[pulumi.Input[_builtins.str]] = None,
                 mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
                 mirror_id: Optional[pulumi.Input[_builtins.int]] = None,
                 mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
                 mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
                 only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
                 project: Optional[pulumi.Input[_builtins.str]] = None,
                 update_status: Optional[pulumi.Input[_builtins.str]] = None,
                 url: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering ProjectPullMirror resources.
        :param pulumi.Input[_builtins.str] auth_password: Authentication password or token for the remote repository.
        :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
        :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
        :param pulumi.Input[_builtins.str] last_error: Last error message from the mirror operation.
        :param pulumi.Input[_builtins.str] last_successful_update_at: Timestamp of the last successful mirror update.
        :param pulumi.Input[_builtins.str] last_update_at: Timestamp of the last mirror update attempt.
        :param pulumi.Input[_builtins.str] last_update_started_at: Timestamp when the last mirror update started.
        :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
        :param pulumi.Input[_builtins.int] mirror_id: The ID of the pull mirror. This ID is set by GitLab.
        :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
        :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
        :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
        :param pulumi.Input[_builtins.str] update_status: Current status of the mirror update.
        :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
        """
        if auth_password is not None:
            pulumi.set(__self__, "auth_password", auth_password)
        if auth_user is not None:
            pulumi.set(__self__, "auth_user", auth_user)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if last_error is not None:
            pulumi.set(__self__, "last_error", last_error)
        if last_successful_update_at is not None:
            pulumi.set(__self__, "last_successful_update_at", last_successful_update_at)
        if last_update_at is not None:
            pulumi.set(__self__, "last_update_at", last_update_at)
        if last_update_started_at is not None:
            pulumi.set(__self__, "last_update_started_at", last_update_started_at)
        if mirror_branch_regex is not None:
            pulumi.set(__self__, "mirror_branch_regex", mirror_branch_regex)
        if mirror_id is not None:
            pulumi.set(__self__, "mirror_id", mirror_id)
        if mirror_overwrites_diverged_branches is not None:
            pulumi.set(__self__, "mirror_overwrites_diverged_branches", mirror_overwrites_diverged_branches)
        if mirror_trigger_builds is not None:
            pulumi.set(__self__, "mirror_trigger_builds", mirror_trigger_builds)
        if only_mirror_protected_branches is not None:
            pulumi.set(__self__, "only_mirror_protected_branches", only_mirror_protected_branches)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if update_status is not None:
            pulumi.set(__self__, "update_status", update_status)
        if url is not None:
            pulumi.set(__self__, "url", url)

    @_builtins.property
    @pulumi.getter(name="authPassword")
    def auth_password(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Authentication password or token for the remote repository.
        """
        return pulumi.get(self, "auth_password")

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

    @_builtins.property
    @pulumi.getter(name="authUser")
    def auth_user(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Authentication username for the remote repository.
        """
        return pulumi.get(self, "auth_user")

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

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Enable or disable the pull mirror. Defaults to `true`.
        """
        return pulumi.get(self, "enabled")

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

    @_builtins.property
    @pulumi.getter(name="lastError")
    def last_error(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Last error message from the mirror operation.
        """
        return pulumi.get(self, "last_error")

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

    @_builtins.property
    @pulumi.getter(name="lastSuccessfulUpdateAt")
    def last_successful_update_at(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Timestamp of the last successful mirror update.
        """
        return pulumi.get(self, "last_successful_update_at")

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

    @_builtins.property
    @pulumi.getter(name="lastUpdateAt")
    def last_update_at(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Timestamp of the last mirror update attempt.
        """
        return pulumi.get(self, "last_update_at")

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

    @_builtins.property
    @pulumi.getter(name="lastUpdateStartedAt")
    def last_update_started_at(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Timestamp when the last mirror update started.
        """
        return pulumi.get(self, "last_update_started_at")

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

    @_builtins.property
    @pulumi.getter(name="mirrorBranchRegex")
    def mirror_branch_regex(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
        """
        return pulumi.get(self, "mirror_branch_regex")

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

    @_builtins.property
    @pulumi.getter(name="mirrorId")
    def mirror_id(self) -> Optional[pulumi.Input[_builtins.int]]:
        """
        The ID of the pull mirror. This ID is set by GitLab.
        """
        return pulumi.get(self, "mirror_id")

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

    @_builtins.property
    @pulumi.getter(name="mirrorOverwritesDivergedBranches")
    def mirror_overwrites_diverged_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Overwrite diverged branches on the target project.
        """
        return pulumi.get(self, "mirror_overwrites_diverged_branches")

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

    @_builtins.property
    @pulumi.getter(name="mirrorTriggerBuilds")
    def mirror_trigger_builds(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Trigger CI/CD pipelines when the mirror updates.
        """
        return pulumi.get(self, "mirror_trigger_builds")

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

    @_builtins.property
    @pulumi.getter(name="onlyMirrorProtectedBranches")
    def only_mirror_protected_branches(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
        """
        return pulumi.get(self, "only_mirror_protected_branches")

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

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

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

    @_builtins.property
    @pulumi.getter(name="updateStatus")
    def update_status(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        Current status of the mirror update.
        """
        return pulumi.get(self, "update_status")

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

    @_builtins.property
    @pulumi.getter
    def url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
        """
        return pulumi.get(self, "url")

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


@pulumi.type_token("gitlab:index/projectPullMirror:ProjectPullMirror")
class ProjectPullMirror(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 auth_password: Optional[pulumi.Input[_builtins.str]] = None,
                 auth_user: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
                 mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
                 mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
                 only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
                 project: Optional[pulumi.Input[_builtins.str]] = None,
                 url: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        The `ProjectPullMirror` resource allows managing pull mirroring for GitLab projects.

        This resource uses the dedicated pull mirror API endpoint which provides reliable configuration of pull mirroring after project creation.

        **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/project_pull_mirroring/#configure-pull-mirroring-for-a-project)

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        # Basic pull mirror from GitHub
        # Note: Unspecified options will use GitLab's defaults
        github = gitlab.ProjectPullMirror("github",
            project=example["id"],
            url="https://github.com/example/repo.git",
            auth_user="github-username",
            auth_password=github_token)
        # Pull mirror with explicit options
        # Only specify options you want to control; omit others to use GitLab defaults
        advanced = gitlab.ProjectPullMirror("advanced",
            project=example["id"],
            url="https://github.com/example/repo.git",
            enabled=True,
            auth_user="github-username",
            auth_password=github_token,
            mirror_trigger_builds=True,
            only_mirror_protected_branches=True,
            mirror_overwrites_diverged_branches=False)
        # Pull mirror with branch regex (Premium/Ultimate)
        regex = gitlab.ProjectPullMirror("regex",
            project=example["id"],
            url="https://github.com/example/repo.git",
            auth_user="github-username",
            auth_password=github_token,
            mirror_branch_regex="^(main|develop|release/.*)$")
        ```

        ## Import

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

        terraform

        import {

          to = gitlab_project_pull_mirror.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        Import using project ID

        ```sh
        $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example 123
        ```

        Import using project path

        Note: Import is not supported for disabled mirrors because the GitLab API returns

        http 400 for disabled mirrors.

        ```sh
        $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example "group/project"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.str] auth_password: Authentication password or token for the remote repository.
        :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
        :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
        :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
        :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
        :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
        :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
        :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ProjectPullMirrorArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `ProjectPullMirror` resource allows managing pull mirroring for GitLab projects.

        This resource uses the dedicated pull mirror API endpoint which provides reliable configuration of pull mirroring after project creation.

        **Upstream API**: [GitLab REST API docs](https://docs.gitlab.com/api/project_pull_mirroring/#configure-pull-mirroring-for-a-project)

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        # Basic pull mirror from GitHub
        # Note: Unspecified options will use GitLab's defaults
        github = gitlab.ProjectPullMirror("github",
            project=example["id"],
            url="https://github.com/example/repo.git",
            auth_user="github-username",
            auth_password=github_token)
        # Pull mirror with explicit options
        # Only specify options you want to control; omit others to use GitLab defaults
        advanced = gitlab.ProjectPullMirror("advanced",
            project=example["id"],
            url="https://github.com/example/repo.git",
            enabled=True,
            auth_user="github-username",
            auth_password=github_token,
            mirror_trigger_builds=True,
            only_mirror_protected_branches=True,
            mirror_overwrites_diverged_branches=False)
        # Pull mirror with branch regex (Premium/Ultimate)
        regex = gitlab.ProjectPullMirror("regex",
            project=example["id"],
            url="https://github.com/example/repo.git",
            auth_user="github-username",
            auth_password=github_token,
            mirror_branch_regex="^(main|develop|release/.*)$")
        ```

        ## Import

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

        terraform

        import {

          to = gitlab_project_pull_mirror.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        Import using project ID

        ```sh
        $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example 123
        ```

        Import using project path

        Note: Import is not supported for disabled mirrors because the GitLab API returns

        http 400 for disabled mirrors.

        ```sh
        $ pulumi import gitlab:index/projectPullMirror:ProjectPullMirror example "group/project"
        ```

        :param str resource_name: The name of the resource.
        :param ProjectPullMirrorArgs 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(ProjectPullMirrorArgs, 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,
                 auth_password: Optional[pulumi.Input[_builtins.str]] = None,
                 auth_user: Optional[pulumi.Input[_builtins.str]] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
                 mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
                 mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
                 only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
                 project: Optional[pulumi.Input[_builtins.str]] = None,
                 url: 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__ = ProjectPullMirrorArgs.__new__(ProjectPullMirrorArgs)

            __props__.__dict__["auth_password"] = None if auth_password is None else pulumi.Output.secret(auth_password)
            __props__.__dict__["auth_user"] = auth_user
            __props__.__dict__["enabled"] = enabled
            __props__.__dict__["mirror_branch_regex"] = mirror_branch_regex
            __props__.__dict__["mirror_overwrites_diverged_branches"] = mirror_overwrites_diverged_branches
            __props__.__dict__["mirror_trigger_builds"] = mirror_trigger_builds
            __props__.__dict__["only_mirror_protected_branches"] = only_mirror_protected_branches
            if project is None and not opts.urn:
                raise TypeError("Missing required property 'project'")
            __props__.__dict__["project"] = project
            if url is None and not opts.urn:
                raise TypeError("Missing required property 'url'")
            __props__.__dict__["url"] = None if url is None else pulumi.Output.secret(url)
            __props__.__dict__["last_error"] = None
            __props__.__dict__["last_successful_update_at"] = None
            __props__.__dict__["last_update_at"] = None
            __props__.__dict__["last_update_started_at"] = None
            __props__.__dict__["mirror_id"] = None
            __props__.__dict__["update_status"] = None
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["authPassword", "url"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(ProjectPullMirror, __self__).__init__(
            'gitlab:index/projectPullMirror:ProjectPullMirror',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            auth_password: Optional[pulumi.Input[_builtins.str]] = None,
            auth_user: Optional[pulumi.Input[_builtins.str]] = None,
            enabled: Optional[pulumi.Input[_builtins.bool]] = None,
            last_error: Optional[pulumi.Input[_builtins.str]] = None,
            last_successful_update_at: Optional[pulumi.Input[_builtins.str]] = None,
            last_update_at: Optional[pulumi.Input[_builtins.str]] = None,
            last_update_started_at: Optional[pulumi.Input[_builtins.str]] = None,
            mirror_branch_regex: Optional[pulumi.Input[_builtins.str]] = None,
            mirror_id: Optional[pulumi.Input[_builtins.int]] = None,
            mirror_overwrites_diverged_branches: Optional[pulumi.Input[_builtins.bool]] = None,
            mirror_trigger_builds: Optional[pulumi.Input[_builtins.bool]] = None,
            only_mirror_protected_branches: Optional[pulumi.Input[_builtins.bool]] = None,
            project: Optional[pulumi.Input[_builtins.str]] = None,
            update_status: Optional[pulumi.Input[_builtins.str]] = None,
            url: Optional[pulumi.Input[_builtins.str]] = None) -> 'ProjectPullMirror':
        """
        Get an existing ProjectPullMirror 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] auth_password: Authentication password or token for the remote repository.
        :param pulumi.Input[_builtins.str] auth_user: Authentication username for the remote repository.
        :param pulumi.Input[_builtins.bool] enabled: Enable or disable the pull mirror. Defaults to `true`.
        :param pulumi.Input[_builtins.str] last_error: Last error message from the mirror operation.
        :param pulumi.Input[_builtins.str] last_successful_update_at: Timestamp of the last successful mirror update.
        :param pulumi.Input[_builtins.str] last_update_at: Timestamp of the last mirror update attempt.
        :param pulumi.Input[_builtins.str] last_update_started_at: Timestamp when the last mirror update started.
        :param pulumi.Input[_builtins.str] mirror_branch_regex: Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
        :param pulumi.Input[_builtins.int] mirror_id: The ID of the pull mirror. This ID is set by GitLab.
        :param pulumi.Input[_builtins.bool] mirror_overwrites_diverged_branches: Overwrite diverged branches on the target project.
        :param pulumi.Input[_builtins.bool] mirror_trigger_builds: Trigger CI/CD pipelines when the mirror updates.
        :param pulumi.Input[_builtins.bool] only_mirror_protected_branches: Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project owned by the authenticated user.
        :param pulumi.Input[_builtins.str] update_status: Current status of the mirror update.
        :param pulumi.Input[_builtins.str] url: The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ProjectPullMirrorState.__new__(_ProjectPullMirrorState)

        __props__.__dict__["auth_password"] = auth_password
        __props__.__dict__["auth_user"] = auth_user
        __props__.__dict__["enabled"] = enabled
        __props__.__dict__["last_error"] = last_error
        __props__.__dict__["last_successful_update_at"] = last_successful_update_at
        __props__.__dict__["last_update_at"] = last_update_at
        __props__.__dict__["last_update_started_at"] = last_update_started_at
        __props__.__dict__["mirror_branch_regex"] = mirror_branch_regex
        __props__.__dict__["mirror_id"] = mirror_id
        __props__.__dict__["mirror_overwrites_diverged_branches"] = mirror_overwrites_diverged_branches
        __props__.__dict__["mirror_trigger_builds"] = mirror_trigger_builds
        __props__.__dict__["only_mirror_protected_branches"] = only_mirror_protected_branches
        __props__.__dict__["project"] = project
        __props__.__dict__["update_status"] = update_status
        __props__.__dict__["url"] = url
        return ProjectPullMirror(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter(name="authPassword")
    def auth_password(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Authentication password or token for the remote repository.
        """
        return pulumi.get(self, "auth_password")

    @_builtins.property
    @pulumi.getter(name="authUser")
    def auth_user(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        Authentication username for the remote repository.
        """
        return pulumi.get(self, "auth_user")

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[_builtins.bool]:
        """
        Enable or disable the pull mirror. Defaults to `true`.
        """
        return pulumi.get(self, "enabled")

    @_builtins.property
    @pulumi.getter(name="lastError")
    def last_error(self) -> pulumi.Output[_builtins.str]:
        """
        Last error message from the mirror operation.
        """
        return pulumi.get(self, "last_error")

    @_builtins.property
    @pulumi.getter(name="lastSuccessfulUpdateAt")
    def last_successful_update_at(self) -> pulumi.Output[_builtins.str]:
        """
        Timestamp of the last successful mirror update.
        """
        return pulumi.get(self, "last_successful_update_at")

    @_builtins.property
    @pulumi.getter(name="lastUpdateAt")
    def last_update_at(self) -> pulumi.Output[_builtins.str]:
        """
        Timestamp of the last mirror update attempt.
        """
        return pulumi.get(self, "last_update_at")

    @_builtins.property
    @pulumi.getter(name="lastUpdateStartedAt")
    def last_update_started_at(self) -> pulumi.Output[_builtins.str]:
        """
        Timestamp when the last mirror update started.
        """
        return pulumi.get(self, "last_update_started_at")

    @_builtins.property
    @pulumi.getter(name="mirrorBranchRegex")
    def mirror_branch_regex(self) -> pulumi.Output[_builtins.str]:
        """
        Regular expression for branches to mirror. Requires GitLab Premium or Ultimate. Cannot be used with `only_mirror_protected_branches`.
        """
        return pulumi.get(self, "mirror_branch_regex")

    @_builtins.property
    @pulumi.getter(name="mirrorId")
    def mirror_id(self) -> pulumi.Output[_builtins.int]:
        """
        The ID of the pull mirror. This ID is set by GitLab.
        """
        return pulumi.get(self, "mirror_id")

    @_builtins.property
    @pulumi.getter(name="mirrorOverwritesDivergedBranches")
    def mirror_overwrites_diverged_branches(self) -> pulumi.Output[_builtins.bool]:
        """
        Overwrite diverged branches on the target project.
        """
        return pulumi.get(self, "mirror_overwrites_diverged_branches")

    @_builtins.property
    @pulumi.getter(name="mirrorTriggerBuilds")
    def mirror_trigger_builds(self) -> pulumi.Output[_builtins.bool]:
        """
        Trigger CI/CD pipelines when the mirror updates.
        """
        return pulumi.get(self, "mirror_trigger_builds")

    @_builtins.property
    @pulumi.getter(name="onlyMirrorProtectedBranches")
    def only_mirror_protected_branches(self) -> pulumi.Output[_builtins.bool]:
        """
        Mirror only protected branches. Cannot be used with `mirror_branch_regex`.
        """
        return pulumi.get(self, "only_mirror_protected_branches")

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

    @_builtins.property
    @pulumi.getter(name="updateStatus")
    def update_status(self) -> pulumi.Output[_builtins.str]:
        """
        Current status of the mirror update.
        """
        return pulumi.get(self, "update_status")

    @_builtins.property
    @pulumi.getter
    def url(self) -> pulumi.Output[_builtins.str]:
        """
        The URL of the remote repository to mirror from. While the API call allows including username and password as basic authentication in the URL, this resourcedoes not for security and idempotency reasons. Use `auth_user` and `auth_password` instead.
        """
        return pulumi.get(self, "url")

