2019-06-10 21:24:35 +00:00
|
|
|
from jsonmodels import models, fields
|
|
|
|
from six import string_types
|
|
|
|
|
|
|
|
from apimodels import ListField, DictField
|
|
|
|
from apimodels.base import UpdateResponse
|
|
|
|
from apimodels.tasks import PublishResponse as TaskPublishResponse
|
|
|
|
|
|
|
|
|
2020-07-06 18:50:43 +00:00
|
|
|
class GetFrameworksRequest(models.Base):
|
|
|
|
projects = fields.ListField(items_types=[str])
|
|
|
|
|
|
|
|
|
2019-06-10 21:24:35 +00:00
|
|
|
class CreateModelRequest(models.Base):
|
|
|
|
name = fields.StringField(required=True)
|
|
|
|
uri = fields.StringField(required=True)
|
2019-12-14 21:54:03 +00:00
|
|
|
labels = DictField(value_types=string_types+(int,))
|
2019-06-10 21:24:35 +00:00
|
|
|
tags = ListField(items_types=string_types)
|
2019-09-24 18:34:35 +00:00
|
|
|
system_tags = ListField(items_types=string_types)
|
2019-06-10 21:24:35 +00:00
|
|
|
comment = fields.StringField()
|
|
|
|
public = fields.BoolField(default=False)
|
|
|
|
project = fields.StringField()
|
|
|
|
parent = fields.StringField()
|
|
|
|
framework = fields.StringField()
|
|
|
|
design = DictField()
|
|
|
|
ready = fields.BoolField(default=True)
|
|
|
|
ui_cache = DictField()
|
|
|
|
task = fields.StringField()
|
|
|
|
|
|
|
|
|
|
|
|
class CreateModelResponse(models.Base):
|
|
|
|
id = fields.StringField(required=True)
|
|
|
|
created = fields.BoolField(required=True)
|
|
|
|
|
|
|
|
|
|
|
|
class PublishModelRequest(models.Base):
|
|
|
|
model = fields.StringField(required=True)
|
|
|
|
force_publish_task = fields.BoolField(default=False)
|
|
|
|
publish_task = fields.BoolField(default=True)
|
|
|
|
|
|
|
|
|
|
|
|
class ModelTaskPublishResponse(models.Base):
|
|
|
|
id = fields.StringField(required=True)
|
|
|
|
data = fields.EmbeddedField(TaskPublishResponse)
|
|
|
|
|
|
|
|
|
|
|
|
class PublishModelResponse(UpdateResponse):
|
|
|
|
published_task = fields.EmbeddedField(ModelTaskPublishResponse)
|
|
|
|
updated = fields.IntField()
|