"""Validation schema for query arguments.""" from assets.constants import field_const get_presigned_urls_for_asset_upload_schema = { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "Get Presigned URLs for Asset Upload Schema", "type": "object", "properties": { field_const.PART_NUMBERS: { "type": "string", "pattern": "^[0-9]+(?:,[0-9]+)*$", # comma separated list of numbers }, }, "required": [ field_const.PART_NUMBERS, ], "additionalProperties": False, } get_assets_status_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Get assets status query schema", "type": "object", "properties": { field_const.FILENAME: {"type": "string", "minLength": 1}, field_const.FILENAMES: {"type": "string", "minLength": 1}, }, "oneOf": [ {"required": [field_const.FILENAME]}, {"required": [field_const.FILENAMES]}, ], "additionalProperties": False, } get_asset_info_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Get assets status query schema", "type": "object", "properties": { field_const.FILENAME: {"type": "string"}, field_const.STATE: {"type": "string", "pattern": "^(raw|final)$"}, }, "required": [field_const.FILENAME, field_const.STATE], "additionalProperties": False, } get_asset_info_by_id_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Get asset by id query schema", "type": "object", "properties": {field_const.ASSET_FINAL_ID: {"type": "string"}}, "required": [field_const.ASSET_FINAL_ID], "additionalProperties": False, } get_asset_download_url_by_id_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Get asset download url by id query schema", "type": "object", "properties": { field_const.ASSET_FINAL_ID: {"type": "string", "pattern": "^[0-9]+$"}, field_const.EXPIRES_IN: {"type": "string", "pattern": "^[0-9]+$"}, }, "required": [field_const.ASSET_FINAL_ID], "additionalProperties": False, } get_hls_streaming_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Get asset hls streaming link schema", "type": "object", "properties": { field_const.IS_CORRECTION: {"type": "string", "pattern": "^(True|False)$"} }, "optional": [field_const.IS_CORRECTION], "additionalProperties": False, } delete_track_asset_schema = { "$schema": "http://json-schema.org/draft-04/schema#", "title": "Delete track asset schema", "type": "object", "properties": { field_const.ASSET_UPLOAD_TYPE: { "type": "string", "pattern": "^(stereo|static_artwork|atmos)$", } }, "additionalProperties": False, }