zou 0.20.73__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.
@@ -109,23 +109,36 @@ class WorkingFileFileResource(Resource):
109
109
  ---
110
110
  tags:
111
111
  - Files
112
- produces:
113
- - image/png
114
- - image/jpg
115
- - image/gif
116
- - multipart/form-data
117
112
  parameters:
118
113
  - in: path
119
114
  name: working_file_id
120
115
  required: true
121
- type: string
122
- format: uuid
116
+ schema:
117
+ type: string
118
+ format: uuid
123
119
  example: a24a6ea4-ce75-4665-a070-57453082c25
124
120
  responses:
125
- 200:
126
- description: Working file downloaded
127
- schema:
128
- type: file
121
+ '200':
122
+ description: Working file downloaded
123
+ content:
124
+ image/png:
125
+ schema:
126
+ type: string
127
+ format: binary
128
+ image/jpg:
129
+ schema:
130
+ type: string
131
+ format: binary
132
+ image/gif:
133
+ schema:
134
+ type: string
135
+ format: binary
136
+ application/octet-stream:
137
+ schema:
138
+ type: string
139
+ format: binary
140
+ '404':
141
+ description: Working file not found
129
142
  """
130
143
  working_file = self.check_access(working_file_id)
131
144
  return send_storage_file(
@@ -146,16 +159,38 @@ class WorkingFileFileResource(Resource):
146
159
  - in: path
147
160
  name: working_file_id
148
161
  required: true
149
- type: string
150
- format: uuid
162
+ schema:
163
+ type: string
164
+ format: uuid
151
165
  example: a24a6ea4-ce75-4665-a070-57453082c25
152
- - in: formData
153
- name: file
154
- type: file
155
- required: True
166
+ requestBody:
167
+ required: true
168
+ content:
169
+ multipart/form-data:
170
+ schema:
171
+ type: object
172
+ required:
173
+ - file
174
+ properties:
175
+ file:
176
+ type: string
177
+ format: binary
178
+ description: Working file to upload
156
179
  responses:
157
- 201:
158
- description: Working file stored
180
+ '201':
181
+ description: Working file stored
182
+ content:
183
+ application/json:
184
+ schema:
185
+ type: object
186
+ properties:
187
+ success:
188
+ type: boolean
189
+ example: true
190
+ '400':
191
+ description: Invalid file or parameters
192
+ '404':
193
+ description: Working file not found
159
194
  """
160
195
  working_file = self.check_access(working_file_id)
161
196
  file_path = self.save_uploaded_file_in_temporary_folder(
@@ -179,44 +214,59 @@ class WorkingFilePathResource(Resource, ArgsMixin):
179
214
  Generate a working file path from file tree template.
180
215
  ---
181
216
  tags:
182
- - Files
183
- description: "Generate file path based on several parameters: task, software, mode, revision and separator.
184
- Revision can be computed automatically as next revision if not given."
217
+ - Files
218
+ description: Generate file path based on several parameters: task, software, mode, revision and separator.
219
+ Revision can be computed automatically as next revision if not given.
185
220
  parameters:
186
221
  - in: path
187
222
  name: task_id
188
223
  required: true
189
- type: string
190
- format: uuid
191
- example: a24a6ea4-ce75-4665-a070-57453082c25
192
- - in: body
193
- name: File
194
- description: Name, software, mode, revision and separator.
195
224
  schema:
225
+ type: string
226
+ format: uuid
227
+ example: a24a6ea4-ce75-4665-a070-57453082c25
228
+ requestBody:
229
+ required: true
230
+ content:
231
+ application/json:
232
+ schema:
196
233
  type: object
197
234
  properties:
198
- name:
199
- type: string
200
- default: main
201
- mode:
202
- type: string
203
- default: working
204
- software_id:
205
- type: string
206
- format: uuid
207
- example: a24a6ea4-ce75-4665-a070-57453082c25
208
- comment:
209
- type: string
210
- revision:
211
- type: integer
212
- separator:
213
- type: string
214
- default: /
235
+ name:
236
+ type: string
237
+ default: main
238
+ example: main
239
+ mode:
240
+ type: string
241
+ default: working
242
+ example: working
243
+ software_id:
244
+ type: string
245
+ format: uuid
246
+ example: a24a6ea4-ce75-4665-a070-57453082c25
247
+ comment:
248
+ type: string
249
+ example: "Updated lighting"
250
+ revision:
251
+ type: integer
252
+ example: 1
253
+ separator:
254
+ type: string
255
+ default: /
256
+ example: /
215
257
  responses:
216
- 200:
217
- description: Working file path generated
218
- 400:
219
- description: Malformed file tree
258
+ '200':
259
+ description: Working file path generated
260
+ content:
261
+ application/json:
262
+ schema:
263
+ type: object
264
+ properties:
265
+ path:
266
+ type: string
267
+ example: "/project/asset/working/main_v001.blend"
268
+ '400':
269
+ description: Malformed file tree
220
270
  """
221
271
  (
222
272
  name,
@@ -301,53 +351,69 @@ class EntityOutputFilePathResource(Resource, ArgsMixin):
301
351
  Generate an output file path from file tree template
302
352
  ---
303
353
  tags:
304
- - Files
305
- description: "Generate file path based on several parameters: entity, output type, task type, revision, mode, name and separator.
306
- Revision can be computed automatically as next revision if not given."
354
+ - Files
355
+ description: Generate file path based on several parameters: entity, output type, task type, revision, mode, name and separator.
356
+ Revision can be computed automatically as next revision if not given.
307
357
  parameters:
308
358
  - in: path
309
359
  name: entity_id
310
360
  required: true
311
- type: string
312
- format: uuid
313
- example: a24a6ea4-ce75-4665-a070-57453082c25
314
- - in: body
315
- name: File
316
- description: Entity, output type, task type, revision, mode, name and separator.
317
361
  schema:
362
+ type: string
363
+ format: uuid
364
+ example: a24a6ea4-ce75-4665-a070-57453082c25
365
+ requestBody:
366
+ required: true
367
+ content:
368
+ application/json:
369
+ schema:
318
370
  type: object
319
371
  required:
320
372
  - output_type_id
321
373
  - task_type_id
322
374
  properties:
323
- name:
324
- type: string
325
- default: main
326
- mode:
327
- type: string
328
- default: output
329
- output_type_id:
330
- type: string
331
- format: uuid
332
- example: a24a6ea4-ce75-4665-a070-57453082c25
333
- task_type_id:
334
- type: string
335
- format: uuid
336
- example: a24a6ea4-ce75-4665-a070-57453082c25
337
- extension:
338
- type: string
339
- representation:
340
- type: string
341
- revision:
342
- type: integer
343
- separator:
344
- type: string
345
- default: /
375
+ name:
376
+ type: string
377
+ default: main
378
+ example: main
379
+ mode:
380
+ type: string
381
+ default: output
382
+ example: output
383
+ output_type_id:
384
+ type: string
385
+ format: uuid
386
+ example: a24a6ea4-ce75-4665-a070-57453082c25
387
+ task_type_id:
388
+ type: string
389
+ format: uuid
390
+ example: a24a6ea4-ce75-4665-a070-57453082c25
391
+ extension:
392
+ type: string
393
+ example: ".mp4"
394
+ representation:
395
+ type: string
396
+ example: "mp4"
397
+ revision:
398
+ type: integer
399
+ example: 1
400
+ separator:
401
+ type: string
402
+ default: /
403
+ example: /
346
404
  responses:
347
- 200:
348
- description: Output file path generated
349
- 400:
350
- description: Malformed file tree
405
+ '200':
406
+ description: Output file path generated
407
+ content:
408
+ application/json:
409
+ schema:
410
+ type: object
411
+ properties:
412
+ path:
413
+ type: string
414
+ example: "/project/asset/output/main_v001.mp4"
415
+ '400':
416
+ description: Malformed file tree
351
417
  """
352
418
  args = self.get_arguments()
353
419
  try:
@@ -546,12 +612,32 @@ class LastWorkingFilesResource(Resource):
546
612
  - in: path
547
613
  name: task_id
548
614
  required: true
549
- type: string
550
- format: uuid
615
+ schema:
616
+ type: string
617
+ format: uuid
551
618
  example: a24a6ea4-ce75-4665-a070-57453082c25
552
619
  responses:
553
- 200:
554
- description: Last working files revision for each file name for given task
620
+ '200':
621
+ description: Last working files revision for each file name for given task
622
+ content:
623
+ application/json:
624
+ schema:
625
+ type: object
626
+ additionalProperties:
627
+ type: object
628
+ properties:
629
+ id:
630
+ type: string
631
+ format: uuid
632
+ name:
633
+ type: string
634
+ revision:
635
+ type: integer
636
+ updated_at:
637
+ type: string
638
+ format: date-time
639
+ '404':
640
+ description: Task not found
555
641
  """
556
642
  result = {}
557
643
  user_service.check_task_access(task_id)
@@ -568,7 +654,7 @@ class TaskWorkingFilesResource(Resource):
568
654
  @jwt_required()
569
655
  def get(self, task_id):
570
656
  """
571
- Return last working files revision for each file name for given task.
657
+ Return all working file revisions for a given task.
572
658
  ---
573
659
  tags:
574
660
  - Files
@@ -576,12 +662,35 @@ class TaskWorkingFilesResource(Resource):
576
662
  - in: path
577
663
  name: task_id
578
664
  required: true
579
- type: string
580
- format: uuid
665
+ schema:
666
+ type: string
667
+ format: uuid
581
668
  example: a24a6ea4-ce75-4665-a070-57453082c25
582
669
  responses:
583
- 200:
584
- description: Last working files revision for each file name for given task
670
+ '200':
671
+ description: All working file revisions for given task
672
+ content:
673
+ application/json:
674
+ schema:
675
+ type: array
676
+ items:
677
+ type: object
678
+ properties:
679
+ id:
680
+ type: string
681
+ format: uuid
682
+ name:
683
+ type: string
684
+ revision:
685
+ type: integer
686
+ updated_at:
687
+ type: string
688
+ format: date-time
689
+ task_id:
690
+ type: string
691
+ format: uuid
692
+ '404':
693
+ description: Task not found
585
694
  """
586
695
  result = {}
587
696
  user_service.check_task_access(task_id)
@@ -604,60 +713,78 @@ class NewWorkingFileResource(Resource, ArgsMixin):
604
713
  Create new working file.
605
714
  ---
606
715
  tags:
607
- - Files
716
+ - Files
608
717
  description: A working file is a file used to produce output files.
609
718
  It is the file the CG artist is working on.
610
719
  It is versioned, tied to a task and a software and requires a comment each time it is created.
611
720
  A path is generated for each file created. The path format is defined in the file tree template file.
612
- produces:
613
- - image/png
614
- - image/jpg
615
- - image/gif
616
- - multipart/form-data
617
721
  parameters:
618
722
  - in: path
619
723
  name: task_id
620
724
  required: true
621
- type: string
622
- format: uuid
623
- example: a24a6ea4-ce75-4665-a070-57453082c25
624
- - in: body
625
- name: File
626
- description: Name, mode, description, comment, person ID, software ID, revision and separator.
627
725
  schema:
726
+ type: string
727
+ format: uuid
728
+ example: a24a6ea4-ce75-4665-a070-57453082c25
729
+ requestBody:
730
+ required: true
731
+ content:
732
+ application/json:
733
+ schema:
628
734
  type: object
629
735
  required:
630
736
  - name
631
737
  properties:
632
- name:
633
- type: string
634
- mode:
635
- type: string
636
- default: working
637
- description:
638
- type: string
639
- comment:
640
- type: string
641
- person_id:
642
- type: string
643
- format: uuid
644
- example: a24a6ea4-ce75-4665-a070-57453082c25
645
- software_id:
646
- type: string
647
- format: uuid
648
- example: a24a6ea4-ce75-4665-a070-57453082c25
649
- revision:
650
- type: integer
651
- sep:
652
- type: string
653
- default: /
738
+ name:
739
+ type: string
740
+ example: "main"
741
+ mode:
742
+ type: string
743
+ default: working
744
+ example: working
745
+ description:
746
+ type: string
747
+ example: "Main character model"
748
+ comment:
749
+ type: string
750
+ example: "Updated lighting and materials"
751
+ person_id:
752
+ type: string
753
+ format: uuid
754
+ example: a24a6ea4-ce75-4665-a070-57453082c25
755
+ software_id:
756
+ type: string
757
+ format: uuid
758
+ example: a24a6ea4-ce75-4665-a070-57453082c25
759
+ revision:
760
+ type: integer
761
+ example: 1
762
+ sep:
763
+ type: string
764
+ default: /
765
+ example: /
654
766
  responses:
655
- 201:
656
- description: New working file created
767
+ '201':
768
+ description: New working file created
769
+ content:
770
+ application/json:
657
771
  schema:
658
- type: file
659
- 400:
660
- description: Given working file already exists
772
+ type: object
773
+ properties:
774
+ id:
775
+ type: string
776
+ format: uuid
777
+ name:
778
+ type: string
779
+ path:
780
+ type: string
781
+ revision:
782
+ type: integer
783
+ task_id:
784
+ type: string
785
+ format: uuid
786
+ '400':
787
+ description: Given working file already exists
661
788
  """
662
789
  (
663
790
  name,
@@ -760,12 +887,26 @@ class ModifiedFileResource(Resource):
760
887
  - in: path
761
888
  name: working_file_id
762
889
  required: true
763
- type: string
764
- format: uuid
890
+ schema:
891
+ type: string
892
+ format: uuid
765
893
  example: a24a6ea4-ce75-4665-a070-57453082c25
766
894
  responses:
767
- 200:
768
- description: Working file modification date updated
895
+ '200':
896
+ description: Working file modification date updated
897
+ content:
898
+ application/json:
899
+ schema:
900
+ type: object
901
+ properties:
902
+ id:
903
+ type: string
904
+ format: uuid
905
+ updated_at:
906
+ type: string
907
+ format: date-time
908
+ '404':
909
+ description: Working file not found
769
910
  """
770
911
  working_file = files_service.get_working_file(working_file_id)
771
912
  user_service.check_task_action_access(working_file["task_id"])
@@ -787,26 +928,45 @@ class CommentWorkingFileResource(Resource, ArgsMixin):
787
928
  Update comment on given working file.
788
929
  ---
789
930
  tags:
790
- - Files
931
+ - Files
791
932
  parameters:
792
933
  - in: path
793
934
  name: working_file_id
794
935
  required: true
795
- type: string
796
- format: uuid
797
- example: a24a6ea4-ce75-4665-a070-57453082c25
798
- - in: body
799
- name: Comment
800
936
  schema:
937
+ type: string
938
+ format: uuid
939
+ example: a24a6ea4-ce75-4665-a070-57453082c25
940
+ requestBody:
941
+ required: true
942
+ content:
943
+ application/json:
944
+ schema:
801
945
  type: object
802
946
  required:
803
947
  - comment
804
948
  properties:
805
- comment:
806
- type: string
949
+ comment:
950
+ type: string
951
+ example: "Updated lighting and materials"
807
952
  responses:
808
- 200:
809
- description: Comment updated on given working file
953
+ '200':
954
+ description: Comment updated on given working file
955
+ content:
956
+ application/json:
957
+ schema:
958
+ type: object
959
+ properties:
960
+ id:
961
+ type: string
962
+ format: uuid
963
+ comment:
964
+ type: string
965
+ updated_at:
966
+ type: string
967
+ format: date-time
968
+ '404':
969
+ description: Working file not found
810
970
  """
811
971
  args = self.get_args(
812
972
  [
@@ -849,7 +1009,7 @@ class NewEntityOutputFileResource(Resource, ArgsMixin):
849
1009
  Create new output file linked to a given entity.
850
1010
  ---
851
1011
  tags:
852
- - Files
1012
+ - Files
853
1013
  description: Output files are linked to entities.
854
1014
  Each time a CG artist is satisfied by what he did on a working file,
855
1015
  he can create an output file that will be linked to a target entity (an asset, a shot, a sequence, ...).
@@ -857,75 +1017,93 @@ class NewEntityOutputFileResource(Resource, ArgsMixin):
857
1017
  An output type is required for better categorization (textures, caches, ...).
858
1018
  A task type can be set too to give the department related to the output file.
859
1019
  Revision is automatically set.
860
- produces:
861
- - image/png
862
- - image/jpg
863
- - image/gif
864
- - multipart/form-data
865
1020
  parameters:
866
1021
  - in: path
867
1022
  name: entity_id
868
1023
  required: true
869
- type: string
870
- format: uuid
871
- example: a24a6ea4-ce75-4665-a070-57453082c25
872
- - in: body
873
- name: File
874
- description: Name, mode, output type ID, task type ID, person ID, working file ID, file status ID, comment, extension, representation, revision, number of elements and separator.
875
1024
  schema:
1025
+ type: string
1026
+ format: uuid
1027
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1028
+ requestBody:
1029
+ required: true
1030
+ content:
1031
+ application/json:
1032
+ schema:
876
1033
  type: object
877
1034
  required:
878
1035
  - output_type_id
879
1036
  - task_type_id
880
1037
  properties:
881
- name:
882
- type: string
883
- mode:
884
- type: string
885
- default: output
886
- output_type_id:
887
- type: string
888
- format: uuid
889
- example: a24a6ea4-ce75-4665-a070-57453082c25
890
- task_type_id:
891
- type: string
892
- format: uuid
893
- example: a24a6ea4-ce75-4665-a070-57453082c25
894
- person_id:
895
- type: string
896
- format: uuid
897
- example: a24a6ea4-ce75-4665-a070-57453082c25
898
- working_file_id:
899
- type: string
900
- format: uuid
901
- example: a24a6ea4-ce75-4665-a070-57453082c25
902
- file_status_id:
903
- type: string
904
- format: uuid
905
- example: a24a6ea4-ce75-4665-a070-57453082c25
906
- comment:
907
- type: string
908
- extension:
909
- type: string
910
- representation:
911
- type: string
912
- revision:
913
- type: integer
914
- nb_elements:
915
- type: integer
916
- default: 1
917
- sep:
918
- type: string
919
- default: /
1038
+ name:
1039
+ type: string
1040
+ example: "main"
1041
+ mode:
1042
+ type: string
1043
+ default: output
1044
+ example: output
1045
+ output_type_id:
1046
+ type: string
1047
+ format: uuid
1048
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1049
+ task_type_id:
1050
+ type: string
1051
+ format: uuid
1052
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1053
+ person_id:
1054
+ type: string
1055
+ format: uuid
1056
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1057
+ working_file_id:
1058
+ type: string
1059
+ format: uuid
1060
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1061
+ file_status_id:
1062
+ type: string
1063
+ format: uuid
1064
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1065
+ comment:
1066
+ type: string
1067
+ example: "Final render"
1068
+ extension:
1069
+ type: string
1070
+ example: ".mp4"
1071
+ representation:
1072
+ type: string
1073
+ example: "mp4"
1074
+ revision:
1075
+ type: integer
1076
+ example: 1
1077
+ nb_elements:
1078
+ type: integer
1079
+ default: 1
1080
+ example: 1
1081
+ sep:
1082
+ type: string
1083
+ default: /
1084
+ example: /
920
1085
  responses:
921
- 200:
922
- description: New output file created
1086
+ '200':
1087
+ description: New output file created
1088
+ content:
1089
+ application/json:
923
1090
  schema:
924
- type: file
925
- 400:
926
- description: Given output file already exists
927
- Given person not found
928
- Given output type not found
1091
+ type: object
1092
+ properties:
1093
+ id:
1094
+ type: string
1095
+ format: uuid
1096
+ name:
1097
+ type: string
1098
+ path:
1099
+ type: string
1100
+ revision:
1101
+ type: integer
1102
+ entity_id:
1103
+ type: string
1104
+ format: uuid
1105
+ '400':
1106
+ description: Given output file already exists, Given person not found, or Given output type not found
929
1107
  """
930
1108
  args = self.get_arguments()
931
1109
 
@@ -1071,92 +1249,115 @@ class NewInstanceOutputFileResource(Resource, ArgsMixin):
1071
1249
  Create new output file linked to assets through an instance of this asset for a given shot.
1072
1250
  ---
1073
1251
  tags:
1074
- - Files
1252
+ - Files
1075
1253
  description: Some output files are linked to assets through an instance of this asset for a given shot.
1076
1254
  Each time a CG artist is satisfied by what he did on a working file,
1077
1255
  he can create an output file that will be linked to a target instance.
1078
1256
  It keeps track of the working file at the origin of the output file.
1079
1257
  An output type is required for better categorization (textures, caches, ...).
1080
1258
  A task type can be set too to give the department related to the output file.
1081
- produces:
1082
- - image/png
1083
- - image/jpg
1084
- - image/gif
1085
- - multipart/form-data
1086
1259
  parameters:
1087
1260
  - in: path
1088
1261
  name: asset_instance_id
1089
1262
  required: true
1090
- type: string
1091
- format: uuid
1263
+ schema:
1264
+ type: string
1265
+ format: uuid
1092
1266
  example: a24a6ea4-ce75-4665-a070-57453082c25
1093
1267
  - in: path
1094
1268
  name: temporal_entity_id
1095
1269
  required: true
1096
- type: string
1097
- format: uuid
1098
- example: a24a6ea4-ce75-4665-a070-57453082c25
1099
- - in: body
1100
- name: File
1101
- description: Name, mode, output type ID, task type ID, person ID, working file ID, file status ID, comment, extension, representation, revision, number of elements and separator.
1102
1270
  schema:
1271
+ type: string
1272
+ format: uuid
1273
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1274
+ requestBody:
1275
+ required: true
1276
+ content:
1277
+ application/json:
1278
+ schema:
1103
1279
  type: object
1104
1280
  required:
1105
1281
  - output_type_id
1106
1282
  - task_type_id
1107
1283
  properties:
1108
- name:
1109
- type: string
1110
- default: main
1111
- mode:
1112
- type: string
1113
- default: output
1114
- output_type_id:
1115
- type: string
1116
- format: uuid
1117
- example: a24a6ea4-ce75-4665-a070-57453082c25
1118
- task_type_id:
1119
- type: string
1120
- format: uuid
1121
- example: a24a6ea4-ce75-4665-a070-57453082c25
1122
- person_id:
1123
- type: string
1124
- format: uuid
1125
- example: a24a6ea4-ce75-4665-a070-57453082c25
1126
- working_file_id:
1127
- type: string
1128
- format: uuid
1129
- example: a24a6ea4-ce75-4665-a070-57453082c25
1130
- file_status_id:
1131
- type: string
1132
- format: uuid
1133
- example: a24a6ea4-ce75-4665-a070-57453082c25
1134
- is_sequence:
1135
- type: boolean
1136
- default: False
1137
- comment:
1138
- type: string
1139
- extension:
1140
- type: string
1141
- representation:
1142
- type: string
1143
- revision:
1144
- type: integer
1145
- nb_elements:
1146
- type: integer
1147
- default: 1
1148
- sep:
1149
- type: string
1150
- default: /
1284
+ name:
1285
+ type: string
1286
+ default: main
1287
+ example: main
1288
+ mode:
1289
+ type: string
1290
+ default: output
1291
+ example: output
1292
+ output_type_id:
1293
+ type: string
1294
+ format: uuid
1295
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1296
+ task_type_id:
1297
+ type: string
1298
+ format: uuid
1299
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1300
+ person_id:
1301
+ type: string
1302
+ format: uuid
1303
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1304
+ working_file_id:
1305
+ type: string
1306
+ format: uuid
1307
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1308
+ file_status_id:
1309
+ type: string
1310
+ format: uuid
1311
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1312
+ is_sequence:
1313
+ type: boolean
1314
+ default: false
1315
+ example: false
1316
+ comment:
1317
+ type: string
1318
+ example: "Final render"
1319
+ extension:
1320
+ type: string
1321
+ example: ".mp4"
1322
+ representation:
1323
+ type: string
1324
+ example: "mp4"
1325
+ revision:
1326
+ type: integer
1327
+ example: 1
1328
+ nb_elements:
1329
+ type: integer
1330
+ default: 1
1331
+ example: 1
1332
+ sep:
1333
+ type: string
1334
+ default: /
1335
+ example: /
1151
1336
  responses:
1152
- 200:
1153
- description: New output file created
1337
+ '200':
1338
+ description: New output file created
1339
+ content:
1340
+ application/json:
1154
1341
  schema:
1155
- type: file
1156
- 400:
1157
- description: Given output file already exists
1158
- Given person not found
1159
- Given output type not found
1342
+ type: object
1343
+ properties:
1344
+ id:
1345
+ type: string
1346
+ format: uuid
1347
+ name:
1348
+ type: string
1349
+ path:
1350
+ type: string
1351
+ revision:
1352
+ type: integer
1353
+ asset_instance_id:
1354
+ type: string
1355
+ format: uuid
1356
+ temporal_entity_id:
1357
+ type: string
1358
+ format: uuid
1359
+ '400':
1360
+ description: Given output file already exists, Given person not found, or Given output type not found
1160
1361
  """
1161
1362
  args = self.get_arguments()
1162
1363
 
@@ -1305,37 +1506,50 @@ class GetNextEntityOutputFileRevisionResource(Resource, ArgsMixin):
1305
1506
  Get next revision for given entity, output type, task type and name.
1306
1507
  ---
1307
1508
  tags:
1308
- - Files
1509
+ - Files
1309
1510
  parameters:
1310
1511
  - in: path
1311
1512
  name: entity_id
1312
1513
  required: true
1313
- type: string
1314
- format: uuid
1315
- example: a24a6ea4-ce75-4665-a070-57453082c25
1316
- - in: body
1317
- name: File
1318
- description: Name, output type ID, task type ID.
1319
1514
  schema:
1515
+ type: string
1516
+ format: uuid
1517
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1518
+ requestBody:
1519
+ required: true
1520
+ content:
1521
+ application/json:
1522
+ schema:
1320
1523
  type: object
1321
1524
  required:
1322
1525
  - output_type_id
1323
1526
  - task_type_id
1324
1527
  properties:
1325
- name:
1326
- type: string
1327
- default: main
1328
- output_type_id:
1329
- type: string
1330
- format: uuid
1331
- example: a24a6ea4-ce75-4665-a070-57453082c25
1332
- task_type_id:
1333
- type: string
1334
- format: uuid
1335
- example: a24a6ea4-ce75-4665-a070-57453082c25
1528
+ name:
1529
+ type: string
1530
+ default: main
1531
+ example: main
1532
+ output_type_id:
1533
+ type: string
1534
+ format: uuid
1535
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1536
+ task_type_id:
1537
+ type: string
1538
+ format: uuid
1539
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1336
1540
  responses:
1337
- 200:
1338
- description: Next revision for given entity, output type, task type and name
1541
+ '200':
1542
+ description: Next revision for given entity, output type, task type and name
1543
+ content:
1544
+ application/json:
1545
+ schema:
1546
+ type: object
1547
+ properties:
1548
+ next_revision:
1549
+ type: integer
1550
+ example: 3
1551
+ '404':
1552
+ description: Entity, output type, or task type not found
1339
1553
  """
1340
1554
  args = self.get_arguments()
1341
1555
  entity = entities_service.get_entity(entity_id)
@@ -1496,48 +1710,73 @@ class LastInstanceOutputFilesResource(Resource, ArgsMixin):
1496
1710
  Get last revisions of output files for given instance grouped by output type and file name.
1497
1711
  ---
1498
1712
  tags:
1499
- - Files
1713
+ - Files
1500
1714
  parameters:
1501
1715
  - in: path
1502
1716
  name: asset_instance_id
1503
1717
  required: true
1504
- type: string
1505
- format: uuid
1718
+ schema:
1719
+ type: string
1720
+ format: uuid
1506
1721
  example: a24a6ea4-ce75-4665-a070-57453082c25
1507
1722
  - in: path
1508
1723
  name: temporal_entity_id
1509
1724
  required: true
1510
- type: string
1511
- format: uuid
1725
+ schema:
1726
+ type: string
1727
+ format: uuid
1512
1728
  example: a24a6ea4-ce75-4665-a070-57453082c25
1513
1729
  - in: query
1514
1730
  name: output_type_id
1515
1731
  required: true
1516
- type: string
1517
- format: uuid
1732
+ schema:
1733
+ type: string
1734
+ format: uuid
1518
1735
  example: a24a6ea4-ce75-4665-a070-57453082c25
1519
1736
  - in: query
1520
1737
  name: task_type_id
1521
1738
  required: true
1522
- type: string
1523
- format: uuid
1739
+ schema:
1740
+ type: string
1741
+ format: uuid
1524
1742
  example: a24a6ea4-ce75-4665-a070-57453082c25
1525
1743
  - in: query
1526
1744
  name: file_status_id
1527
1745
  required: true
1528
- type: string
1529
- format: uuid
1746
+ schema:
1747
+ type: string
1748
+ format: uuid
1530
1749
  example: a24a6ea4-ce75-4665-a070-57453082c25
1531
1750
  - in: query
1532
1751
  name: representation
1533
1752
  required: true
1534
- type: string
1535
- format: uuid
1753
+ schema:
1754
+ type: string
1536
1755
  example: cache
1537
1756
  responses:
1538
- 200:
1539
- description: Last revisions of output files for given instance
1540
- grouped by output type and file name
1757
+ '200':
1758
+ description: Last revisions of output files for given instance grouped by output type and file name
1759
+ content:
1760
+ application/json:
1761
+ schema:
1762
+ type: object
1763
+ additionalProperties:
1764
+ type: object
1765
+ properties:
1766
+ id:
1767
+ type: string
1768
+ format: uuid
1769
+ name:
1770
+ type: string
1771
+ revision:
1772
+ type: integer
1773
+ path:
1774
+ type: string
1775
+ updated_at:
1776
+ type: string
1777
+ format: date-time
1778
+ '404':
1779
+ description: Asset instance or temporal entity not found
1541
1780
  """
1542
1781
  args = self.get_args(
1543
1782
  [
@@ -1684,29 +1923,59 @@ class InstanceOutputTypeOutputFilesResource(Resource, ArgsMixin):
1684
1923
  Get all output files for given asset instance and given output type.
1685
1924
  ---
1686
1925
  tags:
1687
- - Files
1926
+ - Files
1688
1927
  parameters:
1689
1928
  - in: path
1690
1929
  name: asset_instance_id
1691
1930
  required: true
1692
- type: string
1693
- format: uuid
1931
+ schema:
1932
+ type: string
1933
+ format: uuid
1694
1934
  example: a24a6ea4-ce75-4665-a070-57453082c25
1695
1935
  - in: path
1696
1936
  name: temporal_entity_id
1697
1937
  required: true
1698
- type: string
1699
- format: uuid
1938
+ schema:
1939
+ type: string
1940
+ format: uuid
1700
1941
  example: a24a6ea4-ce75-4665-a070-57453082c25
1701
1942
  - in: path
1702
1943
  name: output_type_id
1703
1944
  required: true
1704
- type: string
1705
- format: uuid
1945
+ schema:
1946
+ type: string
1947
+ format: uuid
1706
1948
  example: a24a6ea4-ce75-4665-a070-57453082c25
1707
1949
  responses:
1708
- 200:
1709
- description: All output files for given asset instance and given output type
1950
+ '200':
1951
+ description: All output files for given asset instance and given output type
1952
+ content:
1953
+ application/json:
1954
+ schema:
1955
+ type: array
1956
+ items:
1957
+ type: object
1958
+ properties:
1959
+ id:
1960
+ type: string
1961
+ format: uuid
1962
+ name:
1963
+ type: string
1964
+ revision:
1965
+ type: integer
1966
+ path:
1967
+ type: string
1968
+ updated_at:
1969
+ type: string
1970
+ format: date-time
1971
+ asset_instance_id:
1972
+ type: string
1973
+ format: uuid
1974
+ temporal_entity_id:
1975
+ type: string
1976
+ format: uuid
1977
+ '404':
1978
+ description: Asset instance, temporal entity, or output type not found
1710
1979
  """
1711
1980
  representation = self.get_text_parameter("representation")
1712
1981
 
@@ -1729,44 +1998,72 @@ class ProjectOutputFilesResource(Resource, ArgsMixin):
1729
1998
  @jwt_required()
1730
1999
  def get(self, project_id):
1731
2000
  """
1732
- Get all output files for given poject.
2001
+ Get all output files for given project.
1733
2002
  ---
1734
2003
  tags:
1735
- - Files
2004
+ - Files
1736
2005
  parameters:
1737
2006
  - in: path
1738
2007
  name: project_id
1739
2008
  required: true
1740
- type: string
1741
- format: uuid
2009
+ schema:
2010
+ type: string
2011
+ format: uuid
1742
2012
  example: a24a6ea4-ce75-4665-a070-57453082c25
1743
2013
  - in: query
1744
2014
  name: output_type_id
1745
2015
  required: true
1746
- type: string
1747
- format: uuid
2016
+ schema:
2017
+ type: string
2018
+ format: uuid
1748
2019
  example: a24a6ea4-ce75-4665-a070-57453082c25
1749
2020
  - in: query
1750
2021
  name: task_type_id
1751
2022
  required: true
1752
- type: string
1753
- format: uuid
2023
+ schema:
2024
+ type: string
2025
+ format: uuid
1754
2026
  example: a24a6ea4-ce75-4665-a070-57453082c25
1755
2027
  - in: query
1756
2028
  name: file_status_id
1757
2029
  required: true
1758
- type: string
1759
- format: uuid
2030
+ schema:
2031
+ type: string
2032
+ format: uuid
1760
2033
  example: a24a6ea4-ce75-4665-a070-57453082c25
1761
2034
  - in: query
1762
2035
  name: representation
1763
2036
  required: true
1764
- type: string
1765
- format: uuid
2037
+ schema:
2038
+ type: string
1766
2039
  example: cache
1767
2040
  responses:
1768
- 200:
1769
- description: All output files for given project.
2041
+ '200':
2042
+ description: All output files for given project
2043
+ content:
2044
+ application/json:
2045
+ schema:
2046
+ type: array
2047
+ items:
2048
+ type: object
2049
+ properties:
2050
+ id:
2051
+ type: string
2052
+ format: uuid
2053
+ name:
2054
+ type: string
2055
+ revision:
2056
+ type: integer
2057
+ path:
2058
+ type: string
2059
+ updated_at:
2060
+ type: string
2061
+ format: date-time
2062
+ project_id:
2063
+ type: string
2064
+ format: uuid
2065
+ '404':
2066
+ description: Project not found
1770
2067
  """
1771
2068
  args = self.get_args(
1772
2069
  [
@@ -1800,41 +2097,69 @@ class EntityOutputFilesResource(Resource, ArgsMixin):
1800
2097
  Get all output files for given entity.
1801
2098
  ---
1802
2099
  tags:
1803
- - Files
2100
+ - Files
1804
2101
  parameters:
1805
2102
  - in: path
1806
2103
  name: entity_id
1807
2104
  required: true
1808
- type: string
1809
- format: uuid
2105
+ schema:
2106
+ type: string
2107
+ format: uuid
1810
2108
  example: a24a6ea4-ce75-4665-a070-57453082c25
1811
2109
  - in: query
1812
2110
  name: output_type_id
1813
2111
  required: true
1814
- type: string
1815
- format: uuid
2112
+ schema:
2113
+ type: string
2114
+ format: uuid
1816
2115
  example: a24a6ea4-ce75-4665-a070-57453082c25
1817
2116
  - in: query
1818
2117
  name: task_type_id
1819
2118
  required: true
1820
- type: string
1821
- format: uuid
2119
+ schema:
2120
+ type: string
2121
+ format: uuid
1822
2122
  example: a24a6ea4-ce75-4665-a070-57453082c25
1823
2123
  - in: query
1824
2124
  name: file_status_id
1825
2125
  required: true
1826
- type: string
1827
- format: uuid
2126
+ schema:
2127
+ type: string
2128
+ format: uuid
1828
2129
  example: a24a6ea4-ce75-4665-a070-57453082c25
1829
2130
  - in: query
1830
2131
  name: representation
1831
2132
  required: true
1832
- type: string
1833
- format: uuid
2133
+ schema:
2134
+ type: string
1834
2135
  example: cache
1835
2136
  responses:
1836
- 200:
1837
- description: All output files for given entity
2137
+ '200':
2138
+ description: All output files for given entity
2139
+ content:
2140
+ application/json:
2141
+ schema:
2142
+ type: array
2143
+ items:
2144
+ type: object
2145
+ properties:
2146
+ id:
2147
+ type: string
2148
+ format: uuid
2149
+ name:
2150
+ type: string
2151
+ revision:
2152
+ type: integer
2153
+ path:
2154
+ type: string
2155
+ updated_at:
2156
+ type: string
2157
+ format: date-time
2158
+ entity_id:
2159
+ type: string
2160
+ format: uuid
2161
+ '404':
2162
+ description: Entity not found
1838
2163
  """
1839
2164
  args = self.get_args(
1840
2165
  [
@@ -1870,48 +2195,79 @@ class InstanceOutputFilesResource(Resource):
1870
2195
  Get all output files for given asset instance and given output type.
1871
2196
  ---
1872
2197
  tags:
1873
- - Files
2198
+ - Files
1874
2199
  parameters:
1875
2200
  - in: path
1876
2201
  name: asset_instance_id
1877
2202
  required: true
1878
- type: string
1879
- format: uuid
2203
+ schema:
2204
+ type: string
2205
+ format: uuid
1880
2206
  example: a24a6ea4-ce75-4665-a070-57453082c25
1881
2207
  - in: query
1882
2208
  name: temporal_entity_id
1883
2209
  required: true
1884
- type: string
1885
- format: uuid
1886
- example: cache
2210
+ schema:
2211
+ type: string
2212
+ format: uuid
2213
+ example: a24a6ea4-ce75-4665-a070-57453082c25
1887
2214
  - in: query
1888
2215
  name: output_type_id
1889
2216
  required: true
1890
- type: string
1891
- format: uuid
2217
+ schema:
2218
+ type: string
2219
+ format: uuid
1892
2220
  example: a24a6ea4-ce75-4665-a070-57453082c25
1893
2221
  - in: query
1894
2222
  name: task_type_id
1895
2223
  required: true
1896
- type: string
1897
- format: uuid
2224
+ schema:
2225
+ type: string
2226
+ format: uuid
1898
2227
  example: a24a6ea4-ce75-4665-a070-57453082c25
1899
2228
  - in: query
1900
2229
  name: file_status_id
1901
2230
  required: true
1902
- type: string
1903
- format: uuid
2231
+ schema:
2232
+ type: string
2233
+ format: uuid
1904
2234
  example: a24a6ea4-ce75-4665-a070-57453082c25
1905
2235
  - in: query
1906
2236
  name: representation
1907
2237
  required: true
1908
- type: string
1909
- format: uuid
2238
+ schema:
2239
+ type: string
1910
2240
  example: cache
1911
2241
  responses:
1912
- 200:
1913
- description: All output files for given asset instance and
1914
- given temporal entity (shot, sequence, etc.)
2242
+ '200':
2243
+ description: All output files for given asset instance and given temporal entity (shot, sequence, etc.)
2244
+ content:
2245
+ application/json:
2246
+ schema:
2247
+ type: array
2248
+ items:
2249
+ type: object
2250
+ properties:
2251
+ id:
2252
+ type: string
2253
+ format: uuid
2254
+ name:
2255
+ type: string
2256
+ revision:
2257
+ type: integer
2258
+ path:
2259
+ type: string
2260
+ updated_at:
2261
+ type: string
2262
+ format: date-time
2263
+ asset_instance_id:
2264
+ type: string
2265
+ format: uuid
2266
+ temporal_entity_id:
2267
+ type: string
2268
+ format: uuid
2269
+ '404':
2270
+ description: Asset instance or temporal entity not found
1915
2271
  """
1916
2272
  args = self.get_args(
1917
2273
  [
@@ -1947,17 +2303,43 @@ class FileResource(Resource):
1947
2303
  output file.
1948
2304
  ---
1949
2305
  tags:
1950
- - Files
2306
+ - Files
1951
2307
  parameters:
1952
2308
  - in: path
1953
2309
  name: file_id
1954
2310
  required: true
1955
- type: string
1956
- format: uuid
2311
+ schema:
2312
+ type: string
2313
+ format: uuid
1957
2314
  example: a24a6ea4-ce75-4665-a070-57453082c25
1958
2315
  responses:
1959
- 200:
1960
- description: Information about file
2316
+ '200':
2317
+ description: Information about file
2318
+ content:
2319
+ application/json:
2320
+ schema:
2321
+ type: object
2322
+ properties:
2323
+ id:
2324
+ type: string
2325
+ format: uuid
2326
+ name:
2327
+ type: string
2328
+ path:
2329
+ type: string
2330
+ revision:
2331
+ type: integer
2332
+ updated_at:
2333
+ type: string
2334
+ format: date-time
2335
+ task_id:
2336
+ type: string
2337
+ format: uuid
2338
+ entity_id:
2339
+ type: string
2340
+ format: uuid
2341
+ '404':
2342
+ description: File not found
1961
2343
  """
1962
2344
  try:
1963
2345
  file_dict = files_service.get_working_file(file_id)
@@ -1985,30 +2367,45 @@ class SetTreeResource(Resource, ArgsMixin):
1985
2367
  Define a template file to use for given project.
1986
2368
  ---
1987
2369
  tags:
1988
- - Files
2370
+ - Files
1989
2371
  description: Template files are located on the server side.
1990
2372
  Each template has a name which means that you just have to give a name to "select" the template to link with the project.
1991
2373
  parameters:
1992
2374
  - in: path
1993
2375
  name: project_id
1994
2376
  required: true
1995
- type: string
1996
- format: uuid
1997
- example: a24a6ea4-ce75-4665-a070-57453082c25
1998
- - in: body
1999
- name: Tree name
2000
2377
  schema:
2378
+ type: string
2379
+ format: uuid
2380
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2381
+ requestBody:
2382
+ required: true
2383
+ content:
2384
+ application/json:
2385
+ schema:
2001
2386
  type: object
2002
2387
  required:
2003
2388
  - tree_name
2004
2389
  properties:
2005
- tree_name:
2006
- type: string
2390
+ tree_name:
2391
+ type: string
2392
+ example: "default"
2007
2393
  responses:
2008
- 200:
2009
- description: Template file defined
2010
- 400:
2011
- description: Selected tree not available
2394
+ '200':
2395
+ description: Template file defined
2396
+ content:
2397
+ application/json:
2398
+ schema:
2399
+ type: object
2400
+ properties:
2401
+ success:
2402
+ type: boolean
2403
+ example: true
2404
+ tree_name:
2405
+ type: string
2406
+ example: "default"
2407
+ '400':
2408
+ description: Selected tree not available
2012
2409
  """
2013
2410
  args = self.get_args(
2014
2411
  [
@@ -2043,17 +2440,58 @@ class EntityWorkingFilesResource(Resource, ArgsMixin):
2043
2440
  Get all working files for a given entity and possibly a task and a name.
2044
2441
  ---
2045
2442
  tags:
2046
- - Files
2443
+ - Files
2047
2444
  parameters:
2048
2445
  - in: path
2049
2446
  name: entity_id
2050
2447
  required: true
2051
- type: string
2052
- format: uuid
2448
+ schema:
2449
+ type: string
2450
+ format: uuid
2053
2451
  example: a24a6ea4-ce75-4665-a070-57453082c25
2452
+ - in: query
2453
+ name: task_id
2454
+ required: false
2455
+ schema:
2456
+ type: string
2457
+ format: uuid
2458
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2459
+ - in: query
2460
+ name: name
2461
+ required: false
2462
+ schema:
2463
+ type: string
2464
+ example: main
2054
2465
  responses:
2055
- 200:
2056
- description: All working files for given entity and possibly a task and a name
2466
+ '200':
2467
+ description: All working files for given entity and possibly a task and a name
2468
+ content:
2469
+ application/json:
2470
+ schema:
2471
+ type: array
2472
+ items:
2473
+ type: object
2474
+ properties:
2475
+ id:
2476
+ type: string
2477
+ format: uuid
2478
+ name:
2479
+ type: string
2480
+ revision:
2481
+ type: integer
2482
+ path:
2483
+ type: string
2484
+ updated_at:
2485
+ type: string
2486
+ format: date-time
2487
+ task_id:
2488
+ type: string
2489
+ format: uuid
2490
+ entity_id:
2491
+ type: string
2492
+ format: uuid
2493
+ '404':
2494
+ description: Entity not found
2057
2495
  """
2058
2496
  args = self.get_args(
2059
2497
  [
@@ -2083,6 +2521,64 @@ class GuessFromPathResource(Resource, ArgsMixin):
2083
2521
 
2084
2522
  @jwt_required()
2085
2523
  def post(self):
2524
+ """
2525
+ Get list of possible project file tree templates matching a file path
2526
+ and data ids corresponding to template tokens.
2527
+ ---
2528
+ tags:
2529
+ - Files
2530
+ requestBody:
2531
+ required: true
2532
+ content:
2533
+ application/json:
2534
+ schema:
2535
+ type: object
2536
+ required:
2537
+ - project_id
2538
+ - file_path
2539
+ properties:
2540
+ project_id:
2541
+ type: string
2542
+ format: uuid
2543
+ example: a24a6ea4-ce75-4665-a070-57453082c25
2544
+ file_path:
2545
+ type: string
2546
+ example: "/project/asset/working/main_v001.blend"
2547
+ sep:
2548
+ type: string
2549
+ default: /
2550
+ example: /
2551
+ responses:
2552
+ '200':
2553
+ description: List of possible project file tree templates matching the file path
2554
+ content:
2555
+ application/json:
2556
+ schema:
2557
+ type: object
2558
+ properties:
2559
+ matches:
2560
+ type: array
2561
+ items:
2562
+ type: object
2563
+ properties:
2564
+ template:
2565
+ type: string
2566
+ example: "default"
2567
+ confidence:
2568
+ type: number
2569
+ example: 0.95
2570
+ data:
2571
+ type: object
2572
+ properties:
2573
+ project_id:
2574
+ type: string
2575
+ format: uuid
2576
+ entity_id:
2577
+ type: string
2578
+ format: uuid
2579
+ '400':
2580
+ description: Invalid project ID or file path
2581
+ """
2086
2582
  data = self.get_arguments()
2087
2583
 
2088
2584
  return file_tree_service.guess_from_path(