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

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


""" StepFlow API Schema
"""


"""
API: CreateSFWorkflowFromTemplate

导入工作流定义
"""


class CreateSFWorkflowFromTemplateRequestSchema(schema.RequestSchema):
    """CreateSFWorkflowFromTemplate - 导入工作流定义"""

    fields = {
        "Namespace": fields.Str(required=True, dump_to="Namespace"),
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "Region": fields.Str(required=True, dump_to="Region"),
        "Workflow": fields.Base64(required=True, dump_to="Workflow"),
        "WorkflowName": fields.Str(required=True, dump_to="WorkflowName"),
    }


class CreateSFWorkflowFromTemplateResponseSchema(schema.ResponseSchema):
    """CreateSFWorkflowFromTemplate - 导入工作流定义"""

    fields = {
        "Message": fields.Str(required=True, load_from="Message"),
        "Version": fields.Int(required=True, load_from="Version"),
    }


"""
API: GetSFWorkflowTemplate

导出工作流定义
"""


class GetSFWorkflowTemplateRequestSchema(schema.RequestSchema):
    """GetSFWorkflowTemplate - 导出工作流定义"""

    fields = {
        "ProjectId": fields.Str(required=False, dump_to="ProjectId"),
        "Region": fields.Str(required=True, dump_to="Region"),
        "WorkflowId": fields.Str(required=True, dump_to="WorkflowId"),
        "WorkflowVersion": fields.Int(
            required=False, dump_to="WorkflowVersion"
        ),
    }


class GetSFWorkflowTemplateResponseSchema(schema.ResponseSchema):
    """GetSFWorkflowTemplate - 导出工作流定义"""

    fields = {
        "Message": fields.Str(required=False, load_from="Message"),
        "Version": fields.Int(required=True, load_from="Version"),
        "Workflow": models.WorkflowTemplateSchema(),
        "WorkflowId": fields.Str(required=True, load_from="WorkflowId"),
    }
