mirror of
https://github.com/clearml/clearml-server
synced 2025-01-31 10:56:48 +00:00
24 lines
604 B
Python
24 lines
604 B
Python
from typing import Sequence
|
|
|
|
from jsonmodels import validators
|
|
from jsonmodels.fields import StringField
|
|
from jsonmodels.models import Base
|
|
|
|
from apiserver.apimodels import ListField
|
|
|
|
|
|
class MetadataItem(Base):
|
|
key = StringField(required=True)
|
|
type = StringField(required=True)
|
|
value = StringField(required=True)
|
|
|
|
|
|
class DeleteMetadata(Base):
|
|
keys: Sequence[str] = ListField(str, validators=validators.Length(minimum_value=1))
|
|
|
|
|
|
class AddOrUpdateMetadata(Base):
|
|
metadata: Sequence[MetadataItem] = ListField(
|
|
[MetadataItem], validators=validators.Length(minimum_value=1)
|
|
)
|