2019-09-24 18:34:35 +00:00
|
|
|
from jsonmodels import models, fields
|
|
|
|
|
2022-03-15 14:28:59 +00:00
|
|
|
from apiserver.apimodels import ListField, ActualEnumField, DictField
|
2021-01-05 14:28:49 +00:00
|
|
|
from apiserver.apimodels.organization import TagsRequest
|
2021-01-05 17:02:48 +00:00
|
|
|
from apiserver.database.model import EntityVisibility
|
2020-06-21 20:54:05 +00:00
|
|
|
|
2019-09-24 18:34:35 +00:00
|
|
|
|
2021-05-03 14:42:10 +00:00
|
|
|
class ProjectRequest(models.Base):
|
2021-05-03 14:39:13 +00:00
|
|
|
project = fields.StringField(required=True)
|
|
|
|
|
|
|
|
|
2021-05-03 14:42:10 +00:00
|
|
|
class MergeRequest(ProjectRequest):
|
|
|
|
destination_project = fields.StringField()
|
|
|
|
|
|
|
|
|
|
|
|
class MoveRequest(ProjectRequest):
|
|
|
|
new_location = fields.StringField()
|
|
|
|
|
|
|
|
|
|
|
|
class DeleteRequest(ProjectRequest):
|
2021-05-03 14:39:13 +00:00
|
|
|
force = fields.BoolField(default=False)
|
|
|
|
delete_contents = fields.BoolField(default=False)
|
2019-09-24 18:34:35 +00:00
|
|
|
|
|
|
|
|
2021-05-03 14:44:54 +00:00
|
|
|
class ProjectOrNoneRequest(models.Base):
|
|
|
|
project = fields.StringField()
|
|
|
|
include_subprojects = fields.BoolField(default=True)
|
|
|
|
|
|
|
|
|
2022-02-13 17:59:58 +00:00
|
|
|
class GetParamsRequest(ProjectOrNoneRequest):
|
2019-09-24 18:34:35 +00:00
|
|
|
page = fields.IntField(default=0)
|
|
|
|
page_size = fields.IntField(default=500)
|
|
|
|
|
|
|
|
|
2020-06-21 20:54:05 +00:00
|
|
|
class ProjectTagsRequest(TagsRequest):
|
|
|
|
projects = ListField(str)
|
2021-01-05 16:49:25 +00:00
|
|
|
|
|
|
|
|
2021-05-03 14:42:10 +00:00
|
|
|
class MultiProjectRequest(models.Base):
|
2021-05-03 14:34:40 +00:00
|
|
|
projects = fields.ListField(str)
|
2021-05-03 14:44:54 +00:00
|
|
|
include_subprojects = fields.BoolField(default=True)
|
2021-05-03 14:34:40 +00:00
|
|
|
|
|
|
|
|
2021-05-03 14:42:10 +00:00
|
|
|
class ProjectTaskParentsRequest(MultiProjectRequest):
|
2021-01-05 17:02:48 +00:00
|
|
|
tasks_state = ActualEnumField(EntityVisibility)
|
|
|
|
|
2021-05-03 14:34:40 +00:00
|
|
|
|
2021-05-03 14:42:10 +00:00
|
|
|
class ProjectHyperparamValuesRequest(MultiProjectRequest):
|
2021-05-03 14:34:40 +00:00
|
|
|
section = fields.StringField(required=True)
|
|
|
|
name = fields.StringField(required=True)
|
|
|
|
allow_public = fields.BoolField(default=True)
|
2021-05-03 14:36:04 +00:00
|
|
|
|
|
|
|
|
2022-03-15 14:28:59 +00:00
|
|
|
class ProjectModelMetadataValuesRequest(MultiProjectRequest):
|
|
|
|
key = fields.StringField(required=True)
|
|
|
|
allow_public = fields.BoolField(default=True)
|
|
|
|
|
|
|
|
|
2021-05-03 14:36:04 +00:00
|
|
|
class ProjectsGetRequest(models.Base):
|
2022-07-08 14:45:03 +00:00
|
|
|
include_dataset_stats = fields.BoolField(default=False)
|
2021-05-03 14:36:04 +00:00
|
|
|
include_stats = fields.BoolField(default=False)
|
2022-03-15 14:28:59 +00:00
|
|
|
include_stats_filter = DictField()
|
2022-02-13 17:26:47 +00:00
|
|
|
stats_with_children = fields.BoolField(default=True)
|
2021-05-03 14:36:04 +00:00
|
|
|
stats_for_state = ActualEnumField(EntityVisibility, default=EntityVisibility.active)
|
|
|
|
non_public = fields.BoolField(default=False)
|
|
|
|
active_users = fields.ListField(str)
|
2021-05-03 15:12:44 +00:00
|
|
|
check_own_contents = fields.BoolField(default=False)
|
2021-05-03 14:42:10 +00:00
|
|
|
shallow_search = fields.BoolField(default=False)
|
2022-04-18 13:34:18 +00:00
|
|
|
search_hidden = fields.BoolField(default=False)
|