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
|
@@ -22,12 +22,305 @@ class CommentsResource(BaseModelsResource):
|
|
|
22
22
|
def __init__(self):
|
|
23
23
|
BaseModelsResource.__init__(self, Comment)
|
|
24
24
|
|
|
25
|
+
@jwt_required()
|
|
26
|
+
def get(self):
|
|
27
|
+
"""
|
|
28
|
+
Get comments
|
|
29
|
+
---
|
|
30
|
+
tags:
|
|
31
|
+
- Crud
|
|
32
|
+
description: Retrieve all comments. Supports filtering via query
|
|
33
|
+
parameters and pagination.
|
|
34
|
+
parameters:
|
|
35
|
+
- in: query
|
|
36
|
+
name: page
|
|
37
|
+
required: false
|
|
38
|
+
schema:
|
|
39
|
+
type: integer
|
|
40
|
+
example: 1
|
|
41
|
+
description: Page number for pagination
|
|
42
|
+
- in: query
|
|
43
|
+
name: limit
|
|
44
|
+
required: false
|
|
45
|
+
schema:
|
|
46
|
+
type: integer
|
|
47
|
+
example: 50
|
|
48
|
+
description: Number of results per page
|
|
49
|
+
- in: query
|
|
50
|
+
name: relations
|
|
51
|
+
required: false
|
|
52
|
+
schema:
|
|
53
|
+
type: boolean
|
|
54
|
+
default: false
|
|
55
|
+
example: false
|
|
56
|
+
description: Whether to include relations
|
|
57
|
+
responses:
|
|
58
|
+
200:
|
|
59
|
+
description: Comments retrieved successfully
|
|
60
|
+
content:
|
|
61
|
+
application/json:
|
|
62
|
+
schema:
|
|
63
|
+
oneOf:
|
|
64
|
+
- type: array
|
|
65
|
+
items:
|
|
66
|
+
type: object
|
|
67
|
+
- type: object
|
|
68
|
+
properties:
|
|
69
|
+
data:
|
|
70
|
+
type: array
|
|
71
|
+
items:
|
|
72
|
+
type: object
|
|
73
|
+
example: []
|
|
74
|
+
total:
|
|
75
|
+
type: integer
|
|
76
|
+
example: 100
|
|
77
|
+
nb_pages:
|
|
78
|
+
type: integer
|
|
79
|
+
example: 2
|
|
80
|
+
limit:
|
|
81
|
+
type: integer
|
|
82
|
+
example: 50
|
|
83
|
+
offset:
|
|
84
|
+
type: integer
|
|
85
|
+
example: 0
|
|
86
|
+
page:
|
|
87
|
+
type: integer
|
|
88
|
+
example: 1
|
|
89
|
+
400:
|
|
90
|
+
description: Invalid filter format or query error
|
|
91
|
+
"""
|
|
92
|
+
return super().get()
|
|
93
|
+
|
|
94
|
+
@jwt_required()
|
|
95
|
+
def post(self):
|
|
96
|
+
"""
|
|
97
|
+
Create comment
|
|
98
|
+
---
|
|
99
|
+
tags:
|
|
100
|
+
- Crud
|
|
101
|
+
description: Create a new comment with data provided in the request
|
|
102
|
+
body. JSON format is expected.
|
|
103
|
+
requestBody:
|
|
104
|
+
required: true
|
|
105
|
+
content:
|
|
106
|
+
application/json:
|
|
107
|
+
schema:
|
|
108
|
+
type: object
|
|
109
|
+
required:
|
|
110
|
+
- object_id
|
|
111
|
+
- person_id
|
|
112
|
+
- task_status_id
|
|
113
|
+
properties:
|
|
114
|
+
object_id:
|
|
115
|
+
type: string
|
|
116
|
+
format: uuid
|
|
117
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
118
|
+
person_id:
|
|
119
|
+
type: string
|
|
120
|
+
format: uuid
|
|
121
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
122
|
+
task_status_id:
|
|
123
|
+
type: string
|
|
124
|
+
format: uuid
|
|
125
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
126
|
+
text:
|
|
127
|
+
type: string
|
|
128
|
+
example: Comment text
|
|
129
|
+
responses:
|
|
130
|
+
201:
|
|
131
|
+
description: Comment created successfully
|
|
132
|
+
content:
|
|
133
|
+
application/json:
|
|
134
|
+
schema:
|
|
135
|
+
type: object
|
|
136
|
+
properties:
|
|
137
|
+
id:
|
|
138
|
+
type: string
|
|
139
|
+
format: uuid
|
|
140
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
141
|
+
object_id:
|
|
142
|
+
type: string
|
|
143
|
+
format: uuid
|
|
144
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
145
|
+
person_id:
|
|
146
|
+
type: string
|
|
147
|
+
format: uuid
|
|
148
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
149
|
+
task_status_id:
|
|
150
|
+
type: string
|
|
151
|
+
format: uuid
|
|
152
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
153
|
+
text:
|
|
154
|
+
type: string
|
|
155
|
+
example: Comment text
|
|
156
|
+
created_at:
|
|
157
|
+
type: string
|
|
158
|
+
format: date-time
|
|
159
|
+
example: "2024-01-15T10:30:00Z"
|
|
160
|
+
updated_at:
|
|
161
|
+
type: string
|
|
162
|
+
format: date-time
|
|
163
|
+
example: "2024-01-15T10:30:00Z"
|
|
164
|
+
400:
|
|
165
|
+
description: Invalid data format or validation error
|
|
166
|
+
"""
|
|
167
|
+
return super().post()
|
|
168
|
+
|
|
25
169
|
|
|
26
170
|
class CommentResource(BaseModelResource):
|
|
27
171
|
def __init__(self):
|
|
28
172
|
BaseModelResource.__init__(self, Comment)
|
|
29
173
|
self.protected_fields += ["mentions", "department_mentions"]
|
|
30
174
|
|
|
175
|
+
@jwt_required()
|
|
176
|
+
def get(self, instance_id):
|
|
177
|
+
"""
|
|
178
|
+
Get comment
|
|
179
|
+
---
|
|
180
|
+
tags:
|
|
181
|
+
- Crud
|
|
182
|
+
description: Retrieve a comment by its ID and return it as a JSON
|
|
183
|
+
object. Supports including relations. Client users can only see
|
|
184
|
+
their own comments or comments from other clients.
|
|
185
|
+
parameters:
|
|
186
|
+
- in: path
|
|
187
|
+
name: instance_id
|
|
188
|
+
required: true
|
|
189
|
+
schema:
|
|
190
|
+
type: string
|
|
191
|
+
format: uuid
|
|
192
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
193
|
+
- in: query
|
|
194
|
+
name: relations
|
|
195
|
+
required: false
|
|
196
|
+
schema:
|
|
197
|
+
type: boolean
|
|
198
|
+
default: true
|
|
199
|
+
example: true
|
|
200
|
+
description: Whether to include relations
|
|
201
|
+
responses:
|
|
202
|
+
200:
|
|
203
|
+
description: Comment retrieved successfully
|
|
204
|
+
content:
|
|
205
|
+
application/json:
|
|
206
|
+
schema:
|
|
207
|
+
type: object
|
|
208
|
+
properties:
|
|
209
|
+
id:
|
|
210
|
+
type: string
|
|
211
|
+
format: uuid
|
|
212
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
213
|
+
object_id:
|
|
214
|
+
type: string
|
|
215
|
+
format: uuid
|
|
216
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
217
|
+
person_id:
|
|
218
|
+
type: string
|
|
219
|
+
format: uuid
|
|
220
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
221
|
+
task_status_id:
|
|
222
|
+
type: string
|
|
223
|
+
format: uuid
|
|
224
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
225
|
+
text:
|
|
226
|
+
type: string
|
|
227
|
+
example: Comment text
|
|
228
|
+
created_at:
|
|
229
|
+
type: string
|
|
230
|
+
format: date-time
|
|
231
|
+
example: "2024-01-15T10:30:00Z"
|
|
232
|
+
updated_at:
|
|
233
|
+
type: string
|
|
234
|
+
format: date-time
|
|
235
|
+
example: "2024-01-15T10:30:00Z"
|
|
236
|
+
400:
|
|
237
|
+
description: Invalid ID format or query error
|
|
238
|
+
"""
|
|
239
|
+
return super().get(instance_id)
|
|
240
|
+
|
|
241
|
+
@jwt_required()
|
|
242
|
+
def put(self, instance_id):
|
|
243
|
+
"""
|
|
244
|
+
Update comment
|
|
245
|
+
---
|
|
246
|
+
tags:
|
|
247
|
+
- Crud
|
|
248
|
+
description: Update a comment with data provided in the request
|
|
249
|
+
body. JSON format is expected. May update task status if
|
|
250
|
+
task_status_id is changed.
|
|
251
|
+
parameters:
|
|
252
|
+
- in: path
|
|
253
|
+
name: instance_id
|
|
254
|
+
required: true
|
|
255
|
+
schema:
|
|
256
|
+
type: string
|
|
257
|
+
format: uuid
|
|
258
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
259
|
+
requestBody:
|
|
260
|
+
required: true
|
|
261
|
+
content:
|
|
262
|
+
application/json:
|
|
263
|
+
schema:
|
|
264
|
+
type: object
|
|
265
|
+
properties:
|
|
266
|
+
text:
|
|
267
|
+
type: string
|
|
268
|
+
example: Updated comment text
|
|
269
|
+
task_status_id:
|
|
270
|
+
type: string
|
|
271
|
+
format: uuid
|
|
272
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
273
|
+
pinned:
|
|
274
|
+
type: boolean
|
|
275
|
+
example: true
|
|
276
|
+
checklist:
|
|
277
|
+
type: array
|
|
278
|
+
items:
|
|
279
|
+
type: object
|
|
280
|
+
example: [{"text": "Item 1", "checked": false}]
|
|
281
|
+
responses:
|
|
282
|
+
200:
|
|
283
|
+
description: Comment updated successfully
|
|
284
|
+
content:
|
|
285
|
+
application/json:
|
|
286
|
+
schema:
|
|
287
|
+
type: object
|
|
288
|
+
properties:
|
|
289
|
+
id:
|
|
290
|
+
type: string
|
|
291
|
+
format: uuid
|
|
292
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
293
|
+
object_id:
|
|
294
|
+
type: string
|
|
295
|
+
format: uuid
|
|
296
|
+
example: b24a6ea4-ce75-4665-a070-57453082c25
|
|
297
|
+
person_id:
|
|
298
|
+
type: string
|
|
299
|
+
format: uuid
|
|
300
|
+
example: c24a6ea4-ce75-4665-a070-57453082c25
|
|
301
|
+
task_status_id:
|
|
302
|
+
type: string
|
|
303
|
+
format: uuid
|
|
304
|
+
example: d24a6ea4-ce75-4665-a070-57453082c25
|
|
305
|
+
text:
|
|
306
|
+
type: string
|
|
307
|
+
example: Updated comment text
|
|
308
|
+
pinned:
|
|
309
|
+
type: boolean
|
|
310
|
+
example: true
|
|
311
|
+
created_at:
|
|
312
|
+
type: string
|
|
313
|
+
format: date-time
|
|
314
|
+
example: "2024-01-15T10:30:00Z"
|
|
315
|
+
updated_at:
|
|
316
|
+
type: string
|
|
317
|
+
format: date-time
|
|
318
|
+
example: "2024-01-15T11:00:00Z"
|
|
319
|
+
400:
|
|
320
|
+
description: Invalid data format or validation error
|
|
321
|
+
"""
|
|
322
|
+
return super().put(instance_id)
|
|
323
|
+
|
|
31
324
|
def get_serialized_instance(self, instance_id, relations=True):
|
|
32
325
|
return tasks_service.get_comment(instance_id, relations=relations)
|
|
33
326
|
|
|
@@ -197,7 +490,25 @@ class CommentResource(BaseModelResource):
|
|
|
197
490
|
@jwt_required()
|
|
198
491
|
def delete(self, instance_id):
|
|
199
492
|
"""
|
|
200
|
-
Delete
|
|
493
|
+
Delete comment
|
|
494
|
+
---
|
|
495
|
+
tags:
|
|
496
|
+
- Crud
|
|
497
|
+
description: Delete a comment by its ID. Returns empty response
|
|
498
|
+
on success. Updates task status if comment had status change.
|
|
499
|
+
parameters:
|
|
500
|
+
- in: path
|
|
501
|
+
name: instance_id
|
|
502
|
+
required: true
|
|
503
|
+
schema:
|
|
504
|
+
type: string
|
|
505
|
+
format: uuid
|
|
506
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
507
|
+
responses:
|
|
508
|
+
204:
|
|
509
|
+
description: Comment deleted successfully
|
|
510
|
+
400:
|
|
511
|
+
description: Cannot delete comment or integrity error
|
|
201
512
|
"""
|
|
202
513
|
comment = tasks_service.get_comment(instance_id)
|
|
203
514
|
task = tasks_service.get_task(comment["object_id"])
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.custom_action import CustomAction
|
|
2
4
|
|
|
3
5
|
from zou.app.blueprints.crud.base import BaseModelsResource, BaseModelResource
|
|
@@ -13,6 +15,130 @@ class CustomActionsResource(BaseModelsResource):
|
|
|
13
15
|
user_service.block_access_to_vendor()
|
|
14
16
|
return True
|
|
15
17
|
|
|
18
|
+
@jwt_required()
|
|
19
|
+
def get(self):
|
|
20
|
+
"""
|
|
21
|
+
Get custom actions
|
|
22
|
+
---
|
|
23
|
+
tags:
|
|
24
|
+
- Crud
|
|
25
|
+
description: Retrieve all custom actions. Supports filtering via
|
|
26
|
+
query parameters and pagination. Vendor access is blocked.
|
|
27
|
+
parameters:
|
|
28
|
+
- in: query
|
|
29
|
+
name: page
|
|
30
|
+
required: false
|
|
31
|
+
schema:
|
|
32
|
+
type: integer
|
|
33
|
+
example: 1
|
|
34
|
+
description: Page number for pagination
|
|
35
|
+
- in: query
|
|
36
|
+
name: limit
|
|
37
|
+
required: false
|
|
38
|
+
schema:
|
|
39
|
+
type: integer
|
|
40
|
+
example: 50
|
|
41
|
+
description: Number of results per page
|
|
42
|
+
- in: query
|
|
43
|
+
name: relations
|
|
44
|
+
required: false
|
|
45
|
+
schema:
|
|
46
|
+
type: boolean
|
|
47
|
+
default: false
|
|
48
|
+
example: false
|
|
49
|
+
description: Whether to include relations
|
|
50
|
+
responses:
|
|
51
|
+
200:
|
|
52
|
+
description: Custom actions retrieved successfully
|
|
53
|
+
content:
|
|
54
|
+
application/json:
|
|
55
|
+
schema:
|
|
56
|
+
oneOf:
|
|
57
|
+
- type: array
|
|
58
|
+
items:
|
|
59
|
+
type: object
|
|
60
|
+
- type: object
|
|
61
|
+
properties:
|
|
62
|
+
data:
|
|
63
|
+
type: array
|
|
64
|
+
items:
|
|
65
|
+
type: object
|
|
66
|
+
example: []
|
|
67
|
+
total:
|
|
68
|
+
type: integer
|
|
69
|
+
example: 100
|
|
70
|
+
nb_pages:
|
|
71
|
+
type: integer
|
|
72
|
+
example: 2
|
|
73
|
+
limit:
|
|
74
|
+
type: integer
|
|
75
|
+
example: 50
|
|
76
|
+
offset:
|
|
77
|
+
type: integer
|
|
78
|
+
example: 0
|
|
79
|
+
page:
|
|
80
|
+
type: integer
|
|
81
|
+
example: 1
|
|
82
|
+
400:
|
|
83
|
+
description: Invalid filter format or query error
|
|
84
|
+
"""
|
|
85
|
+
return super().get()
|
|
86
|
+
|
|
87
|
+
@jwt_required()
|
|
88
|
+
def post(self):
|
|
89
|
+
"""
|
|
90
|
+
Create custom action
|
|
91
|
+
---
|
|
92
|
+
tags:
|
|
93
|
+
- Crud
|
|
94
|
+
description: Create a new custom action with data provided in the
|
|
95
|
+
request body. JSON format is expected.
|
|
96
|
+
requestBody:
|
|
97
|
+
required: true
|
|
98
|
+
content:
|
|
99
|
+
application/json:
|
|
100
|
+
schema:
|
|
101
|
+
type: object
|
|
102
|
+
required:
|
|
103
|
+
- name
|
|
104
|
+
properties:
|
|
105
|
+
name:
|
|
106
|
+
type: string
|
|
107
|
+
example: Custom Action Name
|
|
108
|
+
url_pattern:
|
|
109
|
+
type: string
|
|
110
|
+
example: "/api/actions/{id}"
|
|
111
|
+
responses:
|
|
112
|
+
201:
|
|
113
|
+
description: Custom action created successfully
|
|
114
|
+
content:
|
|
115
|
+
application/json:
|
|
116
|
+
schema:
|
|
117
|
+
type: object
|
|
118
|
+
properties:
|
|
119
|
+
id:
|
|
120
|
+
type: string
|
|
121
|
+
format: uuid
|
|
122
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
123
|
+
name:
|
|
124
|
+
type: string
|
|
125
|
+
example: Custom Action Name
|
|
126
|
+
url_pattern:
|
|
127
|
+
type: string
|
|
128
|
+
example: "/api/actions/{id}"
|
|
129
|
+
created_at:
|
|
130
|
+
type: string
|
|
131
|
+
format: date-time
|
|
132
|
+
example: "2024-01-15T10:30:00Z"
|
|
133
|
+
updated_at:
|
|
134
|
+
type: string
|
|
135
|
+
format: date-time
|
|
136
|
+
example: "2024-01-15T10:30:00Z"
|
|
137
|
+
400:
|
|
138
|
+
description: Invalid data format or validation error
|
|
139
|
+
"""
|
|
140
|
+
return super().post()
|
|
141
|
+
|
|
16
142
|
def post_creation(self, custom_action):
|
|
17
143
|
custom_actions_service.clear_custom_action_cache()
|
|
18
144
|
return custom_action.serialize()
|
|
@@ -22,6 +148,148 @@ class CustomActionResource(BaseModelResource):
|
|
|
22
148
|
def __init__(self):
|
|
23
149
|
BaseModelResource.__init__(self, CustomAction)
|
|
24
150
|
|
|
151
|
+
@jwt_required()
|
|
152
|
+
def get(self, instance_id):
|
|
153
|
+
"""
|
|
154
|
+
Get custom action
|
|
155
|
+
---
|
|
156
|
+
tags:
|
|
157
|
+
- Crud
|
|
158
|
+
description: Retrieve a custom action by its ID and return it as a
|
|
159
|
+
JSON object. Supports including relations.
|
|
160
|
+
parameters:
|
|
161
|
+
- in: path
|
|
162
|
+
name: instance_id
|
|
163
|
+
required: true
|
|
164
|
+
schema:
|
|
165
|
+
type: string
|
|
166
|
+
format: uuid
|
|
167
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
168
|
+
- in: query
|
|
169
|
+
name: relations
|
|
170
|
+
required: false
|
|
171
|
+
schema:
|
|
172
|
+
type: boolean
|
|
173
|
+
default: true
|
|
174
|
+
example: true
|
|
175
|
+
description: Whether to include relations
|
|
176
|
+
responses:
|
|
177
|
+
200:
|
|
178
|
+
description: Custom action retrieved successfully
|
|
179
|
+
content:
|
|
180
|
+
application/json:
|
|
181
|
+
schema:
|
|
182
|
+
type: object
|
|
183
|
+
properties:
|
|
184
|
+
id:
|
|
185
|
+
type: string
|
|
186
|
+
format: uuid
|
|
187
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
188
|
+
name:
|
|
189
|
+
type: string
|
|
190
|
+
example: Custom Action Name
|
|
191
|
+
url_pattern:
|
|
192
|
+
type: string
|
|
193
|
+
example: "/api/actions/{id}"
|
|
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 custom action
|
|
211
|
+
---
|
|
212
|
+
tags:
|
|
213
|
+
- Crud
|
|
214
|
+
description: Update a custom action 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 Custom Action Name
|
|
234
|
+
url_pattern:
|
|
235
|
+
type: string
|
|
236
|
+
example: "/api/actions/{id}"
|
|
237
|
+
responses:
|
|
238
|
+
200:
|
|
239
|
+
description: Custom action updated successfully
|
|
240
|
+
content:
|
|
241
|
+
application/json:
|
|
242
|
+
schema:
|
|
243
|
+
type: object
|
|
244
|
+
properties:
|
|
245
|
+
id:
|
|
246
|
+
type: string
|
|
247
|
+
format: uuid
|
|
248
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
249
|
+
name:
|
|
250
|
+
type: string
|
|
251
|
+
example: Updated Custom Action Name
|
|
252
|
+
url_pattern:
|
|
253
|
+
type: string
|
|
254
|
+
example: "/api/actions/{id}"
|
|
255
|
+
created_at:
|
|
256
|
+
type: string
|
|
257
|
+
format: date-time
|
|
258
|
+
example: "2024-01-15T10:30:00Z"
|
|
259
|
+
updated_at:
|
|
260
|
+
type: string
|
|
261
|
+
format: date-time
|
|
262
|
+
example: "2024-01-15T11:00:00Z"
|
|
263
|
+
400:
|
|
264
|
+
description: Invalid data format or validation error
|
|
265
|
+
"""
|
|
266
|
+
return super().put(instance_id)
|
|
267
|
+
|
|
268
|
+
@jwt_required()
|
|
269
|
+
def delete(self, instance_id):
|
|
270
|
+
"""
|
|
271
|
+
Delete custom action
|
|
272
|
+
---
|
|
273
|
+
tags:
|
|
274
|
+
- Crud
|
|
275
|
+
description: Delete a custom action by its ID. Returns empty
|
|
276
|
+
response on success.
|
|
277
|
+
parameters:
|
|
278
|
+
- in: path
|
|
279
|
+
name: instance_id
|
|
280
|
+
required: true
|
|
281
|
+
schema:
|
|
282
|
+
type: string
|
|
283
|
+
format: uuid
|
|
284
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
285
|
+
responses:
|
|
286
|
+
204:
|
|
287
|
+
description: Custom action deleted successfully
|
|
288
|
+
400:
|
|
289
|
+
description: Integrity error or cannot delete
|
|
290
|
+
"""
|
|
291
|
+
return super().delete(instance_id)
|
|
292
|
+
|
|
25
293
|
def post_update(self, custom_action, data):
|
|
26
294
|
custom_actions_service.clear_custom_action_cache()
|
|
27
295
|
return custom_action
|