# 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__ = ['ProjectPackageDependencyProxyArgs', 'ProjectPackageDependencyProxy']

@pulumi.input_type
class ProjectPackageDependencyProxyArgs:
    def __init__(__self__, *,
                 project: pulumi.Input[_builtins.str],
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 maven_external_registry_password: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_url: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_username: Optional[pulumi.Input[_builtins.str]] = None):
        """
        The set of arguments for constructing a ProjectPackageDependencyProxy resource.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project.
        :param pulumi.Input[_builtins.bool] enabled: Indicates whether the dependency proxy is enabled for packages.
        :param pulumi.Input[_builtins.str] maven_external_registry_password: The password to authenticate with the external Maven registry. Must be set together with `maven_external_registry_username`. Cannot be imported.
        :param pulumi.Input[_builtins.str] maven_external_registry_url: The URL of the external Maven registry.
        :param pulumi.Input[_builtins.str] maven_external_registry_username: The username to authenticate with the external Maven registry. Must be set together with `maven_external_registry_password`.
        """
        pulumi.set(__self__, "project", project)
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if maven_external_registry_password is not None:
            pulumi.set(__self__, "maven_external_registry_password", maven_external_registry_password)
        if maven_external_registry_url is not None:
            pulumi.set(__self__, "maven_external_registry_url", maven_external_registry_url)
        if maven_external_registry_username is not None:
            pulumi.set(__self__, "maven_external_registry_username", maven_external_registry_username)

    @_builtins.property
    @pulumi.getter
    def project(self) -> pulumi.Input[_builtins.str]:
        """
        The ID or URL-encoded path of the project.
        """
        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 enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Indicates whether the dependency proxy is enabled for packages.
        """
        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="mavenExternalRegistryPassword")
    def maven_external_registry_password(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The password to authenticate with the external Maven registry. Must be set together with `maven_external_registry_username`. Cannot be imported.
        """
        return pulumi.get(self, "maven_external_registry_password")

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

    @_builtins.property
    @pulumi.getter(name="mavenExternalRegistryUrl")
    def maven_external_registry_url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The URL of the external Maven registry.
        """
        return pulumi.get(self, "maven_external_registry_url")

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

    @_builtins.property
    @pulumi.getter(name="mavenExternalRegistryUsername")
    def maven_external_registry_username(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The username to authenticate with the external Maven registry. Must be set together with `maven_external_registry_password`.
        """
        return pulumi.get(self, "maven_external_registry_username")

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


@pulumi.input_type
class _ProjectPackageDependencyProxyState:
    def __init__(__self__, *,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 maven_external_registry_password: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_url: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_username: Optional[pulumi.Input[_builtins.str]] = None,
                 project: Optional[pulumi.Input[_builtins.str]] = None):
        """
        Input properties used for looking up and filtering ProjectPackageDependencyProxy resources.
        :param pulumi.Input[_builtins.bool] enabled: Indicates whether the dependency proxy is enabled for packages.
        :param pulumi.Input[_builtins.str] maven_external_registry_password: The password to authenticate with the external Maven registry. Must be set together with `maven_external_registry_username`. Cannot be imported.
        :param pulumi.Input[_builtins.str] maven_external_registry_url: The URL of the external Maven registry.
        :param pulumi.Input[_builtins.str] maven_external_registry_username: The username to authenticate with the external Maven registry. Must be set together with `maven_external_registry_password`.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project.
        """
        if enabled is not None:
            pulumi.set(__self__, "enabled", enabled)
        if maven_external_registry_password is not None:
            pulumi.set(__self__, "maven_external_registry_password", maven_external_registry_password)
        if maven_external_registry_url is not None:
            pulumi.set(__self__, "maven_external_registry_url", maven_external_registry_url)
        if maven_external_registry_username is not None:
            pulumi.set(__self__, "maven_external_registry_username", maven_external_registry_username)
        if project is not None:
            pulumi.set(__self__, "project", project)

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> Optional[pulumi.Input[_builtins.bool]]:
        """
        Indicates whether the dependency proxy is enabled for packages.
        """
        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="mavenExternalRegistryPassword")
    def maven_external_registry_password(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The password to authenticate with the external Maven registry. Must be set together with `maven_external_registry_username`. Cannot be imported.
        """
        return pulumi.get(self, "maven_external_registry_password")

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

    @_builtins.property
    @pulumi.getter(name="mavenExternalRegistryUrl")
    def maven_external_registry_url(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The URL of the external Maven registry.
        """
        return pulumi.get(self, "maven_external_registry_url")

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

    @_builtins.property
    @pulumi.getter(name="mavenExternalRegistryUsername")
    def maven_external_registry_username(self) -> Optional[pulumi.Input[_builtins.str]]:
        """
        The username to authenticate with the external Maven registry. Must be set together with `maven_external_registry_password`.
        """
        return pulumi.get(self, "maven_external_registry_username")

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

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

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


@pulumi.type_token("gitlab:index/projectPackageDependencyProxy:ProjectPackageDependencyProxy")
class ProjectPackageDependencyProxy(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 maven_external_registry_password: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_url: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_username: Optional[pulumi.Input[_builtins.str]] = None,
                 project: Optional[pulumi.Input[_builtins.str]] = None,
                 __props__=None):
        """
        The `ProjectPackageDependencyProxy` resource allows managing the project-level package dependency proxy for Maven packages.

        This resource configures the external Maven registry settings for the dependency proxy, allowing packages to be cached and proxied through GitLab.

        > This resource requires GitLab Premium or Ultimate and the packages and dependency proxy features to be enabled on the GitLab instance.

        **Upstream API**: [GitLab GraphQL API docs](https://docs.gitlab.com/api/graphql/reference/#mutationupdatedependencyproxypackagessettings)

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        # Configure the project package dependency proxy for Maven packages
        example = gitlab.ProjectPackageDependencyProxy("example",
            project=example_gitlab_project["id"],
            enabled=True,
            maven_external_registry_url="https://repo.maven.apache.org/maven2/")
        # With authentication credentials for the external registry
        authenticated = gitlab.ProjectPackageDependencyProxy("authenticated",
            project=example_gitlab_project["id"],
            enabled=True,
            maven_external_registry_url="https://private-repo.example.com/maven/",
            maven_external_registry_username="maven_user",
            maven_external_registry_password=maven_registry_password)
        ```

        ## Import

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

        terraform

        import {

          to = gitlab_project_package_dependency_proxy.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        You can import a project package dependency proxy using the project id. e.g. `{project-id}`

        "maven_external_registry_password" will not populate when importing, but will still

        be required in the configuration if credentials are used.

        ```sh
        $ pulumi import gitlab:index/projectPackageDependencyProxy:ProjectPackageDependencyProxy example 42
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[_builtins.bool] enabled: Indicates whether the dependency proxy is enabled for packages.
        :param pulumi.Input[_builtins.str] maven_external_registry_password: The password to authenticate with the external Maven registry. Must be set together with `maven_external_registry_username`. Cannot be imported.
        :param pulumi.Input[_builtins.str] maven_external_registry_url: The URL of the external Maven registry.
        :param pulumi.Input[_builtins.str] maven_external_registry_username: The username to authenticate with the external Maven registry. Must be set together with `maven_external_registry_password`.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: ProjectPackageDependencyProxyArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        The `ProjectPackageDependencyProxy` resource allows managing the project-level package dependency proxy for Maven packages.

        This resource configures the external Maven registry settings for the dependency proxy, allowing packages to be cached and proxied through GitLab.

        > This resource requires GitLab Premium or Ultimate and the packages and dependency proxy features to be enabled on the GitLab instance.

        **Upstream API**: [GitLab GraphQL API docs](https://docs.gitlab.com/api/graphql/reference/#mutationupdatedependencyproxypackagessettings)

        ## Example Usage

        ```python
        import pulumi
        import pulumi_gitlab as gitlab

        # Configure the project package dependency proxy for Maven packages
        example = gitlab.ProjectPackageDependencyProxy("example",
            project=example_gitlab_project["id"],
            enabled=True,
            maven_external_registry_url="https://repo.maven.apache.org/maven2/")
        # With authentication credentials for the external registry
        authenticated = gitlab.ProjectPackageDependencyProxy("authenticated",
            project=example_gitlab_project["id"],
            enabled=True,
            maven_external_registry_url="https://private-repo.example.com/maven/",
            maven_external_registry_username="maven_user",
            maven_external_registry_password=maven_registry_password)
        ```

        ## Import

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

        terraform

        import {

          to = gitlab_project_package_dependency_proxy.example

          id = "see CLI command below for ID"

        }

        Importing using the CLI is supported with the following syntax:

        You can import a project package dependency proxy using the project id. e.g. `{project-id}`

        "maven_external_registry_password" will not populate when importing, but will still

        be required in the configuration if credentials are used.

        ```sh
        $ pulumi import gitlab:index/projectPackageDependencyProxy:ProjectPackageDependencyProxy example 42
        ```

        :param str resource_name: The name of the resource.
        :param ProjectPackageDependencyProxyArgs 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(ProjectPackageDependencyProxyArgs, 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,
                 enabled: Optional[pulumi.Input[_builtins.bool]] = None,
                 maven_external_registry_password: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_url: Optional[pulumi.Input[_builtins.str]] = None,
                 maven_external_registry_username: Optional[pulumi.Input[_builtins.str]] = None,
                 project: 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__ = ProjectPackageDependencyProxyArgs.__new__(ProjectPackageDependencyProxyArgs)

            __props__.__dict__["enabled"] = enabled
            __props__.__dict__["maven_external_registry_password"] = None if maven_external_registry_password is None else pulumi.Output.secret(maven_external_registry_password)
            __props__.__dict__["maven_external_registry_url"] = maven_external_registry_url
            __props__.__dict__["maven_external_registry_username"] = maven_external_registry_username
            if project is None and not opts.urn:
                raise TypeError("Missing required property 'project'")
            __props__.__dict__["project"] = project
        secret_opts = pulumi.ResourceOptions(additional_secret_outputs=["mavenExternalRegistryPassword"])
        opts = pulumi.ResourceOptions.merge(opts, secret_opts)
        super(ProjectPackageDependencyProxy, __self__).__init__(
            'gitlab:index/projectPackageDependencyProxy:ProjectPackageDependencyProxy',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            enabled: Optional[pulumi.Input[_builtins.bool]] = None,
            maven_external_registry_password: Optional[pulumi.Input[_builtins.str]] = None,
            maven_external_registry_url: Optional[pulumi.Input[_builtins.str]] = None,
            maven_external_registry_username: Optional[pulumi.Input[_builtins.str]] = None,
            project: Optional[pulumi.Input[_builtins.str]] = None) -> 'ProjectPackageDependencyProxy':
        """
        Get an existing ProjectPackageDependencyProxy 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] enabled: Indicates whether the dependency proxy is enabled for packages.
        :param pulumi.Input[_builtins.str] maven_external_registry_password: The password to authenticate with the external Maven registry. Must be set together with `maven_external_registry_username`. Cannot be imported.
        :param pulumi.Input[_builtins.str] maven_external_registry_url: The URL of the external Maven registry.
        :param pulumi.Input[_builtins.str] maven_external_registry_username: The username to authenticate with the external Maven registry. Must be set together with `maven_external_registry_password`.
        :param pulumi.Input[_builtins.str] project: The ID or URL-encoded path of the project.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _ProjectPackageDependencyProxyState.__new__(_ProjectPackageDependencyProxyState)

        __props__.__dict__["enabled"] = enabled
        __props__.__dict__["maven_external_registry_password"] = maven_external_registry_password
        __props__.__dict__["maven_external_registry_url"] = maven_external_registry_url
        __props__.__dict__["maven_external_registry_username"] = maven_external_registry_username
        __props__.__dict__["project"] = project
        return ProjectPackageDependencyProxy(resource_name, opts=opts, __props__=__props__)

    @_builtins.property
    @pulumi.getter
    def enabled(self) -> pulumi.Output[_builtins.bool]:
        """
        Indicates whether the dependency proxy is enabled for packages.
        """
        return pulumi.get(self, "enabled")

    @_builtins.property
    @pulumi.getter(name="mavenExternalRegistryPassword")
    def maven_external_registry_password(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The password to authenticate with the external Maven registry. Must be set together with `maven_external_registry_username`. Cannot be imported.
        """
        return pulumi.get(self, "maven_external_registry_password")

    @_builtins.property
    @pulumi.getter(name="mavenExternalRegistryUrl")
    def maven_external_registry_url(self) -> pulumi.Output[_builtins.str]:
        """
        The URL of the external Maven registry.
        """
        return pulumi.get(self, "maven_external_registry_url")

    @_builtins.property
    @pulumi.getter(name="mavenExternalRegistryUsername")
    def maven_external_registry_username(self) -> pulumi.Output[Optional[_builtins.str]]:
        """
        The username to authenticate with the external Maven registry. Must be set together with `maven_external_registry_password`.
        """
        return pulumi.get(self, "maven_external_registry_username")

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

