zou 0.20.83__py3-none-any.whl → 0.20.85__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.
- zou/__init__.py +1 -1
- zou/app/blueprints/comments/resources.py +32 -35
- zou/app/blueprints/concepts/resources.py +23 -8
- zou/app/blueprints/crud/asset_instance.py +272 -0
- zou/app/blueprints/crud/attachment_file.py +263 -0
- zou/app/blueprints/crud/base.py +176 -69
- zou/app/blueprints/crud/budget.py +278 -0
- zou/app/blueprints/crud/budget_entry.py +269 -0
- zou/app/blueprints/crud/chat.py +282 -0
- zou/app/blueprints/crud/chat_message.py +286 -0
- zou/app/blueprints/crud/comments.py +312 -1
- zou/app/blueprints/crud/custom_action.py +268 -0
- zou/app/blueprints/crud/day_off.py +298 -0
- zou/app/blueprints/crud/department.py +268 -0
- zou/app/blueprints/crud/entity.py +297 -3
- zou/app/blueprints/crud/entity_link.py +303 -0
- zou/app/blueprints/crud/entity_type.py +269 -0
- zou/app/blueprints/crud/event.py +197 -0
- zou/app/blueprints/crud/file_status.py +268 -0
- zou/app/blueprints/crud/hardware_item.py +268 -0
- zou/app/blueprints/crud/metadata_descriptor.py +312 -0
- zou/app/blueprints/crud/milestone.py +302 -1
- zou/app/blueprints/crud/news.py +285 -0
- zou/app/blueprints/crud/notification.py +287 -0
- zou/app/blueprints/crud/organisation.py +269 -0
- zou/app/blueprints/crud/output_file.py +34 -10
- zou/app/blueprints/crud/output_type.py +30 -10
- zou/app/blueprints/crud/person.py +407 -2
- zou/app/blueprints/crud/playlist.py +322 -4
- zou/app/blueprints/crud/plugin.py +269 -0
- zou/app/blueprints/crud/preview_background_file.py +272 -0
- zou/app/blueprints/crud/preview_file.py +280 -9
- zou/app/blueprints/crud/production_schedule_version.py +569 -0
- zou/app/blueprints/crud/project.py +440 -0
- zou/app/blueprints/crud/project_status.py +268 -0
- zou/app/blueprints/crud/salary_scale.py +185 -5
- zou/app/blueprints/crud/schedule_item.py +305 -0
- zou/app/blueprints/crud/search_filter.py +302 -0
- zou/app/blueprints/crud/search_filter_group.py +270 -0
- zou/app/blueprints/crud/software.py +30 -10
- zou/app/blueprints/crud/status_automation.py +296 -2
- zou/app/blueprints/crud/studio.py +268 -0
- zou/app/blueprints/crud/subscription.py +279 -0
- zou/app/blueprints/crud/task.py +325 -5
- zou/app/blueprints/crud/task_status.py +301 -0
- zou/app/blueprints/crud/task_type.py +283 -0
- zou/app/blueprints/crud/time_spent.py +327 -0
- zou/app/blueprints/crud/working_file.py +273 -10
- zou/app/blueprints/export/csv/assets.py +15 -5
- zou/app/blueprints/export/csv/base.py +12 -3
- zou/app/blueprints/export/csv/casting.py +32 -5
- zou/app/blueprints/export/csv/edits.py +15 -5
- zou/app/blueprints/export/csv/persons.py +24 -0
- zou/app/blueprints/export/csv/playlists.py +16 -5
- zou/app/blueprints/export/csv/projects.py +23 -0
- zou/app/blueprints/export/csv/shots.py +15 -5
- zou/app/blueprints/export/csv/task_types.py +23 -0
- zou/app/blueprints/export/csv/tasks.py +24 -0
- zou/app/blueprints/export/csv/time_spents.py +24 -0
- zou/app/blueprints/files/resources.py +928 -377
- zou/app/blueprints/news/resources.py +7 -5
- zou/app/blueprints/persons/resources.py +644 -271
- zou/app/blueprints/playlists/resources.py +154 -72
- zou/app/blueprints/previews/resources.py +473 -228
- zou/app/blueprints/projects/__init__.py +5 -0
- zou/app/blueprints/projects/resources.py +987 -420
- zou/app/blueprints/search/resources.py +44 -32
- zou/app/blueprints/shots/resources.py +1338 -88
- zou/app/blueprints/source/csv/assets.py +44 -6
- zou/app/blueprints/source/csv/casting.py +43 -6
- zou/app/blueprints/source/csv/edits.py +47 -9
- zou/app/blueprints/source/csv/persons.py +43 -4
- zou/app/blueprints/source/csv/shots.py +47 -6
- zou/app/blueprints/source/csv/task_type_estimations.py +95 -35
- zou/app/blueprints/source/kitsu.py +433 -11
- zou/app/blueprints/source/otio.py +215 -20
- zou/app/blueprints/source/shotgun/assets.py +146 -0
- zou/app/blueprints/source/shotgun/base.py +85 -14
- zou/app/blueprints/source/shotgun/episode.py +124 -0
- zou/app/blueprints/source/shotgun/import_errors.py +105 -14
- zou/app/blueprints/source/shotgun/notes.py +132 -0
- zou/app/blueprints/source/shotgun/person.py +163 -0
- zou/app/blueprints/source/shotgun/project.py +120 -0
- zou/app/blueprints/source/shotgun/scene.py +120 -0
- zou/app/blueprints/source/shotgun/sequence.py +134 -0
- zou/app/blueprints/source/shotgun/shot.py +166 -0
- zou/app/blueprints/source/shotgun/status.py +129 -0
- zou/app/blueprints/source/shotgun/steps.py +138 -0
- zou/app/blueprints/source/shotgun/tasks.py +199 -0
- zou/app/blueprints/source/shotgun/team.py +132 -0
- zou/app/blueprints/source/shotgun/versions.py +155 -0
- zou/app/blueprints/tasks/resources.py +1197 -308
- zou/app/models/metadata_descriptor.py +1 -0
- zou/app/services/persons_service.py +1 -1
- zou/app/services/projects_service.py +45 -1
- zou/app/services/time_spents_service.py +1 -1
- zou/migrations/versions/a1b2c3d4e5f6_add_position_to_metadata_descriptor.py +32 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/METADATA +18 -18
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/RECORD +103 -102
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/WHEEL +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/entry_points.txt +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/licenses/LICENSE +0 -0
- {zou-0.20.83.dist-info → zou-0.20.85.dist-info}/top_level.txt +0 -0
zou/__init__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.20.
|
|
1
|
+
__version__ = "0.20.85"
|
|
@@ -20,12 +20,14 @@ from zou.app import config
|
|
|
20
20
|
|
|
21
21
|
|
|
22
22
|
class DownloadAttachmentResource(Resource):
|
|
23
|
+
|
|
23
24
|
@jwt_required()
|
|
24
25
|
def get(self, attachment_file_id, file_name):
|
|
25
26
|
"""
|
|
26
27
|
Download attachment file
|
|
27
28
|
---
|
|
28
|
-
description: Download a specific attachment file from a comment or chat
|
|
29
|
+
description: Download a specific attachment file from a comment or chat
|
|
30
|
+
message. Supports various file types including images and documents.
|
|
29
31
|
tags:
|
|
30
32
|
- Comments
|
|
31
33
|
produces:
|
|
@@ -96,17 +98,14 @@ class DownloadAttachmentResource(Resource):
|
|
|
96
98
|
|
|
97
99
|
|
|
98
100
|
class AckCommentResource(Resource):
|
|
99
|
-
"""
|
|
100
|
-
Acknowledge given comment. If it's already acknowledged, remove
|
|
101
|
-
acknowledgement.
|
|
102
|
-
"""
|
|
103
101
|
|
|
104
102
|
@jwt_required()
|
|
105
103
|
def post(self, task_id, comment_id):
|
|
106
104
|
"""
|
|
107
105
|
Acknowledge comment
|
|
108
106
|
---
|
|
109
|
-
description: Acknowledge a specific comment. If it's already
|
|
107
|
+
description: Acknowledge a specific comment. If it's already
|
|
108
|
+
acknowledged, remove the acknowledgement.
|
|
110
109
|
tags:
|
|
111
110
|
- Comments
|
|
112
111
|
parameters:
|
|
@@ -147,19 +146,16 @@ class AckCommentResource(Resource):
|
|
|
147
146
|
|
|
148
147
|
|
|
149
148
|
class CommentTaskResource(Resource):
|
|
150
|
-
"""
|
|
151
|
-
Creates a new comment for given task. It requires a text, a task_status
|
|
152
|
-
and a person as arguments. This way, comments keep history of status
|
|
153
|
-
changes. When the comment is created, it updates the task status with
|
|
154
|
-
given task status.
|
|
155
|
-
"""
|
|
156
149
|
|
|
157
150
|
@jwt_required()
|
|
158
151
|
def post(self, task_id):
|
|
159
152
|
"""
|
|
160
153
|
Create task comment
|
|
161
154
|
---
|
|
162
|
-
description: Create a new comment for a specific task. It requires a
|
|
155
|
+
description: Create a new comment for a specific task. It requires a
|
|
156
|
+
text, a task_status and a person as arguments. This way, comments
|
|
157
|
+
keep history of status changes. When the comment is created, it
|
|
158
|
+
updates the task status with the given task status.
|
|
163
159
|
tags:
|
|
164
160
|
- Comments
|
|
165
161
|
parameters:
|
|
@@ -326,7 +322,8 @@ class AttachmentResource(Resource):
|
|
|
326
322
|
"""
|
|
327
323
|
Delete comment attachment
|
|
328
324
|
---
|
|
329
|
-
description: Delete a specific attachment file linked to a comment. Only
|
|
325
|
+
description: Delete a specific attachment file linked to a comment. Only
|
|
326
|
+
the comment author or project managers can delete attachments.
|
|
330
327
|
tags:
|
|
331
328
|
- Comments
|
|
332
329
|
parameters:
|
|
@@ -371,7 +368,8 @@ class AddAttachmentToCommentResource(Resource):
|
|
|
371
368
|
"""
|
|
372
369
|
Add comment attachments
|
|
373
370
|
---
|
|
374
|
-
description: Add one or more files as attachments to a specific comment.
|
|
371
|
+
description: Add one or more files as attachments to a specific comment.
|
|
372
|
+
Supports various file types including images and documents.
|
|
375
373
|
tags:
|
|
376
374
|
- Comments
|
|
377
375
|
consumes:
|
|
@@ -452,19 +450,17 @@ class AddAttachmentToCommentResource(Resource):
|
|
|
452
450
|
|
|
453
451
|
|
|
454
452
|
class CommentManyTasksResource(Resource):
|
|
455
|
-
"""
|
|
456
|
-
Create several comments at once. Each comment requires a text, a task id,
|
|
457
|
-
a task_status and a person as arguments. This way, comments keep history of
|
|
458
|
-
status changes. When the comment is created, it updates the task status with
|
|
459
|
-
given task status.
|
|
460
|
-
"""
|
|
461
453
|
|
|
462
454
|
@jwt_required()
|
|
463
455
|
def post(self, project_id):
|
|
464
456
|
"""
|
|
465
457
|
Create multiple comments
|
|
466
458
|
---
|
|
467
|
-
description: Create several comments at once for a specific project.
|
|
459
|
+
description: Create several comments at once for a specific project.
|
|
460
|
+
Each comment requires a text, a task id, a task_status and a person as
|
|
461
|
+
arguments. This way, comments keep history of status changes. When
|
|
462
|
+
the comment is created, it updates the task status with the given
|
|
463
|
+
task status.
|
|
468
464
|
tags:
|
|
469
465
|
- Comments
|
|
470
466
|
parameters:
|
|
@@ -614,16 +610,14 @@ class CommentManyTasksResource(Resource):
|
|
|
614
610
|
|
|
615
611
|
|
|
616
612
|
class ReplyCommentResource(Resource, ArgsMixin):
|
|
617
|
-
"""
|
|
618
|
-
Reply to given comment. Add comment to its replies list.
|
|
619
|
-
"""
|
|
620
613
|
|
|
621
614
|
@jwt_required()
|
|
622
615
|
def post(self, task_id, comment_id):
|
|
623
616
|
"""
|
|
624
617
|
Reply to comment
|
|
625
618
|
---
|
|
626
|
-
description: Add a reply to a specific comment. The reply will be added
|
|
619
|
+
description: Add a reply to a specific comment. The reply will be added
|
|
620
|
+
to the comment's replies list.
|
|
627
621
|
tags:
|
|
628
622
|
- Comments
|
|
629
623
|
parameters:
|
|
@@ -703,16 +697,14 @@ class ReplyCommentResource(Resource, ArgsMixin):
|
|
|
703
697
|
|
|
704
698
|
|
|
705
699
|
class DeleteReplyCommentResource(Resource):
|
|
706
|
-
"""
|
|
707
|
-
Delete given comment reply.
|
|
708
|
-
"""
|
|
709
700
|
|
|
710
701
|
@jwt_required()
|
|
711
702
|
def delete(self, task_id, comment_id, reply_id):
|
|
712
703
|
"""
|
|
713
704
|
Delete comment reply
|
|
714
705
|
---
|
|
715
|
-
description: Delete a specific reply from a comment.
|
|
706
|
+
description: Delete a specific reply from a comment.
|
|
707
|
+
Only the reply author or administrators can delete replies.
|
|
716
708
|
tags:
|
|
717
709
|
- Comments
|
|
718
710
|
parameters:
|
|
@@ -749,12 +741,14 @@ class DeleteReplyCommentResource(Resource):
|
|
|
749
741
|
|
|
750
742
|
|
|
751
743
|
class ProjectAttachmentFiles(Resource):
|
|
744
|
+
|
|
752
745
|
@jwt_required()
|
|
753
746
|
def get(self, project_id):
|
|
754
747
|
"""
|
|
755
748
|
Get project attachment files
|
|
756
749
|
---
|
|
757
|
-
description: Retrieve all attachment files related to a specific
|
|
750
|
+
description: Retrieve all attachment files related to a specific
|
|
751
|
+
project. Requires administrator permissions.
|
|
758
752
|
tags:
|
|
759
753
|
- Comments
|
|
760
754
|
parameters:
|
|
@@ -810,16 +804,14 @@ class ProjectAttachmentFiles(Resource):
|
|
|
810
804
|
|
|
811
805
|
|
|
812
806
|
class TaskAttachmentFiles(Resource):
|
|
813
|
-
"""
|
|
814
|
-
Return all attachment files related to given task.
|
|
815
|
-
"""
|
|
816
807
|
|
|
817
808
|
@jwt_required()
|
|
818
809
|
def get(self, task_id):
|
|
819
810
|
"""
|
|
820
811
|
Get task attachment files
|
|
821
812
|
---
|
|
822
|
-
description: Retrieve all attachment files related to a specific task.
|
|
813
|
+
description: Retrieve all attachment files related to a specific task.
|
|
814
|
+
Requires administrator permissions.
|
|
823
815
|
tags:
|
|
824
816
|
- Comments
|
|
825
817
|
parameters:
|
|
@@ -867,6 +859,11 @@ class TaskAttachmentFiles(Resource):
|
|
|
867
859
|
format: uuid
|
|
868
860
|
description: Task identifier
|
|
869
861
|
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
862
|
+
reply_id:
|
|
863
|
+
type: string
|
|
864
|
+
format: uuid
|
|
865
|
+
description: Reply identifier if attached to a reply
|
|
866
|
+
example: c46c8gc6-eg97-6887-c292-79675204e47
|
|
870
867
|
"""
|
|
871
868
|
permissions.check_admin_permissions()
|
|
872
869
|
return comments_service.get_all_attachment_files_for_task(task_id)
|
|
@@ -16,12 +16,14 @@ from zou.app.utils import query, permissions
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
class ConceptResource(Resource, ArgsMixin):
|
|
19
|
+
|
|
19
20
|
@jwt_required()
|
|
20
21
|
def get(self, concept_id):
|
|
21
22
|
"""
|
|
22
23
|
Get concept
|
|
23
24
|
---
|
|
24
|
-
description: Retrieve detailed information about a specific concept
|
|
25
|
+
description: Retrieve detailed information about a specific concept
|
|
26
|
+
including metadata, project context, and related data.
|
|
25
27
|
tags:
|
|
26
28
|
- Concepts
|
|
27
29
|
parameters:
|
|
@@ -84,7 +86,8 @@ class ConceptResource(Resource, ArgsMixin):
|
|
|
84
86
|
"""
|
|
85
87
|
Delete concept
|
|
86
88
|
---
|
|
87
|
-
description: Permanently remove a concept from the system. Only concept
|
|
89
|
+
description: Permanently remove a concept from the system. Only concept
|
|
90
|
+
creators or project managers can delete concepts.
|
|
88
91
|
tags:
|
|
89
92
|
- Concepts
|
|
90
93
|
parameters:
|
|
@@ -116,12 +119,15 @@ class ConceptResource(Resource, ArgsMixin):
|
|
|
116
119
|
|
|
117
120
|
|
|
118
121
|
class AllConceptsResource(Resource):
|
|
122
|
+
|
|
119
123
|
@jwt_required()
|
|
120
124
|
def get(self):
|
|
121
125
|
"""
|
|
122
126
|
Get all concepts
|
|
123
127
|
---
|
|
124
|
-
description: Retrieve all concept entries with filtering support.
|
|
128
|
+
description: Retrieve all concept entries with filtering support.
|
|
129
|
+
Filters can be specified in the query string to narrow down results by
|
|
130
|
+
project or parent concept.
|
|
125
131
|
tags:
|
|
126
132
|
- Concepts
|
|
127
133
|
parameters:
|
|
@@ -194,12 +200,14 @@ class AllConceptsResource(Resource):
|
|
|
194
200
|
|
|
195
201
|
|
|
196
202
|
class ConceptTaskTypesResource(Resource):
|
|
203
|
+
|
|
197
204
|
@jwt_required()
|
|
198
205
|
def get(self, concept_id):
|
|
199
206
|
"""
|
|
200
207
|
Get concept task types
|
|
201
208
|
---
|
|
202
|
-
description: Retrieve all task types that are related to a specific
|
|
209
|
+
description: Retrieve all task types that are related to a specific
|
|
210
|
+
concept.
|
|
203
211
|
tags:
|
|
204
212
|
- Concepts
|
|
205
213
|
parameters:
|
|
@@ -251,6 +259,7 @@ class ConceptTaskTypesResource(Resource):
|
|
|
251
259
|
|
|
252
260
|
|
|
253
261
|
class ConceptTasksResource(Resource, ArgsMixin):
|
|
262
|
+
|
|
254
263
|
@jwt_required()
|
|
255
264
|
def get(self, concept_id):
|
|
256
265
|
"""
|
|
@@ -335,12 +344,15 @@ class ConceptTasksResource(Resource, ArgsMixin):
|
|
|
335
344
|
|
|
336
345
|
|
|
337
346
|
class ConceptPreviewsResource(Resource):
|
|
347
|
+
|
|
338
348
|
@jwt_required()
|
|
339
349
|
def get(self, concept_id):
|
|
340
350
|
"""
|
|
341
351
|
Get concept previews
|
|
342
352
|
---
|
|
343
|
-
description: Retrieve all preview files related to a specific concept.
|
|
353
|
+
description: Retrieve all preview files related to a specific concept.
|
|
354
|
+
Returns them as a dictionary where keys are related task type IDs and
|
|
355
|
+
values are arrays of previews for that task type.
|
|
344
356
|
tags:
|
|
345
357
|
- Concepts
|
|
346
358
|
parameters:
|
|
@@ -405,7 +417,8 @@ class ConceptsAndTasksResource(Resource):
|
|
|
405
417
|
"""
|
|
406
418
|
Get concepts and tasks
|
|
407
419
|
---
|
|
408
|
-
description: Retrieve all concepts and all related tasks included in the
|
|
420
|
+
description: Retrieve all concepts and all related tasks included in the
|
|
421
|
+
response.
|
|
409
422
|
tags:
|
|
410
423
|
- Concepts
|
|
411
424
|
parameters:
|
|
@@ -498,7 +511,8 @@ class ProjectConceptsResource(Resource, ArgsMixin):
|
|
|
498
511
|
"""
|
|
499
512
|
Get project concepts
|
|
500
513
|
---
|
|
501
|
-
description: Retrieve all concepts that are related to a specific
|
|
514
|
+
description: Retrieve all concepts that are related to a specific
|
|
515
|
+
project.
|
|
502
516
|
tags:
|
|
503
517
|
- Concepts
|
|
504
518
|
parameters:
|
|
@@ -564,7 +578,8 @@ class ProjectConceptsResource(Resource, ArgsMixin):
|
|
|
564
578
|
"""
|
|
565
579
|
Create concept
|
|
566
580
|
---
|
|
567
|
-
description: Create a new concept for a specific project with name,
|
|
581
|
+
description: Create a new concept for a specific project with name,
|
|
582
|
+
description, and optional entity concept links.
|
|
568
583
|
tags:
|
|
569
584
|
- Concepts
|
|
570
585
|
parameters:
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.asset_instance import AssetInstance
|
|
2
4
|
|
|
3
5
|
from zou.app.services import assets_service, user_service
|
|
@@ -10,12 +12,282 @@ class AssetInstancesResource(BaseModelsResource):
|
|
|
10
12
|
def __init__(self):
|
|
11
13
|
BaseModelsResource.__init__(self, AssetInstance)
|
|
12
14
|
|
|
15
|
+
@jwt_required()
|
|
16
|
+
def get(self):
|
|
17
|
+
"""
|
|
18
|
+
Get asset instances
|
|
19
|
+
---
|
|
20
|
+
tags:
|
|
21
|
+
- Crud
|
|
22
|
+
description: Retrieve all asset instances. Supports filtering via
|
|
23
|
+
query parameters and pagination.
|
|
24
|
+
parameters:
|
|
25
|
+
- in: query
|
|
26
|
+
name: page
|
|
27
|
+
required: false
|
|
28
|
+
schema:
|
|
29
|
+
type: integer
|
|
30
|
+
example: 1
|
|
31
|
+
description: Page number for pagination
|
|
32
|
+
- in: query
|
|
33
|
+
name: limit
|
|
34
|
+
required: false
|
|
35
|
+
schema:
|
|
36
|
+
type: integer
|
|
37
|
+
example: 50
|
|
38
|
+
description: Number of results per page
|
|
39
|
+
- in: query
|
|
40
|
+
name: relations
|
|
41
|
+
required: false
|
|
42
|
+
schema:
|
|
43
|
+
type: boolean
|
|
44
|
+
default: false
|
|
45
|
+
example: false
|
|
46
|
+
description: Whether to include relations
|
|
47
|
+
responses:
|
|
48
|
+
200:
|
|
49
|
+
description: Asset instances retrieved successfully
|
|
50
|
+
content:
|
|
51
|
+
application/json:
|
|
52
|
+
schema:
|
|
53
|
+
oneOf:
|
|
54
|
+
- type: array
|
|
55
|
+
items:
|
|
56
|
+
type: object
|
|
57
|
+
- type: object
|
|
58
|
+
properties:
|
|
59
|
+
data:
|
|
60
|
+
type: array
|
|
61
|
+
items:
|
|
62
|
+
type: object
|
|
63
|
+
example: []
|
|
64
|
+
total:
|
|
65
|
+
type: integer
|
|
66
|
+
example: 100
|
|
67
|
+
nb_pages:
|
|
68
|
+
type: integer
|
|
69
|
+
example: 2
|
|
70
|
+
limit:
|
|
71
|
+
type: integer
|
|
72
|
+
example: 50
|
|
73
|
+
offset:
|
|
74
|
+
type: integer
|
|
75
|
+
example: 0
|
|
76
|
+
page:
|
|
77
|
+
type: integer
|
|
78
|
+
example: 1
|
|
79
|
+
400:
|
|
80
|
+
description: Invalid filter format or query error
|
|
81
|
+
"""
|
|
82
|
+
return super().get()
|
|
83
|
+
|
|
84
|
+
@jwt_required()
|
|
85
|
+
def post(self):
|
|
86
|
+
"""
|
|
87
|
+
Create asset instance
|
|
88
|
+
---
|
|
89
|
+
tags:
|
|
90
|
+
- Crud
|
|
91
|
+
description: Create a new asset instance with data provided in the
|
|
92
|
+
request body. JSON format is expected.
|
|
93
|
+
requestBody:
|
|
94
|
+
required: true
|
|
95
|
+
content:
|
|
96
|
+
application/json:
|
|
97
|
+
schema:
|
|
98
|
+
type: object
|
|
99
|
+
required:
|
|
100
|
+
- asset_id
|
|
101
|
+
properties:
|
|
102
|
+
asset_id:
|
|
103
|
+
type: string
|
|
104
|
+
format: uuid
|
|
105
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
106
|
+
name:
|
|
107
|
+
type: string
|
|
108
|
+
example: Instance Name
|
|
109
|
+
responses:
|
|
110
|
+
201:
|
|
111
|
+
description: Asset instance created successfully
|
|
112
|
+
content:
|
|
113
|
+
application/json:
|
|
114
|
+
schema:
|
|
115
|
+
type: object
|
|
116
|
+
properties:
|
|
117
|
+
id:
|
|
118
|
+
type: string
|
|
119
|
+
format: uuid
|
|
120
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
121
|
+
asset_id:
|
|
122
|
+
type: string
|
|
123
|
+
format: uuid
|
|
124
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
125
|
+
name:
|
|
126
|
+
type: string
|
|
127
|
+
example: Instance Name
|
|
128
|
+
created_at:
|
|
129
|
+
type: string
|
|
130
|
+
format: date-time
|
|
131
|
+
example: "2024-01-15T10:30:00Z"
|
|
132
|
+
updated_at:
|
|
133
|
+
type: string
|
|
134
|
+
format: date-time
|
|
135
|
+
example: "2024-01-15T10:30:00Z"
|
|
136
|
+
400:
|
|
137
|
+
description: Invalid data format or validation error
|
|
138
|
+
"""
|
|
139
|
+
return super().post()
|
|
140
|
+
|
|
13
141
|
|
|
14
142
|
class AssetInstanceResource(BaseModelResource):
|
|
15
143
|
def __init__(self):
|
|
16
144
|
BaseModelResource.__init__(self, AssetInstance)
|
|
17
145
|
self.protected_fields.append("number")
|
|
18
146
|
|
|
147
|
+
@jwt_required()
|
|
148
|
+
def get(self, instance_id):
|
|
149
|
+
"""
|
|
150
|
+
Get asset instance
|
|
151
|
+
---
|
|
152
|
+
tags:
|
|
153
|
+
- Crud
|
|
154
|
+
description: Retrieve an asset instance by its ID and return it as a
|
|
155
|
+
JSON object. Supports including relations.
|
|
156
|
+
parameters:
|
|
157
|
+
- in: path
|
|
158
|
+
name: instance_id
|
|
159
|
+
required: true
|
|
160
|
+
schema:
|
|
161
|
+
type: string
|
|
162
|
+
format: uuid
|
|
163
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
164
|
+
- in: query
|
|
165
|
+
name: relations
|
|
166
|
+
required: false
|
|
167
|
+
schema:
|
|
168
|
+
type: boolean
|
|
169
|
+
default: true
|
|
170
|
+
example: true
|
|
171
|
+
description: Whether to include relations
|
|
172
|
+
responses:
|
|
173
|
+
200:
|
|
174
|
+
description: Asset instance retrieved successfully
|
|
175
|
+
content:
|
|
176
|
+
application/json:
|
|
177
|
+
schema:
|
|
178
|
+
type: object
|
|
179
|
+
properties:
|
|
180
|
+
id:
|
|
181
|
+
type: string
|
|
182
|
+
format: uuid
|
|
183
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
184
|
+
asset_id:
|
|
185
|
+
type: string
|
|
186
|
+
format: uuid
|
|
187
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
188
|
+
name:
|
|
189
|
+
type: string
|
|
190
|
+
example: Instance Name
|
|
191
|
+
number:
|
|
192
|
+
type: integer
|
|
193
|
+
example: 1
|
|
194
|
+
created_at:
|
|
195
|
+
type: string
|
|
196
|
+
format: date-time
|
|
197
|
+
example: "2024-01-15T10:30:00Z"
|
|
198
|
+
updated_at:
|
|
199
|
+
type: string
|
|
200
|
+
format: date-time
|
|
201
|
+
example: "2024-01-15T10:30:00Z"
|
|
202
|
+
400:
|
|
203
|
+
description: Invalid ID format or query error
|
|
204
|
+
"""
|
|
205
|
+
return super().get(instance_id)
|
|
206
|
+
|
|
207
|
+
@jwt_required()
|
|
208
|
+
def put(self, instance_id):
|
|
209
|
+
"""
|
|
210
|
+
Update asset instance
|
|
211
|
+
---
|
|
212
|
+
tags:
|
|
213
|
+
- Crud
|
|
214
|
+
description: Update an asset instance with data provided in the
|
|
215
|
+
request body. JSON format is expected.
|
|
216
|
+
parameters:
|
|
217
|
+
- in: path
|
|
218
|
+
name: instance_id
|
|
219
|
+
required: true
|
|
220
|
+
schema:
|
|
221
|
+
type: string
|
|
222
|
+
format: uuid
|
|
223
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
224
|
+
requestBody:
|
|
225
|
+
required: true
|
|
226
|
+
content:
|
|
227
|
+
application/json:
|
|
228
|
+
schema:
|
|
229
|
+
type: object
|
|
230
|
+
properties:
|
|
231
|
+
name:
|
|
232
|
+
type: string
|
|
233
|
+
example: Updated Instance Name
|
|
234
|
+
responses:
|
|
235
|
+
200:
|
|
236
|
+
description: Asset instance updated successfully
|
|
237
|
+
content:
|
|
238
|
+
application/json:
|
|
239
|
+
schema:
|
|
240
|
+
type: object
|
|
241
|
+
properties:
|
|
242
|
+
id:
|
|
243
|
+
type: string
|
|
244
|
+
format: uuid
|
|
245
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
246
|
+
asset_id:
|
|
247
|
+
type: string
|
|
248
|
+
format: uuid
|
|
249
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
250
|
+
name:
|
|
251
|
+
type: string
|
|
252
|
+
example: Updated Instance Name
|
|
253
|
+
created_at:
|
|
254
|
+
type: string
|
|
255
|
+
format: date-time
|
|
256
|
+
example: "2024-01-15T10:30:00Z"
|
|
257
|
+
updated_at:
|
|
258
|
+
type: string
|
|
259
|
+
format: date-time
|
|
260
|
+
example: "2024-01-15T11:00:00Z"
|
|
261
|
+
400:
|
|
262
|
+
description: Invalid data format or validation error
|
|
263
|
+
"""
|
|
264
|
+
return super().put(instance_id)
|
|
265
|
+
|
|
266
|
+
@jwt_required()
|
|
267
|
+
def delete(self, instance_id):
|
|
268
|
+
"""
|
|
269
|
+
Delete asset instance
|
|
270
|
+
---
|
|
271
|
+
tags:
|
|
272
|
+
- Crud
|
|
273
|
+
description: Delete an asset instance by its ID. Returns empty
|
|
274
|
+
response on success.
|
|
275
|
+
parameters:
|
|
276
|
+
- in: path
|
|
277
|
+
name: instance_id
|
|
278
|
+
required: true
|
|
279
|
+
schema:
|
|
280
|
+
type: string
|
|
281
|
+
format: uuid
|
|
282
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
283
|
+
responses:
|
|
284
|
+
204:
|
|
285
|
+
description: Asset instance deleted successfully
|
|
286
|
+
400:
|
|
287
|
+
description: Integrity error or cannot delete
|
|
288
|
+
"""
|
|
289
|
+
return super().delete(instance_id)
|
|
290
|
+
|
|
19
291
|
def check_read_permissions(self, instance):
|
|
20
292
|
if permissions.has_admin_permissions():
|
|
21
293
|
return True
|