support-organizer/backend/fgo_request_manager/models/requests.py
Firq 03901e1d12
All checks were successful
/ build:package (push) Successful in 11s
/ backend-pylint (push) Successful in 21s
updated package to conform to pylint
2023-12-21 17:11:47 +01:00

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)