28 lines
1,003 B
Python
28 lines
1,003 B
Python
|
from enum import Enum
|
||
|
import marshmallow as ma
|
||
|
|
||
|
class RequestStatus(Enum):
|
||
|
CREATED = 0
|
||
|
ACTIVE = 1
|
||
|
COMPLETED = 64
|
||
|
DELETED = 255
|
||
|
|
||
|
class RequestsAll(ma.Schema):
|
||
|
uuid = ma.fields.String(description="UUID v4", example="3f6dd2e5-8cb1-4ce0-82e4-b68edf4ce37a")
|
||
|
status = ma.fields.String()
|
||
|
|
||
|
class RequestsCreate(ma.Schema):
|
||
|
message = ma.fields.String(example="Request 3f6dd2e5-8cb1-4ce0-82e4-b68edf4ce37a was created")
|
||
|
status = ma.fields.Enum(RequestStatus, type=ma.fields.String)
|
||
|
uuid = ma.fields.String(example="3f6dd2e5-8cb1-4ce0-82e4-b68edf4ce37a")
|
||
|
|
||
|
class UuidSchema(ma.Schema):
|
||
|
uuid = ma.fields.String(description="UUID of the request", example="3f6dd2e5-8cb1-4ce0-82e4-b68edf4ce37a")
|
||
|
|
||
|
class RequestsInteraction(ma.Schema):
|
||
|
status = ma.fields.String()
|
||
|
|
||
|
class RequestsInteractionDelete(ma.Schema):
|
||
|
message = ma.fields.String(example="Request 3f6dd2e5-8cb1-4ce0-82e4-b68edf4ce37a was deleted.")
|
||
|
status = ma.fields.Enum(RequestStatus, type=ma.fields.String)
|