# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import builtins
import copy
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
from . import outputs
from ._inputs import *

__all__ = ['RegistryArgs', 'Registry']

@pulumi.input_type
class RegistryArgs:
    def __init__(__self__, *,
                 name: pulumi.Input[builtins.str],
                 project: Optional[pulumi.Input[builtins.str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryTagArgs']]]] = None,
                 type: Optional[pulumi.Input[builtins.str]] = None):
        """
        The set of arguments for constructing a Registry resource.
        :param pulumi.Input[builtins.str] name: 标准版实例名称，同一个地域下，名称必须唯一。支持小写英文字母、数字、短划线（-）且数字不能在首位，短划线（-）不能在首位或末位，长度限制为 3～30 个字符。
        :param pulumi.Input[builtins.str] project: 填写实例需要关联的项目。一个实例仅支持关联一个项目
        :param pulumi.Input[builtins.str] type: 不填写默认创建标准版实例。Enterprise：标准版，Micro：小微版
        """
        pulumi.set(__self__, "name", name)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if type is not None:
            pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter
    def name(self) -> pulumi.Input[builtins.str]:
        """
        标准版实例名称，同一个地域下，名称必须唯一。支持小写英文字母、数字、短划线（-）且数字不能在首位，短划线（-）不能在首位或末位，长度限制为 3～30 个字符。
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        填写实例需要关联的项目。一个实例仅支持关联一个项目
        """
        return pulumi.get(self, "project")

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

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['RegistryTagArgs']]]]:
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryTagArgs']]]]):
        pulumi.set(self, "tags", value)

    @property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        不填写默认创建标准版实例。Enterprise：标准版，Micro：小微版
        """
        return pulumi.get(self, "type")

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


@pulumi.input_type
class _RegistryState:
    def __init__(__self__, *,
                 charge_type: Optional[pulumi.Input[builtins.str]] = None,
                 created_time: Optional[pulumi.Input[builtins.str]] = None,
                 expire_time: Optional[pulumi.Input[builtins.str]] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 project: Optional[pulumi.Input[builtins.str]] = None,
                 proxy_cache: Optional[pulumi.Input['RegistryProxyCacheArgs']] = None,
                 proxy_cache_enabled: Optional[pulumi.Input[builtins.bool]] = None,
                 renew_type: Optional[pulumi.Input[builtins.str]] = None,
                 status: Optional[pulumi.Input['RegistryStatusArgs']] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryTagArgs']]]] = None,
                 type: Optional[pulumi.Input[builtins.str]] = None):
        """
        Input properties used for looking up and filtering Registry resources.
        :param pulumi.Input[builtins.str] charge_type: 镜像仓库实例的付费类型，目前仅支持 PostCharge按量付费模式。
        :param pulumi.Input[builtins.str] created_time: 创建镜像仓库实例的时间。
        :param pulumi.Input[builtins.str] expire_time: 仅计费类型为HybridCharge有值，实例到期时间
        :param pulumi.Input[builtins.str] name: 标准版实例名称，同一个地域下，名称必须唯一。支持小写英文字母、数字、短划线（-）且数字不能在首位，短划线（-）不能在首位或末位，长度限制为 3～30 个字符。
        :param pulumi.Input[builtins.str] project: 填写实例需要关联的项目。一个实例仅支持关联一个项目
        :param pulumi.Input['RegistryProxyCacheArgs'] proxy_cache: ProxyCache配置，设置为ProxyCache时必填
        :param pulumi.Input[builtins.bool] proxy_cache_enabled: 是否设置为ProxyCache实例
        :param pulumi.Input[builtins.str] renew_type: 仅计费类型为HybridCharge有值，实例自动续费类型
        :param pulumi.Input['RegistryStatusArgs'] status: 镜像仓库实例状态，由 Phase 和 Conditions 组成。合法的 Phase 和 Conditions 组合如下所示：{Creating, [Progressing]}：创建中,{Running, [Ok]}：运行中,{Running, [Degraded]}：运行中,{Stopped, [Balance]}：欠费关停,{Stopped, [Released]}：待回收,{Stopped, [Released, Balance]}：欠费关停,{Starting, [Progressing]}：启动中,{Deleting, [Progressing]}：销毁中,{Failed, [Unknown]}：异常
        :param pulumi.Input[builtins.str] type: 不填写默认创建标准版实例。Enterprise：标准版，Micro：小微版
        """
        if charge_type is not None:
            pulumi.set(__self__, "charge_type", charge_type)
        if created_time is not None:
            pulumi.set(__self__, "created_time", created_time)
        if expire_time is not None:
            pulumi.set(__self__, "expire_time", expire_time)
        if name is not None:
            pulumi.set(__self__, "name", name)
        if project is not None:
            pulumi.set(__self__, "project", project)
        if proxy_cache is not None:
            pulumi.set(__self__, "proxy_cache", proxy_cache)
        if proxy_cache_enabled is not None:
            pulumi.set(__self__, "proxy_cache_enabled", proxy_cache_enabled)
        if renew_type is not None:
            pulumi.set(__self__, "renew_type", renew_type)
        if status is not None:
            pulumi.set(__self__, "status", status)
        if tags is not None:
            pulumi.set(__self__, "tags", tags)
        if type is not None:
            pulumi.set(__self__, "type", type)

    @property
    @pulumi.getter(name="chargeType")
    def charge_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        镜像仓库实例的付费类型，目前仅支持 PostCharge按量付费模式。
        """
        return pulumi.get(self, "charge_type")

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

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        创建镜像仓库实例的时间。
        """
        return pulumi.get(self, "created_time")

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

    @property
    @pulumi.getter(name="expireTime")
    def expire_time(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        仅计费类型为HybridCharge有值，实例到期时间
        """
        return pulumi.get(self, "expire_time")

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

    @property
    @pulumi.getter
    def name(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        标准版实例名称，同一个地域下，名称必须唯一。支持小写英文字母、数字、短划线（-）且数字不能在首位，短划线（-）不能在首位或末位，长度限制为 3～30 个字符。
        """
        return pulumi.get(self, "name")

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

    @property
    @pulumi.getter
    def project(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        填写实例需要关联的项目。一个实例仅支持关联一个项目
        """
        return pulumi.get(self, "project")

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

    @property
    @pulumi.getter(name="proxyCache")
    def proxy_cache(self) -> Optional[pulumi.Input['RegistryProxyCacheArgs']]:
        """
        ProxyCache配置，设置为ProxyCache时必填
        """
        return pulumi.get(self, "proxy_cache")

    @proxy_cache.setter
    def proxy_cache(self, value: Optional[pulumi.Input['RegistryProxyCacheArgs']]):
        pulumi.set(self, "proxy_cache", value)

    @property
    @pulumi.getter(name="proxyCacheEnabled")
    def proxy_cache_enabled(self) -> Optional[pulumi.Input[builtins.bool]]:
        """
        是否设置为ProxyCache实例
        """
        return pulumi.get(self, "proxy_cache_enabled")

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

    @property
    @pulumi.getter(name="renewType")
    def renew_type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        仅计费类型为HybridCharge有值，实例自动续费类型
        """
        return pulumi.get(self, "renew_type")

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

    @property
    @pulumi.getter
    def status(self) -> Optional[pulumi.Input['RegistryStatusArgs']]:
        """
        镜像仓库实例状态，由 Phase 和 Conditions 组成。合法的 Phase 和 Conditions 组合如下所示：{Creating, [Progressing]}：创建中,{Running, [Ok]}：运行中,{Running, [Degraded]}：运行中,{Stopped, [Balance]}：欠费关停,{Stopped, [Released]}：待回收,{Stopped, [Released, Balance]}：欠费关停,{Starting, [Progressing]}：启动中,{Deleting, [Progressing]}：销毁中,{Failed, [Unknown]}：异常
        """
        return pulumi.get(self, "status")

    @status.setter
    def status(self, value: Optional[pulumi.Input['RegistryStatusArgs']]):
        pulumi.set(self, "status", value)

    @property
    @pulumi.getter
    def tags(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['RegistryTagArgs']]]]:
        return pulumi.get(self, "tags")

    @tags.setter
    def tags(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['RegistryTagArgs']]]]):
        pulumi.set(self, "tags", value)

    @property
    @pulumi.getter
    def type(self) -> Optional[pulumi.Input[builtins.str]]:
        """
        不填写默认创建标准版实例。Enterprise：标准版，Micro：小微版
        """
        return pulumi.get(self, "type")

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


@pulumi.type_token("bytepluscc:cr/registry:Registry")
class Registry(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 project: Optional[pulumi.Input[builtins.str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RegistryTagArgs', 'RegistryTagArgsDict']]]]] = None,
                 type: Optional[pulumi.Input[builtins.str]] = None,
                 __props__=None):
        """
        镜像仓库（Container Registry，CR）提供安全高可用的容器镜像、Helm Chart 等符合 OCI 标准的云原生制品托管服务，方便企业用户管理容器镜像和 Helm Chart 的全生命周期。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        c_r_registry_demo = bytepluscc.cr.Registry("CRRegistryDemo",
            project="default",
            name="test",
            type="Enterprise",
            tags=[{
                "key": "env",
                "value": "test",
            }])
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:cr/registry:Registry example "name"
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[builtins.str] name: 标准版实例名称，同一个地域下，名称必须唯一。支持小写英文字母、数字、短划线（-）且数字不能在首位，短划线（-）不能在首位或末位，长度限制为 3～30 个字符。
        :param pulumi.Input[builtins.str] project: 填写实例需要关联的项目。一个实例仅支持关联一个项目
        :param pulumi.Input[builtins.str] type: 不填写默认创建标准版实例。Enterprise：标准版，Micro：小微版
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: RegistryArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        镜像仓库（Container Registry，CR）提供安全高可用的容器镜像、Helm Chart 等符合 OCI 标准的云原生制品托管服务，方便企业用户管理容器镜像和 Helm Chart 的全生命周期。

        ## Example Usage

        ```python
        import pulumi
        import pulumi_bytepluscc as bytepluscc

        c_r_registry_demo = bytepluscc.cr.Registry("CRRegistryDemo",
            project="default",
            name="test",
            type="Enterprise",
            tags=[{
                "key": "env",
                "value": "test",
            }])
        ```

        ## Import

        ```sh
        $ pulumi import bytepluscc:cr/registry:Registry example "name"
        ```

        :param str resource_name: The name of the resource.
        :param RegistryArgs 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(RegistryArgs, 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,
                 name: Optional[pulumi.Input[builtins.str]] = None,
                 project: Optional[pulumi.Input[builtins.str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RegistryTagArgs', 'RegistryTagArgsDict']]]]] = None,
                 type: 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__ = RegistryArgs.__new__(RegistryArgs)

            if name is None and not opts.urn:
                raise TypeError("Missing required property 'name'")
            __props__.__dict__["name"] = name
            __props__.__dict__["project"] = project
            __props__.__dict__["tags"] = tags
            __props__.__dict__["type"] = type
            __props__.__dict__["charge_type"] = None
            __props__.__dict__["created_time"] = None
            __props__.__dict__["expire_time"] = None
            __props__.__dict__["proxy_cache"] = None
            __props__.__dict__["proxy_cache_enabled"] = None
            __props__.__dict__["renew_type"] = None
            __props__.__dict__["status"] = None
        super(Registry, __self__).__init__(
            'bytepluscc:cr/registry:Registry',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            charge_type: Optional[pulumi.Input[builtins.str]] = None,
            created_time: Optional[pulumi.Input[builtins.str]] = None,
            expire_time: Optional[pulumi.Input[builtins.str]] = None,
            name: Optional[pulumi.Input[builtins.str]] = None,
            project: Optional[pulumi.Input[builtins.str]] = None,
            proxy_cache: Optional[pulumi.Input[Union['RegistryProxyCacheArgs', 'RegistryProxyCacheArgsDict']]] = None,
            proxy_cache_enabled: Optional[pulumi.Input[builtins.bool]] = None,
            renew_type: Optional[pulumi.Input[builtins.str]] = None,
            status: Optional[pulumi.Input[Union['RegistryStatusArgs', 'RegistryStatusArgsDict']]] = None,
            tags: Optional[pulumi.Input[Sequence[pulumi.Input[Union['RegistryTagArgs', 'RegistryTagArgsDict']]]]] = None,
            type: Optional[pulumi.Input[builtins.str]] = None) -> 'Registry':
        """
        Get an existing Registry 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] charge_type: 镜像仓库实例的付费类型，目前仅支持 PostCharge按量付费模式。
        :param pulumi.Input[builtins.str] created_time: 创建镜像仓库实例的时间。
        :param pulumi.Input[builtins.str] expire_time: 仅计费类型为HybridCharge有值，实例到期时间
        :param pulumi.Input[builtins.str] name: 标准版实例名称，同一个地域下，名称必须唯一。支持小写英文字母、数字、短划线（-）且数字不能在首位，短划线（-）不能在首位或末位，长度限制为 3～30 个字符。
        :param pulumi.Input[builtins.str] project: 填写实例需要关联的项目。一个实例仅支持关联一个项目
        :param pulumi.Input[Union['RegistryProxyCacheArgs', 'RegistryProxyCacheArgsDict']] proxy_cache: ProxyCache配置，设置为ProxyCache时必填
        :param pulumi.Input[builtins.bool] proxy_cache_enabled: 是否设置为ProxyCache实例
        :param pulumi.Input[builtins.str] renew_type: 仅计费类型为HybridCharge有值，实例自动续费类型
        :param pulumi.Input[Union['RegistryStatusArgs', 'RegistryStatusArgsDict']] status: 镜像仓库实例状态，由 Phase 和 Conditions 组成。合法的 Phase 和 Conditions 组合如下所示：{Creating, [Progressing]}：创建中,{Running, [Ok]}：运行中,{Running, [Degraded]}：运行中,{Stopped, [Balance]}：欠费关停,{Stopped, [Released]}：待回收,{Stopped, [Released, Balance]}：欠费关停,{Starting, [Progressing]}：启动中,{Deleting, [Progressing]}：销毁中,{Failed, [Unknown]}：异常
        :param pulumi.Input[builtins.str] type: 不填写默认创建标准版实例。Enterprise：标准版，Micro：小微版
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _RegistryState.__new__(_RegistryState)

        __props__.__dict__["charge_type"] = charge_type
        __props__.__dict__["created_time"] = created_time
        __props__.__dict__["expire_time"] = expire_time
        __props__.__dict__["name"] = name
        __props__.__dict__["project"] = project
        __props__.__dict__["proxy_cache"] = proxy_cache
        __props__.__dict__["proxy_cache_enabled"] = proxy_cache_enabled
        __props__.__dict__["renew_type"] = renew_type
        __props__.__dict__["status"] = status
        __props__.__dict__["tags"] = tags
        __props__.__dict__["type"] = type
        return Registry(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="chargeType")
    def charge_type(self) -> pulumi.Output[builtins.str]:
        """
        镜像仓库实例的付费类型，目前仅支持 PostCharge按量付费模式。
        """
        return pulumi.get(self, "charge_type")

    @property
    @pulumi.getter(name="createdTime")
    def created_time(self) -> pulumi.Output[builtins.str]:
        """
        创建镜像仓库实例的时间。
        """
        return pulumi.get(self, "created_time")

    @property
    @pulumi.getter(name="expireTime")
    def expire_time(self) -> pulumi.Output[builtins.str]:
        """
        仅计费类型为HybridCharge有值，实例到期时间
        """
        return pulumi.get(self, "expire_time")

    @property
    @pulumi.getter
    def name(self) -> pulumi.Output[builtins.str]:
        """
        标准版实例名称，同一个地域下，名称必须唯一。支持小写英文字母、数字、短划线（-）且数字不能在首位，短划线（-）不能在首位或末位，长度限制为 3～30 个字符。
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def project(self) -> pulumi.Output[builtins.str]:
        """
        填写实例需要关联的项目。一个实例仅支持关联一个项目
        """
        return pulumi.get(self, "project")

    @property
    @pulumi.getter(name="proxyCache")
    def proxy_cache(self) -> pulumi.Output['outputs.RegistryProxyCache']:
        """
        ProxyCache配置，设置为ProxyCache时必填
        """
        return pulumi.get(self, "proxy_cache")

    @property
    @pulumi.getter(name="proxyCacheEnabled")
    def proxy_cache_enabled(self) -> pulumi.Output[builtins.bool]:
        """
        是否设置为ProxyCache实例
        """
        return pulumi.get(self, "proxy_cache_enabled")

    @property
    @pulumi.getter(name="renewType")
    def renew_type(self) -> pulumi.Output[builtins.str]:
        """
        仅计费类型为HybridCharge有值，实例自动续费类型
        """
        return pulumi.get(self, "renew_type")

    @property
    @pulumi.getter
    def status(self) -> pulumi.Output['outputs.RegistryStatus']:
        """
        镜像仓库实例状态，由 Phase 和 Conditions 组成。合法的 Phase 和 Conditions 组合如下所示：{Creating, [Progressing]}：创建中,{Running, [Ok]}：运行中,{Running, [Degraded]}：运行中,{Stopped, [Balance]}：欠费关停,{Stopped, [Released]}：待回收,{Stopped, [Released, Balance]}：欠费关停,{Starting, [Progressing]}：启动中,{Deleting, [Progressing]}：销毁中,{Failed, [Unknown]}：异常
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Sequence['outputs.RegistryTag']]:
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def type(self) -> pulumi.Output[builtins.str]:
        """
        不填写默认创建标准版实例。Enterprise：标准版，Micro：小微版
        """
        return pulumi.get(self, "type")

