zou 0.20.72__py3-none-any.whl → 0.20.74__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,44 +22,61 @@ from zou.utils.movie import EncodingParameters
22
22
 
23
23
 
24
24
  class ProjectPlaylistsResource(Resource, ArgsMixin):
25
- """
26
- Retrieve all playlists related to given project.
27
- Result is paginated and can be sorted.
28
- """
29
25
 
30
26
  @jwt_required()
31
27
  def get(self, project_id):
32
28
  """
33
29
  Retrieve all playlists related to given project.
30
+ Result is paginated and can be sorted.
34
31
  ---
35
32
  tags:
36
- - Playlists
33
+ - Playlists
37
34
  description: Result is paginated and can be sorted.
38
35
  parameters:
39
36
  - in: path
40
37
  name: project_id
41
- required: True
42
- type: string
43
- format: uuid
38
+ required: true
39
+ schema:
40
+ type: string
41
+ format: uuid
44
42
  example: a24a6ea4-ce75-4665-a070-57453082c25
45
43
  - in: query
46
44
  name: page
47
- required: False
48
- type: integer
45
+ required: false
46
+ schema:
47
+ type: integer
49
48
  example: 1
50
49
  - in: query
51
50
  name: sort_by
52
- required: False
53
- type: string
54
- example: udpdated_at
51
+ required: false
52
+ schema:
53
+ type: string
54
+ example: updated_at
55
55
  - in: query
56
56
  name: task_type_id
57
- required: False
58
- type: string
57
+ required: false
58
+ schema:
59
+ type: string
60
+ format: uuid
59
61
  example: a24a6ea4-ce75-4665-a070-57453082c25
60
62
  responses:
61
- 200:
62
- description: All playlists related to given project
63
+ '200':
64
+ description: All playlists related to given project
65
+ content:
66
+ application/json:
67
+ schema:
68
+ type: array
69
+ items:
70
+ type: object
71
+ properties:
72
+ id:
73
+ type: string
74
+ format: uuid
75
+ name:
76
+ type: string
77
+ project_id:
78
+ type: string
79
+ format: uuid
63
80
  """
64
81
  user_service.block_access_to_vendor()
65
82
  user_service.check_project_access(project_id)
@@ -76,35 +93,49 @@ class ProjectPlaylistsResource(Resource, ArgsMixin):
76
93
 
77
94
 
78
95
  class EpisodePlaylistsResource(Resource, ArgsMixin):
79
- """
80
- Retrieve all playlists related to given episode.
81
- The full list is returned because the number of playlists in an episode is not that big.
82
- """
83
96
 
84
97
  @jwt_required()
85
98
  def get(self, project_id, episode_id):
86
99
  """
87
100
  Retrieve all playlists related to given episode.
101
+ The full list is returned because the number of playlists in an episode is not that big.
88
102
  ---
89
103
  tags:
90
- - Playlists
104
+ - Playlists
91
105
  description: The full list is returned because the number of playlists in an episode is not that big.
92
106
  parameters:
93
107
  - in: path
94
108
  name: project_id
95
- required: True
96
- type: string
97
- format: uuid
109
+ required: true
110
+ schema:
111
+ type: string
112
+ format: uuid
98
113
  example: a24a6ea4-ce75-4665-a070-57453082c25
99
114
  - in: path
100
115
  name: episode_id
101
- required: True
102
- type: string
103
- format: uuid
116
+ required: true
117
+ schema:
118
+ type: string
119
+ format: uuid
104
120
  example: a24a6ea4-ce75-4665-a070-57453082c25
105
121
  responses:
106
- 200:
107
- description: All playlists related to given episode
122
+ '200':
123
+ description: All playlists related to given episode
124
+ content:
125
+ application/json:
126
+ schema:
127
+ type: array
128
+ items:
129
+ type: object
130
+ properties:
131
+ id:
132
+ type: string
133
+ format: uuid
134
+ name:
135
+ type: string
136
+ episode_id:
137
+ type: string
138
+ format: uuid
108
139
  """
109
140
  user_service.block_access_to_vendor()
110
141
  user_service.check_project_access(project_id)
@@ -124,33 +155,51 @@ class EpisodePlaylistsResource(Resource, ArgsMixin):
124
155
 
125
156
 
126
157
  class ProjectPlaylistResource(Resource):
127
- """
128
- Retrieve all playlists related to given project.
129
- """
130
158
 
131
159
  @jwt_required()
132
160
  def get(self, project_id, playlist_id):
133
161
  """
134
- Retrieve all playlists related to given project.
162
+ Retrieve a specific playlist by ID.
135
163
  ---
136
164
  tags:
137
- - Playlists
165
+ - Playlists
138
166
  parameters:
139
167
  - in: path
140
168
  name: project_id
141
- required: True
142
- type: string
143
- format: uuid
169
+ required: true
170
+ schema:
171
+ type: string
172
+ format: uuid
144
173
  example: a24a6ea4-ce75-4665-a070-57453082c25
145
174
  - in: path
146
175
  name: playlist_id
147
- required: True
148
- type: string
149
- format: uuid
176
+ required: true
177
+ schema:
178
+ type: string
179
+ format: uuid
150
180
  example: a24a6ea4-ce75-4665-a070-57453082c25
151
181
  responses:
152
- 200:
153
- description: All playlists related to given project
182
+ '200':
183
+ description: Playlist details with preview file revisions
184
+ content:
185
+ application/json:
186
+ schema:
187
+ type: object
188
+ properties:
189
+ id:
190
+ type: string
191
+ format: uuid
192
+ name:
193
+ type: string
194
+ project_id:
195
+ type: string
196
+ format: uuid
197
+ shots:
198
+ type: array
199
+ items:
200
+ type: object
201
+ '404':
202
+ description: Playlist not found
154
203
  """
155
204
  user_service.block_access_to_vendor()
156
205
  user_service.check_project_access(project_id)
@@ -160,11 +209,6 @@ class ProjectPlaylistResource(Resource):
160
209
 
161
210
 
162
211
  class EntityPreviewsResource(Resource):
163
- """
164
- Retrieve all previews related to a given entity.
165
- It sends them as a dict.
166
- Keys are related task type ids and values are arrays of preview for this task type.
167
- """
168
212
 
169
213
  @jwt_required()
170
214
  def get(self, entity_id):
@@ -172,19 +216,35 @@ class EntityPreviewsResource(Resource):
172
216
  Retrieve all previews related to a given entity.
173
217
  ---
174
218
  tags:
175
- - Playlists
176
- description: It sends them as a dict.
177
- Keys are related task type ids and values are arrays of preview for this task type.
219
+ - Playlists
220
+ description: It sends them as a dict. Keys are related task type ids and values are arrays of preview for this task type.
178
221
  parameters:
179
222
  - in: path
180
223
  name: entity_id
181
- required: True
182
- type: string
183
- format: uuid
224
+ required: true
225
+ schema:
226
+ type: string
227
+ format: uuid
184
228
  example: a24a6ea4-ce75-4665-a070-57453082c25
185
229
  responses:
186
- 200:
187
- description: All previews related to given entity
230
+ '200':
231
+ description: All previews related to given entity
232
+ content:
233
+ application/json:
234
+ schema:
235
+ type: object
236
+ additionalProperties:
237
+ type: array
238
+ items:
239
+ type: object
240
+ properties:
241
+ id:
242
+ type: string
243
+ format: uuid
244
+ name:
245
+ type: string
246
+ '404':
247
+ description: Entity not found
188
248
  """
189
249
  entity = entities_service.get_entity(entity_id)
190
250
  user_service.check_project_access(entity["project_id"])
@@ -192,9 +252,6 @@ class EntityPreviewsResource(Resource):
192
252
 
193
253
 
194
254
  class PlaylistDownloadResource(Resource):
195
- """
196
- Download given playlist as a .mp4 after given build job is finished.
197
- """
198
255
 
199
256
  @jwt_required()
200
257
  def get(self, playlist_id, build_job_id):
@@ -202,27 +259,43 @@ class PlaylistDownloadResource(Resource):
202
259
  Download given playlist build as .mp4.
203
260
  ---
204
261
  tags:
205
- - Playlists
206
- produces:
207
- - multipart/form-data
262
+ - Playlists
208
263
  parameters:
209
264
  - in: path
210
265
  name: playlist_id
211
- required: True
212
- type: string
213
- format: uuid
266
+ required: true
267
+ schema:
268
+ type: string
269
+ format: uuid
214
270
  example: a24a6ea4-ce75-4665-a070-57453082c25
215
271
  - in: path
216
272
  name: build_job_id
217
- required: True
218
- type: string
219
- format: uuid
273
+ required: true
274
+ schema:
275
+ type: string
276
+ format: uuid
220
277
  example: a24a6ea4-ce75-4665-a070-57453082c25
221
278
  responses:
222
- 200:
223
- description: Given playlist build downloaded as .mp4
224
- 400:
225
- description: Build not finished, need to retry later
279
+ '200':
280
+ description: Given playlist build downloaded as .mp4
281
+ content:
282
+ video/mp4:
283
+ schema:
284
+ type: string
285
+ format: binary
286
+ '400':
287
+ description: Build not finished, need to retry later
288
+ content:
289
+ application/json:
290
+ schema:
291
+ type: object
292
+ properties:
293
+ error:
294
+ type: boolean
295
+ message:
296
+ type: string
297
+ '404':
298
+ description: Playlist or build job not found
226
299
  """
227
300
  user_service.block_access_to_vendor()
228
301
  playlist = playlists_service.get_playlist(playlist_id)
@@ -271,9 +344,6 @@ class PlaylistDownloadResource(Resource):
271
344
 
272
345
 
273
346
  class BuildPlaylistMovieResource(Resource, ArgsMixin):
274
- """
275
- Build given playlist as mp4 movie.
276
- """
277
347
 
278
348
  @jwt_required()
279
349
  def get(self, playlist_id):
@@ -281,19 +351,39 @@ class BuildPlaylistMovieResource(Resource, ArgsMixin):
281
351
  Build given playlist as mp4 movie.
282
352
  ---
283
353
  tags:
284
- - Playlists
285
- produces:
286
- - multipart/form-data
354
+ - Playlists
287
355
  parameters:
288
356
  - in: path
289
357
  name: playlist_id
290
- required: True
291
- type: string
292
- format: uuid
358
+ required: true
359
+ schema:
360
+ type: string
361
+ format: uuid
293
362
  example: a24a6ea4-ce75-4665-a070-57453082c25
363
+ - in: query
364
+ name: full
365
+ required: false
366
+ schema:
367
+ type: boolean
368
+ example: true
294
369
  responses:
295
- 200:
296
- description: Given playlist built as mp4 movie
370
+ '200':
371
+ description: Given playlist built as mp4 movie
372
+ content:
373
+ application/json:
374
+ schema:
375
+ type: object
376
+ properties:
377
+ id:
378
+ type: string
379
+ format: uuid
380
+ status:
381
+ type: string
382
+ created_at:
383
+ type: string
384
+ format: date-time
385
+ '404':
386
+ description: Playlist not found
297
387
  """
298
388
  playlist = playlists_service.get_playlist(playlist_id)
299
389
  user_service.check_manager_project_access(playlist["project_id"])
@@ -340,9 +430,6 @@ class BuildPlaylistMovieResource(Resource, ArgsMixin):
340
430
 
341
431
 
342
432
  class PlaylistZipDownloadResource(Resource):
343
- """
344
- Download given playlist as zip.
345
- """
346
433
 
347
434
  @jwt_required()
348
435
  def get(self, playlist_id):
@@ -350,21 +437,25 @@ class PlaylistZipDownloadResource(Resource):
350
437
  Download given playlist as zip.
351
438
  ---
352
439
  tags:
353
- - Playlists
354
- produces:
355
- - multipart/form-data
440
+ - Playlists
356
441
  parameters:
357
442
  - in: path
358
443
  name: playlist_id
359
- required: True
360
- type: string
361
- format: uuid
444
+ required: true
445
+ schema:
446
+ type: string
447
+ format: uuid
362
448
  example: a24a6ea4-ce75-4665-a070-57453082c25
363
449
  responses:
364
- 200:
365
- description: Given playlist downloaded as zip
450
+ '200':
451
+ description: Given playlist downloaded as zip
452
+ content:
453
+ application/zip:
366
454
  schema:
367
- type: file
455
+ type: string
456
+ format: binary
457
+ '404':
458
+ description: Playlist not found
368
459
  """
369
460
  user_service.block_access_to_vendor()
370
461
  playlist = playlists_service.get_playlist(playlist_id)
@@ -400,9 +491,6 @@ class PlaylistZipDownloadResource(Resource):
400
491
 
401
492
 
402
493
  class BuildJobResource(Resource):
403
- """
404
- Retrieve or remove a given build job related to a given playlist.
405
- """
406
494
 
407
495
  @jwt_required()
408
496
  def get(self, playlist_id, build_job_id):
@@ -410,23 +498,40 @@ class BuildJobResource(Resource):
410
498
  Retrieve build job related to given playlist.
411
499
  ---
412
500
  tags:
413
- - Playlists
501
+ - Playlists
414
502
  parameters:
415
503
  - in: path
416
504
  name: playlist_id
417
- required: True
418
- type: string
419
- format: uuid
505
+ required: true
506
+ schema:
507
+ type: string
508
+ format: uuid
420
509
  example: a24a6ea4-ce75-4665-a070-57453082c25
421
510
  - in: path
422
511
  name: build_job_id
423
- required: True
424
- type: string
425
- format: uuid
512
+ required: true
513
+ schema:
514
+ type: string
515
+ format: uuid
426
516
  example: a24a6ea4-ce75-4665-a070-57453082c25
427
517
  responses:
428
- 200:
429
- description: Build job related to given playlist
518
+ '200':
519
+ description: Build job related to given playlist
520
+ content:
521
+ application/json:
522
+ schema:
523
+ type: object
524
+ properties:
525
+ id:
526
+ type: string
527
+ format: uuid
528
+ status:
529
+ type: string
530
+ created_at:
531
+ type: string
532
+ format: date-time
533
+ '404':
534
+ description: Playlist or build job not found
430
535
  """
431
536
  user_service.block_access_to_vendor()
432
537
  playlist = playlists_service.get_playlist(playlist_id)
@@ -439,23 +544,27 @@ class BuildJobResource(Resource):
439
544
  Remove given build job related to given playlist.
440
545
  ---
441
546
  tags:
442
- - Playlists
547
+ - Playlists
443
548
  parameters:
444
549
  - in: path
445
550
  name: playlist_id
446
- required: True
447
- type: string
448
- format: uuid
551
+ required: true
552
+ schema:
553
+ type: string
554
+ format: uuid
449
555
  example: a24a6ea4-ce75-4665-a070-57453082c25
450
556
  - in: path
451
557
  name: build_job_id
452
- required: True
453
- type: string
454
- format: uuid
558
+ required: true
559
+ schema:
560
+ type: string
561
+ format: uuid
455
562
  example: a24a6ea4-ce75-4665-a070-57453082c25
456
563
  responses:
457
- 204:
458
- description: Given build job removed
564
+ '204':
565
+ description: Given build job removed
566
+ '404':
567
+ description: Playlist or build job not found
459
568
  """
460
569
  user_service.block_access_to_vendor()
461
570
  playlist = playlists_service.get_playlist(playlist_id)
@@ -465,29 +574,44 @@ class BuildJobResource(Resource):
465
574
 
466
575
 
467
576
  class ProjectBuildJobsResource(Resource):
468
- """
469
- Retrieve all build jobs related to given project.
470
- It's mainly used for synchronisation purpose.
471
- """
472
577
 
473
578
  @jwt_required()
474
579
  def get(self, project_id):
475
580
  """
476
581
  Retrieve all build jobs related to given project.
582
+ It's mainly used for synchronisation purpose.
477
583
  ---
478
584
  tags:
479
- - Playlists
585
+ - Playlists
480
586
  description: It's mainly used for synchronisation purpose.
481
587
  parameters:
482
588
  - in: path
483
589
  name: project_id
484
- required: True
485
- type: string
486
- format: uuid
590
+ required: true
591
+ schema:
592
+ type: string
593
+ format: uuid
487
594
  example: a24a6ea4-ce75-4665-a070-57453082c25
488
595
  responses:
489
- 200:
490
- description: All build jobs related to given project
596
+ '200':
597
+ description: All build jobs related to given project
598
+ content:
599
+ application/json:
600
+ schema:
601
+ type: array
602
+ items:
603
+ type: object
604
+ properties:
605
+ id:
606
+ type: string
607
+ format: uuid
608
+ status:
609
+ type: string
610
+ created_at:
611
+ type: string
612
+ format: date-time
613
+ '404':
614
+ description: Project not found
491
615
  """
492
616
  permissions.check_admin_permissions()
493
617
  projects_service.get_project(project_id)
@@ -495,10 +619,6 @@ class ProjectBuildJobsResource(Resource):
495
619
 
496
620
 
497
621
  class ProjectAllPlaylistsResource(Resource, ArgsMixin):
498
- """
499
- Retrieve all playlists related to given project.
500
- It's mainly used for synchronisation purpose.
501
- """
502
622
 
503
623
  @jwt_required()
504
624
  def get(self, project_id):
@@ -506,18 +626,36 @@ class ProjectAllPlaylistsResource(Resource, ArgsMixin):
506
626
  Retrieve all playlists related to given project.
507
627
  ---
508
628
  tags:
509
- - Playlists
629
+ - Playlists
510
630
  description: It's mainly used for synchronisation purpose.
511
631
  parameters:
512
632
  - in: path
513
633
  name: project_id
514
- required: True
515
- type: string
516
- format: uuid
634
+ required: true
635
+ schema:
636
+ type: string
637
+ format: uuid
517
638
  example: a24a6ea4-ce75-4665-a070-57453082c25
518
639
  responses:
519
- 200:
520
- description: All playlists related to given project
640
+ '200':
641
+ description: All playlists related to given project
642
+ content:
643
+ application/json:
644
+ schema:
645
+ type: array
646
+ items:
647
+ type: object
648
+ properties:
649
+ id:
650
+ type: string
651
+ format: uuid
652
+ name:
653
+ type: string
654
+ project_id:
655
+ type: string
656
+ format: uuid
657
+ '404':
658
+ description: Project not found
521
659
  """
522
660
  permissions.check_admin_permissions()
523
661
  projects_service.get_project(project_id)
@@ -526,29 +664,57 @@ class ProjectAllPlaylistsResource(Resource, ArgsMixin):
526
664
 
527
665
 
528
666
  class TempPlaylistResource(Resource, ArgsMixin):
529
- """
530
- Retrieve all playlists related to given project.
531
- It's mainly used for synchronisation purpose.
532
- """
533
667
 
534
668
  @jwt_required()
535
669
  def post(self, project_id):
536
670
  """
537
- Retrieve all playlists related to given project.
671
+ Generate a temporary playlist from task IDs.
538
672
  ---
539
673
  tags:
540
- - Playlists
674
+ - Playlists
541
675
  description: It's mainly used for synchronisation purpose.
542
676
  parameters:
543
677
  - in: path
544
678
  name: project_id
545
- required: True
546
- type: string
547
- format: uuid
679
+ required: true
680
+ schema:
681
+ type: string
682
+ format: uuid
548
683
  example: a24a6ea4-ce75-4665-a070-57453082c25
684
+ requestBody:
685
+ required: true
686
+ content:
687
+ application/json:
688
+ schema:
689
+ type: object
690
+ required:
691
+ - task_ids
692
+ properties:
693
+ task_ids:
694
+ type: array
695
+ items:
696
+ type: string
697
+ format: uuid
698
+ example: ["a24a6ea4-ce75-4665-a070-57453082c25"]
549
699
  responses:
550
- 200:
551
- description: All playlists related to given project
700
+ '200':
701
+ description: Temporary playlist generated
702
+ content:
703
+ application/json:
704
+ schema:
705
+ type: array
706
+ items:
707
+ type: object
708
+ properties:
709
+ id:
710
+ type: string
711
+ format: uuid
712
+ name:
713
+ type: string
714
+ '400':
715
+ description: Invalid task IDs
716
+ '404':
717
+ description: Project not found
552
718
  """
553
719
  user_service.check_project_access(project_id)
554
720
  task_ids = request.json.get("task_ids", [])