-
-
Notifications
You must be signed in to change notification settings - Fork 36
Expand file tree
/
Copy pathembed_content_request.py
More file actions
96 lines (91 loc) · 4.23 KB
/
embed_content_request.py
File metadata and controls
96 lines (91 loc) · 4.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# -*- coding: utf-8 -*-
# Generated by scripts/generate_from_specs.py
from __future__ import unicode_literals
# EmbedContentRequest
choices = ()
EMBEDCONTENTREQUESTLIST = []
SCHEMA = {
"$id": "/schemas/embed_content_request",
"$schema": "http://json-schema.org/draft-07/schema#",
"type": "object",
"description": "Schema for embed content requests received by RayServe",
"additionalProperties": False,
"definitions": {
"uuid": {
"type": "string",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$",
"description": "A unique identifier in the form of a UUID",
},
"language": {
"type": "string",
"description": "Language code from https://github.com/learningequality/le-utils/blob/main/le_utils/resources/languagelookup.json",
"pattern": "^[a-z]{2,3}(?:-[a-zA-Z]+)*$",
},
"url": {"type": "string", "pattern": "^(https?:\\/\\/(?:storage\\.cloud\\.google\\.com|localhost(?::[0-9]+)?)\\/[a-z0-9-._~!$&'()*+,;=:@%\\/\\?]+)$"},
"preset": {
"type": "string",
"description": "Presets from https://github.com/learningequality/le-utils/blob/main/le_utils/constants/format_presets.py",
"enum": [
"high_res_video",
"low_res_video",
"video_thumbnail",
"video_subtitle",
"video_dependency",
"audio",
"audio_thumbnail",
"audio_dependency",
"document",
"epub",
"document_thumbnail",
"exercise",
"exercise_thumbnail",
"exercise_image",
"exercise_graphie",
"channel_thumbnail",
"topic_thumbnail",
"html5_zip",
"html5_dependency",
"html5_thumbnail",
"h5p",
"h5p_thumbnail",
"zim",
"zim_thumbnail",
"qti",
"qti_thumbnail",
"slideshow_image",
"slideshow_thumbnail",
"slideshow_manifest",
"imscp_zip",
"bloompub",
],
},
"file": {
"type": "object",
"additionalProperties": False,
"properties": {"url": {"$ref": "#/definitions/url"}, "preset": {"$ref": "#/definitions/preset"}, "language": {"$ref": "#/definitions/language"}},
"required": ["url", "preset"],
},
"resource": {
"type": "object",
"description": "The key textual metadata and data for a content resource",
"additionalProperties": False,
"properties": {
"id": {"$ref": "#/definitions/uuid", "description": "The UUID of the content resource"},
"channel_id": {"$ref": "#/definitions/uuid", "description": "The UUID of the channel that the content resource belongs to"},
"title": {"type": "string", "description": "The title of the content resource"},
"description": {"type": "string", "description": "The description of the content resource"},
"text": {"type": "string", "description": "Optional textual content to include in the embedding"},
"language": {"$ref": "#/definitions/language"},
"files": {"type": "array", "description": "A list of files associated with the content resource", "items": {"$ref": "#/definitions/file"}},
"content_id": {"$ref": "#/definitions/uuid", "description": "The UUID of the content resource(s)"},
"channel_version": {"type": "integer", "description": "The version number of the channel that the content resource belongs to"},
},
"required": ["id", "channel_id", "title", "description", "content_id", "channel_version"],
},
},
"properties": {
"resources": {"type": "array", "description": "A list of content resources to embed", "items": {"$ref": "#/definitions/resource"}},
"metadata": {"type": "object", "description": "The metadata of the channel for logging purposes"},
},
"required": ["resources"],
}