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
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.file_status import FileStatus
|
|
2
4
|
from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
3
5
|
|
|
@@ -9,6 +11,130 @@ class FileStatusesResource(BaseModelsResource):
|
|
|
9
11
|
def check_read_permissions(self, options=None):
|
|
10
12
|
return True
|
|
11
13
|
|
|
14
|
+
@jwt_required()
|
|
15
|
+
def get(self):
|
|
16
|
+
"""
|
|
17
|
+
Get file statuses
|
|
18
|
+
---
|
|
19
|
+
tags:
|
|
20
|
+
- Crud
|
|
21
|
+
description: Retrieve all file statuses. Supports filtering via
|
|
22
|
+
query parameters and pagination.
|
|
23
|
+
parameters:
|
|
24
|
+
- in: query
|
|
25
|
+
name: page
|
|
26
|
+
required: false
|
|
27
|
+
schema:
|
|
28
|
+
type: integer
|
|
29
|
+
example: 1
|
|
30
|
+
description: Page number for pagination
|
|
31
|
+
- in: query
|
|
32
|
+
name: limit
|
|
33
|
+
required: false
|
|
34
|
+
schema:
|
|
35
|
+
type: integer
|
|
36
|
+
example: 50
|
|
37
|
+
description: Number of results per page
|
|
38
|
+
- in: query
|
|
39
|
+
name: relations
|
|
40
|
+
required: false
|
|
41
|
+
schema:
|
|
42
|
+
type: boolean
|
|
43
|
+
default: false
|
|
44
|
+
example: false
|
|
45
|
+
description: Whether to include relations
|
|
46
|
+
responses:
|
|
47
|
+
200:
|
|
48
|
+
description: File statuses retrieved successfully
|
|
49
|
+
content:
|
|
50
|
+
application/json:
|
|
51
|
+
schema:
|
|
52
|
+
oneOf:
|
|
53
|
+
- type: array
|
|
54
|
+
items:
|
|
55
|
+
type: object
|
|
56
|
+
- type: object
|
|
57
|
+
properties:
|
|
58
|
+
data:
|
|
59
|
+
type: array
|
|
60
|
+
items:
|
|
61
|
+
type: object
|
|
62
|
+
example: []
|
|
63
|
+
total:
|
|
64
|
+
type: integer
|
|
65
|
+
example: 100
|
|
66
|
+
nb_pages:
|
|
67
|
+
type: integer
|
|
68
|
+
example: 2
|
|
69
|
+
limit:
|
|
70
|
+
type: integer
|
|
71
|
+
example: 50
|
|
72
|
+
offset:
|
|
73
|
+
type: integer
|
|
74
|
+
example: 0
|
|
75
|
+
page:
|
|
76
|
+
type: integer
|
|
77
|
+
example: 1
|
|
78
|
+
400:
|
|
79
|
+
description: Invalid filter format or query error
|
|
80
|
+
"""
|
|
81
|
+
return super().get()
|
|
82
|
+
|
|
83
|
+
@jwt_required()
|
|
84
|
+
def post(self):
|
|
85
|
+
"""
|
|
86
|
+
Create file status
|
|
87
|
+
---
|
|
88
|
+
tags:
|
|
89
|
+
- Crud
|
|
90
|
+
description: Create a new file status with data provided in the
|
|
91
|
+
request body. JSON format is expected.
|
|
92
|
+
requestBody:
|
|
93
|
+
required: true
|
|
94
|
+
content:
|
|
95
|
+
application/json:
|
|
96
|
+
schema:
|
|
97
|
+
type: object
|
|
98
|
+
required:
|
|
99
|
+
- name
|
|
100
|
+
properties:
|
|
101
|
+
name:
|
|
102
|
+
type: string
|
|
103
|
+
example: Approved
|
|
104
|
+
color:
|
|
105
|
+
type: string
|
|
106
|
+
example: "#00FF00"
|
|
107
|
+
responses:
|
|
108
|
+
201:
|
|
109
|
+
description: File status created successfully
|
|
110
|
+
content:
|
|
111
|
+
application/json:
|
|
112
|
+
schema:
|
|
113
|
+
type: object
|
|
114
|
+
properties:
|
|
115
|
+
id:
|
|
116
|
+
type: string
|
|
117
|
+
format: uuid
|
|
118
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
119
|
+
name:
|
|
120
|
+
type: string
|
|
121
|
+
example: Approved
|
|
122
|
+
color:
|
|
123
|
+
type: string
|
|
124
|
+
example: "#00FF00"
|
|
125
|
+
created_at:
|
|
126
|
+
type: string
|
|
127
|
+
format: date-time
|
|
128
|
+
example: "2024-01-15T10:30:00Z"
|
|
129
|
+
updated_at:
|
|
130
|
+
type: string
|
|
131
|
+
format: date-time
|
|
132
|
+
example: "2024-01-15T10:30:00Z"
|
|
133
|
+
400:
|
|
134
|
+
description: Invalid data format or validation error
|
|
135
|
+
"""
|
|
136
|
+
return super().post()
|
|
137
|
+
|
|
12
138
|
|
|
13
139
|
class FileStatusResource(BaseModelResource):
|
|
14
140
|
def __init__(self):
|
|
@@ -16,3 +142,145 @@ class FileStatusResource(BaseModelResource):
|
|
|
16
142
|
|
|
17
143
|
def check_read_permissions(self, instance):
|
|
18
144
|
return True
|
|
145
|
+
|
|
146
|
+
@jwt_required()
|
|
147
|
+
def get(self, instance_id):
|
|
148
|
+
"""
|
|
149
|
+
Get file status
|
|
150
|
+
---
|
|
151
|
+
tags:
|
|
152
|
+
- Crud
|
|
153
|
+
description: Retrieve a file status by its ID and return it as a
|
|
154
|
+
JSON object. Supports including relations.
|
|
155
|
+
parameters:
|
|
156
|
+
- in: path
|
|
157
|
+
name: instance_id
|
|
158
|
+
required: true
|
|
159
|
+
schema:
|
|
160
|
+
type: string
|
|
161
|
+
format: uuid
|
|
162
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
163
|
+
- in: query
|
|
164
|
+
name: relations
|
|
165
|
+
required: false
|
|
166
|
+
schema:
|
|
167
|
+
type: boolean
|
|
168
|
+
default: true
|
|
169
|
+
example: true
|
|
170
|
+
description: Whether to include relations
|
|
171
|
+
responses:
|
|
172
|
+
200:
|
|
173
|
+
description: File status retrieved successfully
|
|
174
|
+
content:
|
|
175
|
+
application/json:
|
|
176
|
+
schema:
|
|
177
|
+
type: object
|
|
178
|
+
properties:
|
|
179
|
+
id:
|
|
180
|
+
type: string
|
|
181
|
+
format: uuid
|
|
182
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
183
|
+
name:
|
|
184
|
+
type: string
|
|
185
|
+
example: Approved
|
|
186
|
+
color:
|
|
187
|
+
type: string
|
|
188
|
+
example: "#00FF00"
|
|
189
|
+
created_at:
|
|
190
|
+
type: string
|
|
191
|
+
format: date-time
|
|
192
|
+
example: "2024-01-15T10:30:00Z"
|
|
193
|
+
updated_at:
|
|
194
|
+
type: string
|
|
195
|
+
format: date-time
|
|
196
|
+
example: "2024-01-15T10:30:00Z"
|
|
197
|
+
400:
|
|
198
|
+
description: Invalid ID format or query error
|
|
199
|
+
"""
|
|
200
|
+
return super().get(instance_id)
|
|
201
|
+
|
|
202
|
+
@jwt_required()
|
|
203
|
+
def put(self, instance_id):
|
|
204
|
+
"""
|
|
205
|
+
Update file status
|
|
206
|
+
---
|
|
207
|
+
tags:
|
|
208
|
+
- Crud
|
|
209
|
+
description: Update a file status with data provided in the
|
|
210
|
+
request body. JSON format is expected.
|
|
211
|
+
parameters:
|
|
212
|
+
- in: path
|
|
213
|
+
name: instance_id
|
|
214
|
+
required: true
|
|
215
|
+
schema:
|
|
216
|
+
type: string
|
|
217
|
+
format: uuid
|
|
218
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
219
|
+
requestBody:
|
|
220
|
+
required: true
|
|
221
|
+
content:
|
|
222
|
+
application/json:
|
|
223
|
+
schema:
|
|
224
|
+
type: object
|
|
225
|
+
properties:
|
|
226
|
+
name:
|
|
227
|
+
type: string
|
|
228
|
+
example: Rejected
|
|
229
|
+
color:
|
|
230
|
+
type: string
|
|
231
|
+
example: "#FF0000"
|
|
232
|
+
responses:
|
|
233
|
+
200:
|
|
234
|
+
description: File status updated successfully
|
|
235
|
+
content:
|
|
236
|
+
application/json:
|
|
237
|
+
schema:
|
|
238
|
+
type: object
|
|
239
|
+
properties:
|
|
240
|
+
id:
|
|
241
|
+
type: string
|
|
242
|
+
format: uuid
|
|
243
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
244
|
+
name:
|
|
245
|
+
type: string
|
|
246
|
+
example: Rejected
|
|
247
|
+
color:
|
|
248
|
+
type: string
|
|
249
|
+
example: "#FF0000"
|
|
250
|
+
created_at:
|
|
251
|
+
type: string
|
|
252
|
+
format: date-time
|
|
253
|
+
example: "2024-01-15T10:30:00Z"
|
|
254
|
+
updated_at:
|
|
255
|
+
type: string
|
|
256
|
+
format: date-time
|
|
257
|
+
example: "2024-01-15T11:00:00Z"
|
|
258
|
+
400:
|
|
259
|
+
description: Invalid data format or validation error
|
|
260
|
+
"""
|
|
261
|
+
return super().put(instance_id)
|
|
262
|
+
|
|
263
|
+
@jwt_required()
|
|
264
|
+
def delete(self, instance_id):
|
|
265
|
+
"""
|
|
266
|
+
Delete file status
|
|
267
|
+
---
|
|
268
|
+
tags:
|
|
269
|
+
- Crud
|
|
270
|
+
description: Delete a file status by its ID. Returns empty
|
|
271
|
+
response on success.
|
|
272
|
+
parameters:
|
|
273
|
+
- in: path
|
|
274
|
+
name: instance_id
|
|
275
|
+
required: true
|
|
276
|
+
schema:
|
|
277
|
+
type: string
|
|
278
|
+
format: uuid
|
|
279
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
280
|
+
responses:
|
|
281
|
+
204:
|
|
282
|
+
description: File status deleted successfully
|
|
283
|
+
400:
|
|
284
|
+
description: Integrity error or cannot delete
|
|
285
|
+
"""
|
|
286
|
+
return super().delete(instance_id)
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
from flask_jwt_extended import jwt_required
|
|
2
|
+
|
|
1
3
|
from zou.app.models.hardware_item import HardwareItem
|
|
2
4
|
from zou.app.blueprints.crud.base import BaseModelResource, BaseModelsResource
|
|
3
5
|
|
|
@@ -6,7 +8,273 @@ class HardwareItemsResource(BaseModelsResource):
|
|
|
6
8
|
def __init__(self):
|
|
7
9
|
BaseModelsResource.__init__(self, HardwareItem)
|
|
8
10
|
|
|
11
|
+
@jwt_required()
|
|
12
|
+
def get(self):
|
|
13
|
+
"""
|
|
14
|
+
Get hardware items
|
|
15
|
+
---
|
|
16
|
+
tags:
|
|
17
|
+
- Crud
|
|
18
|
+
description: Retrieve all hardware items. Supports filtering via
|
|
19
|
+
query parameters and pagination.
|
|
20
|
+
parameters:
|
|
21
|
+
- in: query
|
|
22
|
+
name: page
|
|
23
|
+
required: false
|
|
24
|
+
schema:
|
|
25
|
+
type: integer
|
|
26
|
+
example: 1
|
|
27
|
+
description: Page number for pagination
|
|
28
|
+
- in: query
|
|
29
|
+
name: limit
|
|
30
|
+
required: false
|
|
31
|
+
schema:
|
|
32
|
+
type: integer
|
|
33
|
+
example: 50
|
|
34
|
+
description: Number of results per page
|
|
35
|
+
- in: query
|
|
36
|
+
name: relations
|
|
37
|
+
required: false
|
|
38
|
+
schema:
|
|
39
|
+
type: boolean
|
|
40
|
+
default: false
|
|
41
|
+
example: false
|
|
42
|
+
description: Whether to include relations
|
|
43
|
+
responses:
|
|
44
|
+
200:
|
|
45
|
+
description: Hardware items retrieved successfully
|
|
46
|
+
content:
|
|
47
|
+
application/json:
|
|
48
|
+
schema:
|
|
49
|
+
oneOf:
|
|
50
|
+
- type: array
|
|
51
|
+
items:
|
|
52
|
+
type: object
|
|
53
|
+
- type: object
|
|
54
|
+
properties:
|
|
55
|
+
data:
|
|
56
|
+
type: array
|
|
57
|
+
items:
|
|
58
|
+
type: object
|
|
59
|
+
example: []
|
|
60
|
+
total:
|
|
61
|
+
type: integer
|
|
62
|
+
example: 100
|
|
63
|
+
nb_pages:
|
|
64
|
+
type: integer
|
|
65
|
+
example: 2
|
|
66
|
+
limit:
|
|
67
|
+
type: integer
|
|
68
|
+
example: 50
|
|
69
|
+
offset:
|
|
70
|
+
type: integer
|
|
71
|
+
example: 0
|
|
72
|
+
page:
|
|
73
|
+
type: integer
|
|
74
|
+
example: 1
|
|
75
|
+
400:
|
|
76
|
+
description: Invalid filter format or query error
|
|
77
|
+
"""
|
|
78
|
+
return super().get()
|
|
79
|
+
|
|
80
|
+
@jwt_required()
|
|
81
|
+
def post(self):
|
|
82
|
+
"""
|
|
83
|
+
Create hardware item
|
|
84
|
+
---
|
|
85
|
+
tags:
|
|
86
|
+
- Crud
|
|
87
|
+
description: Create a new hardware item with data provided in the
|
|
88
|
+
request body. JSON format is expected.
|
|
89
|
+
requestBody:
|
|
90
|
+
required: true
|
|
91
|
+
content:
|
|
92
|
+
application/json:
|
|
93
|
+
schema:
|
|
94
|
+
type: object
|
|
95
|
+
required:
|
|
96
|
+
- name
|
|
97
|
+
properties:
|
|
98
|
+
name:
|
|
99
|
+
type: string
|
|
100
|
+
example: Workstation 01
|
|
101
|
+
serial_number:
|
|
102
|
+
type: string
|
|
103
|
+
example: SN123456
|
|
104
|
+
responses:
|
|
105
|
+
201:
|
|
106
|
+
description: Hardware item created successfully
|
|
107
|
+
content:
|
|
108
|
+
application/json:
|
|
109
|
+
schema:
|
|
110
|
+
type: object
|
|
111
|
+
properties:
|
|
112
|
+
id:
|
|
113
|
+
type: string
|
|
114
|
+
format: uuid
|
|
115
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
116
|
+
name:
|
|
117
|
+
type: string
|
|
118
|
+
example: Workstation 01
|
|
119
|
+
serial_number:
|
|
120
|
+
type: string
|
|
121
|
+
example: SN123456
|
|
122
|
+
created_at:
|
|
123
|
+
type: string
|
|
124
|
+
format: date-time
|
|
125
|
+
example: "2024-01-15T10:30:00Z"
|
|
126
|
+
updated_at:
|
|
127
|
+
type: string
|
|
128
|
+
format: date-time
|
|
129
|
+
example: "2024-01-15T10:30:00Z"
|
|
130
|
+
400:
|
|
131
|
+
description: Invalid data format or validation error
|
|
132
|
+
"""
|
|
133
|
+
return super().post()
|
|
134
|
+
|
|
9
135
|
|
|
10
136
|
class HardwareItemResource(BaseModelResource):
|
|
11
137
|
def __init__(self):
|
|
12
138
|
BaseModelResource.__init__(self, HardwareItem)
|
|
139
|
+
|
|
140
|
+
@jwt_required()
|
|
141
|
+
def get(self, instance_id):
|
|
142
|
+
"""
|
|
143
|
+
Get hardware item
|
|
144
|
+
---
|
|
145
|
+
tags:
|
|
146
|
+
- Crud
|
|
147
|
+
description: Retrieve a hardware item by its ID and return it as a
|
|
148
|
+
JSON object. Supports including relations.
|
|
149
|
+
parameters:
|
|
150
|
+
- in: path
|
|
151
|
+
name: instance_id
|
|
152
|
+
required: true
|
|
153
|
+
schema:
|
|
154
|
+
type: string
|
|
155
|
+
format: uuid
|
|
156
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
157
|
+
- in: query
|
|
158
|
+
name: relations
|
|
159
|
+
required: false
|
|
160
|
+
schema:
|
|
161
|
+
type: boolean
|
|
162
|
+
default: true
|
|
163
|
+
example: true
|
|
164
|
+
description: Whether to include relations
|
|
165
|
+
responses:
|
|
166
|
+
200:
|
|
167
|
+
description: Hardware item retrieved successfully
|
|
168
|
+
content:
|
|
169
|
+
application/json:
|
|
170
|
+
schema:
|
|
171
|
+
type: object
|
|
172
|
+
properties:
|
|
173
|
+
id:
|
|
174
|
+
type: string
|
|
175
|
+
format: uuid
|
|
176
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
177
|
+
name:
|
|
178
|
+
type: string
|
|
179
|
+
example: Workstation 01
|
|
180
|
+
serial_number:
|
|
181
|
+
type: string
|
|
182
|
+
example: SN123456
|
|
183
|
+
created_at:
|
|
184
|
+
type: string
|
|
185
|
+
format: date-time
|
|
186
|
+
example: "2024-01-15T10:30:00Z"
|
|
187
|
+
updated_at:
|
|
188
|
+
type: string
|
|
189
|
+
format: date-time
|
|
190
|
+
example: "2024-01-15T10:30:00Z"
|
|
191
|
+
400:
|
|
192
|
+
description: Invalid ID format or query error
|
|
193
|
+
"""
|
|
194
|
+
return super().get(instance_id)
|
|
195
|
+
|
|
196
|
+
@jwt_required()
|
|
197
|
+
def put(self, instance_id):
|
|
198
|
+
"""
|
|
199
|
+
Update hardware item
|
|
200
|
+
---
|
|
201
|
+
tags:
|
|
202
|
+
- Crud
|
|
203
|
+
description: Update a hardware item with data provided in the
|
|
204
|
+
request body. JSON format is expected.
|
|
205
|
+
parameters:
|
|
206
|
+
- in: path
|
|
207
|
+
name: instance_id
|
|
208
|
+
required: true
|
|
209
|
+
schema:
|
|
210
|
+
type: string
|
|
211
|
+
format: uuid
|
|
212
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
213
|
+
requestBody:
|
|
214
|
+
required: true
|
|
215
|
+
content:
|
|
216
|
+
application/json:
|
|
217
|
+
schema:
|
|
218
|
+
type: object
|
|
219
|
+
properties:
|
|
220
|
+
name:
|
|
221
|
+
type: string
|
|
222
|
+
example: Updated Workstation 01
|
|
223
|
+
serial_number:
|
|
224
|
+
type: string
|
|
225
|
+
example: SN123457
|
|
226
|
+
responses:
|
|
227
|
+
200:
|
|
228
|
+
description: Hardware item updated successfully
|
|
229
|
+
content:
|
|
230
|
+
application/json:
|
|
231
|
+
schema:
|
|
232
|
+
type: object
|
|
233
|
+
properties:
|
|
234
|
+
id:
|
|
235
|
+
type: string
|
|
236
|
+
format: uuid
|
|
237
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
238
|
+
name:
|
|
239
|
+
type: string
|
|
240
|
+
example: Updated Workstation 01
|
|
241
|
+
serial_number:
|
|
242
|
+
type: string
|
|
243
|
+
example: SN123457
|
|
244
|
+
created_at:
|
|
245
|
+
type: string
|
|
246
|
+
format: date-time
|
|
247
|
+
example: "2024-01-15T10:30:00Z"
|
|
248
|
+
updated_at:
|
|
249
|
+
type: string
|
|
250
|
+
format: date-time
|
|
251
|
+
example: "2024-01-15T11:00:00Z"
|
|
252
|
+
400:
|
|
253
|
+
description: Invalid data format or validation error
|
|
254
|
+
"""
|
|
255
|
+
return super().put(instance_id)
|
|
256
|
+
|
|
257
|
+
@jwt_required()
|
|
258
|
+
def delete(self, instance_id):
|
|
259
|
+
"""
|
|
260
|
+
Delete hardware item
|
|
261
|
+
---
|
|
262
|
+
tags:
|
|
263
|
+
- Crud
|
|
264
|
+
description: Delete a hardware item by its ID. Returns empty
|
|
265
|
+
response on success.
|
|
266
|
+
parameters:
|
|
267
|
+
- in: path
|
|
268
|
+
name: instance_id
|
|
269
|
+
required: true
|
|
270
|
+
schema:
|
|
271
|
+
type: string
|
|
272
|
+
format: uuid
|
|
273
|
+
example: a24a6ea4-ce75-4665-a070-57453082c25
|
|
274
|
+
responses:
|
|
275
|
+
204:
|
|
276
|
+
description: Hardware item deleted successfully
|
|
277
|
+
400:
|
|
278
|
+
description: Integrity error or cannot delete
|
|
279
|
+
"""
|
|
280
|
+
return super().delete(instance_id)
|