""" Code is generated by ucloud-model, DO NOT EDIT IT. """


from ucloud.core.typesystem import schema, fields
from ucloud.services.uhub.schemas import models

""" UHub API Schema
"""


"""
API: CreateRepo

创建镜像仓库
"""


class CreateRepoRequestSchema(schema.RequestSchema):
    """CreateRepo - 创建镜像仓库"""

    fields = {
        "Description": fields.Str(required=False, dump_to="Description"),
        "IsShared": fields.Bool(required=False, dump_to="IsShared"),
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "RepoName": fields.Str(required=True, dump_to="RepoName"),
    }


class CreateRepoResponseSchema(schema.ResponseSchema):
    """CreateRepo - 创建镜像仓库"""

    fields = {
        "Message": fields.Str(required=False, load_from="Message"),
    }


"""
API: DeleteRepo

删除镜像仓库
"""


class DeleteRepoRequestSchema(schema.RequestSchema):
    """DeleteRepo - 删除镜像仓库"""

    fields = {
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "RepoName": fields.Str(required=True, dump_to="RepoName"),
    }


class DeleteRepoResponseSchema(schema.ResponseSchema):
    """DeleteRepo - 删除镜像仓库"""

    fields = {}


"""
API: DeleteRepoImage

删除镜像
"""


class DeleteRepoImageRequestSchema(schema.RequestSchema):
    """DeleteRepoImage - 删除镜像"""

    fields = {
        "ImageName": fields.Str(required=True, dump_to="ImageName"),
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "RepoName": fields.Str(required=True, dump_to="RepoName"),
        "TagName": fields.Str(required=False, dump_to="TagName"),
    }


class DeleteRepoImageResponseSchema(schema.ResponseSchema):
    """DeleteRepoImage - 删除镜像"""

    fields = {}


"""
API: GetImageTag

获取镜像tag
"""


class GetImageTagRequestSchema(schema.RequestSchema):
    """GetImageTag - 获取镜像tag"""

    fields = {
        "ImageName": fields.Str(required=True, dump_to="ImageName"),
        "Limit": fields.Int(required=False, dump_to="Limit"),
        "Offset": fields.Int(required=False, dump_to="Offset"),
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "RepoName": fields.Str(required=True, dump_to="RepoName"),
        "TagName": fields.Str(required=False, dump_to="TagName"),
    }


class GetImageTagResponseSchema(schema.ResponseSchema):
    """GetImageTag - 获取镜像tag"""

    fields = {
        "TagSet": fields.List(
            models.TagSetSchema(), required=True, load_from="TagSet"
        ),
        "TotalCount": fields.Int(required=True, load_from="TotalCount"),
    }


"""
API: GetRepo

获取镜像仓库
"""


class GetRepoRequestSchema(schema.RequestSchema):
    """GetRepo - 获取镜像仓库"""

    fields = {
        "Limit": fields.Int(required=False, dump_to="Limit"),
        "Offset": fields.Int(required=False, dump_to="Offset"),
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "Type": fields.Str(required=False, dump_to="Type"),
    }


class GetRepoResponseSchema(schema.ResponseSchema):
    """GetRepo - 获取镜像仓库"""

    fields = {
        "RepoSet": fields.List(
            models.RepoSetSchema(), required=True, load_from="RepoSet"
        ),
        "TotalCount": fields.Int(required=True, load_from="TotalCount"),
    }


"""
API: GetRepoImage

获取镜像仓库下的镜像
"""


class GetRepoImageRequestSchema(schema.RequestSchema):
    """GetRepoImage - 获取镜像仓库下的镜像"""

    fields = {
        "Limit": fields.Int(required=False, dump_to="Limit"),
        "Offset": fields.Int(required=False, dump_to="Offset"),
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "RepoName": fields.Str(required=True, dump_to="RepoName"),
    }


class GetRepoImageResponseSchema(schema.ResponseSchema):
    """GetRepoImage - 获取镜像仓库下的镜像"""

    fields = {
        "ImageSet": fields.List(
            models.ImageSetSchema(), required=True, load_from="ImageSet"
        ),
        "TotalCount": fields.Int(required=True, load_from="TotalCount"),
    }


"""
API: UpdateRepo

更新镜像仓库
"""


class UpdateRepoRequestSchema(schema.RequestSchema):
    """UpdateRepo - 更新镜像仓库"""

    fields = {
        "Description": fields.Str(required=False, dump_to="Description"),
        "IsShared": fields.Str(required=False, dump_to="IsShared"),
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "RepoName": fields.Str(required=True, dump_to="RepoName"),
    }


class UpdateRepoResponseSchema(schema.ResponseSchema):
    """UpdateRepo - 更新镜像仓库"""

    fields = {
        "Message": fields.Str(required=False, load_from="Message"),
    }
