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
|
@@ -58,6 +58,156 @@ class EntitiesResource(BaseModelsResource, EntityEventMixin):
|
|
|
58
58
|
def check_create_permissions(self, entity):
|
|
59
59
|
user_service.check_manager_project_access(entity["project_id"])
|
|
60
60
|
|
|
61
|
+
@jwt_required()
|
|
62
|
+
def get(self):
|
|
63
|
+
"""
|
|
64
|
+
Get entities
|
|
65
|
+
---
|
|
66
|
+
tags:
|
|
67
|
+
- Crud
|
|
68
|
+
description: Retrieve all entities. Supports filtering via query
|
|
69
|
+
parameters and pagination. Includes project permission filtering
|
|
70
|
+
for non-admin users.
|
|
71
|
+
parameters:
|
|
72
|
+
- in: query
|
|
73
|
+
name: page
|
|
74
|
+
required: false
|
|
75
|
+
schema:
|
|
76
|
+
type: integer
|
|
77
|
+
example: 1
|
|
78
|
+
description: Page number for pagination
|
|
79
|
+
- in: query
|
|
80
|
+
name: limit
|
|
81
|
+
required: false
|
|
82
|
+
schema:
|
|
83
|
+
type: integer
|
|
84
|
+
example: 50
|
|
85
|
+
description: Number of results per page
|
|
86
|
+
- in: query
|
|
87
|
+
name: relations
|
|
88
|
+
required: false
|
|
89
|
+
schema:
|
|
90
|
+
type: boolean
|
|
91
|
+
default: false
|
|
92
|
+
example: false
|
|
93
|
+
description: Whether to include relations
|
|
94
|
+
responses:
|
|
95
|
+
200:
|
|
96
|
+
description: Entities retrieved successfully
|
|
97
|
+
content:
|
|
98
|
+
application/json:
|
|
99
|
+
schema:
|
|
100
|
+
oneOf:
|
|
101
|
+
- type: array
|
|
102
|
+
items:
|
|
103
|
+
type: object
|
|
104
|
+
- type: object
|
|
105
|
+
properties:
|
|
106
|
+
data:
|
|
107
|
+
type: array
|
|
108
|
+
items:
|
|
109
|
+
type: object
|
|
110
|
+
example: []
|
|
111
|
+
total:
|
|
112
|
+
type: integer
|
|
113
|
+
example: 100
|
|
114
|
+
nb_pages:
|
|
115
|
+
type: integer
|
|
116
|
+
example: 2
|
|
117
|
+
limit:
|
|
118
|
+
type: integer
|
|
119
|
+
example: 50
|
|
120
|
+
offset:
|
|
121
|
+
type: integer
|
|
122
|
+
example: 0
|
|
123
|
+
page:
|
|
124
|
+
type: integer
|
|
125
|
+
example: 1
|
|
126
|
+
400:
|
|
127
|
+
description: Invalid filter format or query error
|
|
128
|
+
"""
|
|
129
|
+
return super().get()
|
|
130
|
+
|
|
131
|
+
@jwt_required()
|
|
132
|
+
def post(self):
|
|
133
|
+
"""
|
|
134
|
+
Create entity
|
|
135
|
+
---
|
|
136
|
+
tags:
|
|
137
|
+
- Crud
|
|
138
|
+
description: Create a new entity with data provided in the request
|
|
139
|
+
body. JSON format is expected. Requires manager access to the
|
|
140
|
+
project.
|
|
141
|
+
requestBody:
|
|
142
|
+
required: true
|
|
143
|
+
content:
|
|
144
|
+
application/json:
|
|
145
|
+
schema:
|
|
146
|
+
type: object
|
|
147
|
+
required:
|
|
148
|
+
- name
|
|
149
|
+
- project_id
|
|
150
|
+
- entity_type_id
|
|
151
|
+
properties:
|
|
152
|
+
name:
|
|
153
|
+
type: string
|
|
154
|
+
example: SH010
|
|
155
|
+
project_id:
|
|
156
|
+
type: string
|
|
157
|
+
format: uuid
|
|
158
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
159
|
+
entity_type_id:
|
|
160
|
+
type: string
|
|
161
|
+
format: uuid
|
|
162
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
163
|
+
status:
|
|
164
|
+
type: string
|
|
165
|
+
example: running
|
|
166
|
+
data:
|
|
167
|
+
type: object
|
|
168
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
169
|
+
responses:
|
|
170
|
+
201:
|
|
171
|
+
description: Entity created successfully
|
|
172
|
+
content:
|
|
173
|
+
application/json:
|
|
174
|
+
schema:
|
|
175
|
+
type: object
|
|
176
|
+
properties:
|
|
177
|
+
id:
|
|
178
|
+
type: string
|
|
179
|
+
format: uuid
|
|
180
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
181
|
+
name:
|
|
182
|
+
type: string
|
|
183
|
+
example: SH010
|
|
184
|
+
project_id:
|
|
185
|
+
type: string
|
|
186
|
+
format: uuid
|
|
187
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
188
|
+
entity_type_id:
|
|
189
|
+
type: string
|
|
190
|
+
format: uuid
|
|
191
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
192
|
+
status:
|
|
193
|
+
type: string
|
|
194
|
+
example: running
|
|
195
|
+
data:
|
|
196
|
+
type: object
|
|
197
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
198
|
+
created_at:
|
|
199
|
+
type: string
|
|
200
|
+
format: date-time
|
|
201
|
+
example: "2024-01-15T10:30:00Z"
|
|
202
|
+
updated_at:
|
|
203
|
+
type: string
|
|
204
|
+
format: date-time
|
|
205
|
+
example: "2024-01-15T10:30:00Z"
|
|
206
|
+
400:
|
|
207
|
+
description: Invalid data format or validation error
|
|
208
|
+
"""
|
|
209
|
+
return super().post()
|
|
210
|
+
|
|
61
211
|
def emit_create_event(self, entity_dict):
|
|
62
212
|
self.emit_event("new", entity_dict)
|
|
63
213
|
|
|
@@ -125,6 +275,101 @@ class EntityResource(BaseModelResource, EntityEventMixin):
|
|
|
125
275
|
def check_update_permissions(self, entity, data):
|
|
126
276
|
return user_service.check_metadata_department_access(entity, data)
|
|
127
277
|
|
|
278
|
+
@jwt_required()
|
|
279
|
+
def get(self, instance_id):
|
|
280
|
+
"""
|
|
281
|
+
Get entity
|
|
282
|
+
---
|
|
283
|
+
tags:
|
|
284
|
+
- Crud
|
|
285
|
+
description: Retrieve an entity by its ID and return it as a JSON
|
|
286
|
+
object. Supports including relations. Requires project access.
|
|
287
|
+
parameters:
|
|
288
|
+
- in: path
|
|
289
|
+
name: instance_id
|
|
290
|
+
required: true
|
|
291
|
+
schema:
|
|
292
|
+
type: string
|
|
293
|
+
format: uuid
|
|
294
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
295
|
+
- in: query
|
|
296
|
+
name: relations
|
|
297
|
+
required: false
|
|
298
|
+
schema:
|
|
299
|
+
type: boolean
|
|
300
|
+
default: true
|
|
301
|
+
example: true
|
|
302
|
+
description: Whether to include relations
|
|
303
|
+
responses:
|
|
304
|
+
200:
|
|
305
|
+
description: Entity retrieved successfully
|
|
306
|
+
content:
|
|
307
|
+
application/json:
|
|
308
|
+
schema:
|
|
309
|
+
type: object
|
|
310
|
+
properties:
|
|
311
|
+
id:
|
|
312
|
+
type: string
|
|
313
|
+
format: uuid
|
|
314
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
315
|
+
name:
|
|
316
|
+
type: string
|
|
317
|
+
example: SH010
|
|
318
|
+
project_id:
|
|
319
|
+
type: string
|
|
320
|
+
format: uuid
|
|
321
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
322
|
+
entity_type_id:
|
|
323
|
+
type: string
|
|
324
|
+
format: uuid
|
|
325
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
326
|
+
status:
|
|
327
|
+
type: string
|
|
328
|
+
example: running
|
|
329
|
+
data:
|
|
330
|
+
type: object
|
|
331
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
332
|
+
type:
|
|
333
|
+
type: string
|
|
334
|
+
example: shot
|
|
335
|
+
created_at:
|
|
336
|
+
type: string
|
|
337
|
+
format: date-time
|
|
338
|
+
example: "2024-01-15T10:30:00Z"
|
|
339
|
+
updated_at:
|
|
340
|
+
type: string
|
|
341
|
+
format: date-time
|
|
342
|
+
example: "2024-01-15T10:30:00Z"
|
|
343
|
+
400:
|
|
344
|
+
description: Invalid ID format or query error
|
|
345
|
+
"""
|
|
346
|
+
return super().get(instance_id)
|
|
347
|
+
|
|
348
|
+
@jwt_required()
|
|
349
|
+
def delete(self, instance_id):
|
|
350
|
+
"""
|
|
351
|
+
Delete entity
|
|
352
|
+
---
|
|
353
|
+
tags:
|
|
354
|
+
- Crud
|
|
355
|
+
description: Delete an entity by its ID. Returns empty response
|
|
356
|
+
on success. Can only be deleted by creator or project manager.
|
|
357
|
+
parameters:
|
|
358
|
+
- in: path
|
|
359
|
+
name: instance_id
|
|
360
|
+
required: true
|
|
361
|
+
schema:
|
|
362
|
+
type: string
|
|
363
|
+
format: uuid
|
|
364
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
365
|
+
responses:
|
|
366
|
+
204:
|
|
367
|
+
description: Entity deleted successfully
|
|
368
|
+
400:
|
|
369
|
+
description: Integrity error or cannot delete
|
|
370
|
+
"""
|
|
371
|
+
return super().delete(instance_id)
|
|
372
|
+
|
|
128
373
|
def check_delete_permissions(self, entity):
|
|
129
374
|
return entity["created_by"] == persons_service.get_current_user()[
|
|
130
375
|
"id"
|
|
@@ -142,9 +387,58 @@ class EntityResource(BaseModelResource, EntityEventMixin):
|
|
|
142
387
|
@jwt_required()
|
|
143
388
|
def put(self, instance_id):
|
|
144
389
|
"""
|
|
145
|
-
Update
|
|
146
|
-
|
|
147
|
-
|
|
390
|
+
Update entity
|
|
391
|
+
---
|
|
392
|
+
tags:
|
|
393
|
+
- Crud
|
|
394
|
+
description: Update an entity with data provided in the request
|
|
395
|
+
body. JSON format is expected. Supports shot versioning when
|
|
396
|
+
frame data changes.
|
|
397
|
+
parameters:
|
|
398
|
+
- in: path
|
|
399
|
+
name: instance_id
|
|
400
|
+
required: true
|
|
401
|
+
schema:
|
|
402
|
+
type: string
|
|
403
|
+
format: uuid
|
|
404
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
405
|
+
requestBody:
|
|
406
|
+
required: true
|
|
407
|
+
content:
|
|
408
|
+
application/json:
|
|
409
|
+
schema:
|
|
410
|
+
type: object
|
|
411
|
+
properties:
|
|
412
|
+
name:
|
|
413
|
+
type: string
|
|
414
|
+
example: SH010
|
|
415
|
+
data:
|
|
416
|
+
type: object
|
|
417
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
418
|
+
responses:
|
|
419
|
+
200:
|
|
420
|
+
description: Entity updated successfully
|
|
421
|
+
content:
|
|
422
|
+
application/json:
|
|
423
|
+
schema:
|
|
424
|
+
type: object
|
|
425
|
+
properties:
|
|
426
|
+
id:
|
|
427
|
+
type: string
|
|
428
|
+
format: uuid
|
|
429
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
430
|
+
name:
|
|
431
|
+
type: string
|
|
432
|
+
example: SH010
|
|
433
|
+
project_id:
|
|
434
|
+
type: string
|
|
435
|
+
format: uuid
|
|
436
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
437
|
+
data:
|
|
438
|
+
type: object
|
|
439
|
+
example: {"frame_in": 1001, "frame_out": 1120}
|
|
440
|
+
400:
|
|
441
|
+
description: Invalid data format or validation error
|
|
148
442
|
"""
|
|
149
443
|
try:
|
|
150
444
|
data = self.get_arguments()
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.entity import EntityLink
|
|
2
4
|
from zou.app.utils import fields
|
|
3
5
|
|
|
@@ -12,11 +14,312 @@ class EntityLinksResource(BaseModelsResource):
|
|
|
12
14
|
def __init__(self):
|
|
13
15
|
BaseModelsResource.__init__(self, EntityLink)
|
|
14
16
|
|
|
17
|
+
@jwt_required()
|
|
18
|
+
def get(self):
|
|
19
|
+
"""
|
|
20
|
+
Get entity links
|
|
21
|
+
---
|
|
22
|
+
tags:
|
|
23
|
+
- Crud
|
|
24
|
+
description: Retrieve all entity links. Supports filtering via
|
|
25
|
+
query parameters and pagination.
|
|
26
|
+
parameters:
|
|
27
|
+
- in: query
|
|
28
|
+
name: page
|
|
29
|
+
required: false
|
|
30
|
+
schema:
|
|
31
|
+
type: integer
|
|
32
|
+
example: 1
|
|
33
|
+
description: Page number for pagination
|
|
34
|
+
- in: query
|
|
35
|
+
name: limit
|
|
36
|
+
required: false
|
|
37
|
+
schema:
|
|
38
|
+
type: integer
|
|
39
|
+
example: 50
|
|
40
|
+
description: Number of results per page
|
|
41
|
+
- in: query
|
|
42
|
+
name: relations
|
|
43
|
+
required: false
|
|
44
|
+
schema:
|
|
45
|
+
type: boolean
|
|
46
|
+
default: false
|
|
47
|
+
example: false
|
|
48
|
+
description: Whether to include relations
|
|
49
|
+
responses:
|
|
50
|
+
200:
|
|
51
|
+
description: Entity links retrieved successfully
|
|
52
|
+
content:
|
|
53
|
+
application/json:
|
|
54
|
+
schema:
|
|
55
|
+
oneOf:
|
|
56
|
+
- type: array
|
|
57
|
+
items:
|
|
58
|
+
type: object
|
|
59
|
+
- type: object
|
|
60
|
+
properties:
|
|
61
|
+
data:
|
|
62
|
+
type: array
|
|
63
|
+
items:
|
|
64
|
+
type: object
|
|
65
|
+
example: []
|
|
66
|
+
total:
|
|
67
|
+
type: integer
|
|
68
|
+
example: 100
|
|
69
|
+
nb_pages:
|
|
70
|
+
type: integer
|
|
71
|
+
example: 2
|
|
72
|
+
limit:
|
|
73
|
+
type: integer
|
|
74
|
+
example: 50
|
|
75
|
+
offset:
|
|
76
|
+
type: integer
|
|
77
|
+
example: 0
|
|
78
|
+
page:
|
|
79
|
+
type: integer
|
|
80
|
+
example: 1
|
|
81
|
+
400:
|
|
82
|
+
description: Invalid filter format or query error
|
|
83
|
+
"""
|
|
84
|
+
return super().get()
|
|
85
|
+
|
|
86
|
+
@jwt_required()
|
|
87
|
+
def post(self):
|
|
88
|
+
"""
|
|
89
|
+
Create entity link
|
|
90
|
+
---
|
|
91
|
+
tags:
|
|
92
|
+
- Crud
|
|
93
|
+
description: Create a new entity link with data provided in the
|
|
94
|
+
request body. JSON format is expected. Links entities together
|
|
95
|
+
in casting relationships.
|
|
96
|
+
requestBody:
|
|
97
|
+
required: true
|
|
98
|
+
content:
|
|
99
|
+
application/json:
|
|
100
|
+
schema:
|
|
101
|
+
type: object
|
|
102
|
+
required:
|
|
103
|
+
- entity_in_id
|
|
104
|
+
- entity_out_id
|
|
105
|
+
properties:
|
|
106
|
+
entity_in_id:
|
|
107
|
+
type: string
|
|
108
|
+
format: uuid
|
|
109
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
110
|
+
entity_out_id:
|
|
111
|
+
type: string
|
|
112
|
+
format: uuid
|
|
113
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
114
|
+
nb_occurences:
|
|
115
|
+
type: integer
|
|
116
|
+
default: 1
|
|
117
|
+
example: 1
|
|
118
|
+
label:
|
|
119
|
+
type: string
|
|
120
|
+
example: fixed
|
|
121
|
+
responses:
|
|
122
|
+
201:
|
|
123
|
+
description: Entity link created successfully
|
|
124
|
+
content:
|
|
125
|
+
application/json:
|
|
126
|
+
schema:
|
|
127
|
+
type: object
|
|
128
|
+
properties:
|
|
129
|
+
id:
|
|
130
|
+
type: string
|
|
131
|
+
format: uuid
|
|
132
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
133
|
+
entity_in_id:
|
|
134
|
+
type: string
|
|
135
|
+
format: uuid
|
|
136
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
137
|
+
entity_out_id:
|
|
138
|
+
type: string
|
|
139
|
+
format: uuid
|
|
140
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
141
|
+
nb_occurences:
|
|
142
|
+
type: integer
|
|
143
|
+
example: 1
|
|
144
|
+
label:
|
|
145
|
+
type: string
|
|
146
|
+
example: fixed
|
|
147
|
+
created_at:
|
|
148
|
+
type: string
|
|
149
|
+
format: date-time
|
|
150
|
+
example: "2024-01-15T10:30:00Z"
|
|
151
|
+
updated_at:
|
|
152
|
+
type: string
|
|
153
|
+
format: date-time
|
|
154
|
+
example: "2024-01-15T10:30:00Z"
|
|
155
|
+
400:
|
|
156
|
+
description: Invalid data format or validation error
|
|
157
|
+
"""
|
|
158
|
+
return super().post()
|
|
159
|
+
|
|
15
160
|
|
|
16
161
|
class EntityLinkResource(BaseModelResource):
|
|
17
162
|
def __init__(self):
|
|
18
163
|
BaseModelResource.__init__(self, EntityLink)
|
|
19
164
|
|
|
165
|
+
@jwt_required()
|
|
166
|
+
def get(self, instance_id):
|
|
167
|
+
"""
|
|
168
|
+
Get entity link
|
|
169
|
+
---
|
|
170
|
+
tags:
|
|
171
|
+
- Crud
|
|
172
|
+
description: Retrieve an entity link by its ID and return it as a
|
|
173
|
+
JSON object. Supports including relations.
|
|
174
|
+
parameters:
|
|
175
|
+
- in: path
|
|
176
|
+
name: instance_id
|
|
177
|
+
required: true
|
|
178
|
+
schema:
|
|
179
|
+
type: string
|
|
180
|
+
format: uuid
|
|
181
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
182
|
+
- in: query
|
|
183
|
+
name: relations
|
|
184
|
+
required: false
|
|
185
|
+
schema:
|
|
186
|
+
type: boolean
|
|
187
|
+
default: true
|
|
188
|
+
example: true
|
|
189
|
+
description: Whether to include relations
|
|
190
|
+
responses:
|
|
191
|
+
200:
|
|
192
|
+
description: Entity link retrieved successfully
|
|
193
|
+
content:
|
|
194
|
+
application/json:
|
|
195
|
+
schema:
|
|
196
|
+
type: object
|
|
197
|
+
properties:
|
|
198
|
+
id:
|
|
199
|
+
type: string
|
|
200
|
+
format: uuid
|
|
201
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
202
|
+
entity_in_id:
|
|
203
|
+
type: string
|
|
204
|
+
format: uuid
|
|
205
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
206
|
+
entity_out_id:
|
|
207
|
+
type: string
|
|
208
|
+
format: uuid
|
|
209
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
210
|
+
nb_occurences:
|
|
211
|
+
type: integer
|
|
212
|
+
example: 1
|
|
213
|
+
label:
|
|
214
|
+
type: string
|
|
215
|
+
example: fixed
|
|
216
|
+
created_at:
|
|
217
|
+
type: string
|
|
218
|
+
format: date-time
|
|
219
|
+
example: "2024-01-15T10:30:00Z"
|
|
220
|
+
updated_at:
|
|
221
|
+
type: string
|
|
222
|
+
format: date-time
|
|
223
|
+
example: "2024-01-15T10:30:00Z"
|
|
224
|
+
400:
|
|
225
|
+
description: Invalid ID format or query error
|
|
226
|
+
"""
|
|
227
|
+
return super().get(instance_id)
|
|
228
|
+
|
|
229
|
+
@jwt_required()
|
|
230
|
+
def put(self, instance_id):
|
|
231
|
+
"""
|
|
232
|
+
Update entity link
|
|
233
|
+
---
|
|
234
|
+
tags:
|
|
235
|
+
- Crud
|
|
236
|
+
description: Update an entity link with data provided in the
|
|
237
|
+
request body. JSON format is expected.
|
|
238
|
+
parameters:
|
|
239
|
+
- in: path
|
|
240
|
+
name: instance_id
|
|
241
|
+
required: true
|
|
242
|
+
schema:
|
|
243
|
+
type: string
|
|
244
|
+
format: uuid
|
|
245
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
246
|
+
requestBody:
|
|
247
|
+
required: true
|
|
248
|
+
content:
|
|
249
|
+
application/json:
|
|
250
|
+
schema:
|
|
251
|
+
type: object
|
|
252
|
+
properties:
|
|
253
|
+
nb_occurences:
|
|
254
|
+
type: integer
|
|
255
|
+
example: 2
|
|
256
|
+
label:
|
|
257
|
+
type: string
|
|
258
|
+
example: updated
|
|
259
|
+
responses:
|
|
260
|
+
200:
|
|
261
|
+
description: Entity link updated successfully
|
|
262
|
+
content:
|
|
263
|
+
application/json:
|
|
264
|
+
schema:
|
|
265
|
+
type: object
|
|
266
|
+
properties:
|
|
267
|
+
id:
|
|
268
|
+
type: string
|
|
269
|
+
format: uuid
|
|
270
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
271
|
+
entity_in_id:
|
|
272
|
+
type: string
|
|
273
|
+
format: uuid
|
|
274
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
275
|
+
entity_out_id:
|
|
276
|
+
type: string
|
|
277
|
+
format: uuid
|
|
278
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
279
|
+
nb_occurences:
|
|
280
|
+
type: integer
|
|
281
|
+
example: 2
|
|
282
|
+
label:
|
|
283
|
+
type: string
|
|
284
|
+
example: updated
|
|
285
|
+
created_at:
|
|
286
|
+
type: string
|
|
287
|
+
format: date-time
|
|
288
|
+
example: "2024-01-15T10:30:00Z"
|
|
289
|
+
updated_at:
|
|
290
|
+
type: string
|
|
291
|
+
format: date-time
|
|
292
|
+
example: "2024-01-15T11:00:00Z"
|
|
293
|
+
400:
|
|
294
|
+
description: Invalid data format or validation error
|
|
295
|
+
"""
|
|
296
|
+
return super().put(instance_id)
|
|
297
|
+
|
|
298
|
+
@jwt_required()
|
|
299
|
+
def delete(self, instance_id):
|
|
300
|
+
"""
|
|
301
|
+
Delete entity link
|
|
302
|
+
---
|
|
303
|
+
tags:
|
|
304
|
+
- Crud
|
|
305
|
+
description: Delete an entity link by its ID. Returns empty
|
|
306
|
+
response on success.
|
|
307
|
+
parameters:
|
|
308
|
+
- in: path
|
|
309
|
+
name: instance_id
|
|
310
|
+
required: true
|
|
311
|
+
schema:
|
|
312
|
+
type: string
|
|
313
|
+
format: uuid
|
|
314
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
315
|
+
responses:
|
|
316
|
+
204:
|
|
317
|
+
description: Entity link deleted successfully
|
|
318
|
+
400:
|
|
319
|
+
description: Integrity error or cannot delete
|
|
320
|
+
"""
|
|
321
|
+
return super().delete(instance_id)
|
|
322
|
+
|
|
20
323
|
def get_model_or_404(self, instance_id):
|
|
21
324
|
if not fields.is_valid_id(instance_id):
|
|
22
325
|
raise WrongParameterException("Malformed ID.")
|