Bug 33145: Fix ERM swagger specs
[koha.git] / api / v1 / swagger / paths / erm_eholdings_titles.yaml
1 ---
2 /erm/eholdings/{provider}/titles:
3   get:
4     x-mojo-to: ERM::EHoldings::Titles#list
5     operationId: listErmEHoldingsTitles
6     tags:
7       - eholdings
8     summary: List eholdings titles
9     produces:
10       - application/json
11     parameters:
12       - description: Provider name
13         in: path
14         name: provider
15         required: true
16         type: string
17       - description: Case insensitive search on title title_id
18         in: query
19         name: title_id
20         required: false
21         type: integer
22       - description: Case insensitive search on title publication_title
23         in: query
24         name: publication_title
25         required: false
26         type: string
27       - description: Case insensitive search on title external_id
28         in: query
29         name: external_id
30         required: false
31         type: string
32       - description: Case insensitive search on title print_identifier
33         in: query
34         name: print_identifier
35         required: false
36         type: string
37       - description: Case insensitive search on title online_identifier
38         in: query
39         name: online_identifier
40         required: false
41         type: string
42       - description: Case insensitive search on title date_first_issue_online
43         in: query
44         name: date_first_issue_online
45         required: false
46         type: string
47       - description: Case insensitive search on title num_first_vol_online
48         in: query
49         name: num_first_vol_online
50         required: false
51         type: string
52       - description: Case insensitive search on title num_first_issue_online
53         in: query
54         name: num_first_issue_online
55         required: false
56         type: string
57       - description: Case insensitive search on title date_last_issue_online
58         in: query
59         name: date_last_issue_online
60         required: false
61         type: string
62       - description: Case insensitive search on title num_last_vol_online
63         in: query
64         name: num_last_vol_online
65         required: false
66         type: string
67       - description: Case insensitive search on title num_last_issue_online
68         in: query
69         name: num_last_issue_online
70         required: false
71         type: string
72       - description: Case insensitive search on title title_url
73         in: query
74         name: title_url
75         required: false
76         type: string
77       - description: Case insensitive search on title first_author
78         in: query
79         name: first_author
80         required: false
81         type: string
82       - description: Case insensitive search on title embargo_info
83         in: query
84         name: embargo_info
85         required: false
86         type: string
87       - description: Case insensitive search on title coverage_depth
88         in: query
89         name: coverage_depth
90         required: false
91         type: string
92       - description: Case insensitive search on title notes
93         in: query
94         name: notes
95         required: false
96         type: string
97       - description: Case insensitive search on title publisher_name
98         in: query
99         name: publisher_name
100         required: false
101         type: string
102       - description: Case insensitive search on title publication_type
103         in: query
104         name: publication_type
105         required: false
106         type: string
107       - description: Case insensitive search on title date_monograph_published_print
108         in: query
109         name: date_monograph_published_print
110         required: false
111         type: string
112       - description: Case insensitive search on title date_monograph_published_online
113         in: query
114         name: date_monograph_published_online
115         required: false
116         type: string
117       - description: Case insensitive search on title monograph_volume
118         in: query
119         name: monograph_volume
120         required: false
121         type: string
122       - description: Case insensitive search on title monograph_edition
123         in: query
124         name: monograph_edition
125         required: false
126         type: string
127       - description: Case insensitive search on title first_editor
128         in: query
129         name: first_editor
130         required: false
131         type: string
132       - description: Case insensitive search on title parent_publication_title_id
133         in: query
134         name: parent_publication_title_id
135         required: false
136         type: string
137       - description: Case insensitive search on title preceeding_publication_title_id
138         in: query
139         name: preceeding_publication_title_id
140         required: false
141         type: string
142       - description: Case insensitive search on title access_type
143         in: query
144         name: access_type
145         required: false
146         type: string
147       - $ref: "../swagger.yaml#/parameters/match"
148       - $ref: "../swagger.yaml#/parameters/order_by"
149       - $ref: "../swagger.yaml#/parameters/page"
150       - $ref: "../swagger.yaml#/parameters/per_page"
151       - $ref: "../swagger.yaml#/parameters/q_param"
152       - $ref: "../swagger.yaml#/parameters/q_body"
153       - $ref: "../swagger.yaml#/parameters/q_header"
154     responses:
155       200:
156         description: A list of eHoldings titles
157         schema:
158           items:
159             $ref: "../swagger.yaml#/definitions/erm_eholdings_title"
160           type: array
161       400:
162         description: Bad request
163         schema:
164           $ref: "../swagger.yaml#/definitions/error"
165       403:
166         description: Access forbidden
167         schema:
168           $ref: "../swagger.yaml#/definitions/error"
169       500:
170         description: |-
171           Internal server error. Possible `error_code` attribute values:
172           * `internal_server_error`
173         schema:
174           $ref: "../swagger.yaml#/definitions/error"
175       503:
176         description: Under maintenance
177         schema:
178           $ref: "../swagger.yaml#/definitions/error"
179     x-koha-authorization:
180       permissions:
181         erm: 1
182   post:
183     x-mojo-to: ERM::EHoldings::Titles#add
184     operationId: addErmEHoldingsTitles
185     tags:
186       - eholdings
187     summary: Add eholding
188     consumes:
189       - application/json
190     produces:
191       - application/json
192     parameters:
193       - description: Provider name
194         in: path
195         name: provider
196         required: true
197         type: string
198       - description: A JSON object containing information about the new title
199         in: body
200         name: body
201         required: true
202         schema:
203             $ref: "../swagger.yaml#/definitions/erm_eholdings_title"
204     responses:
205       201:
206         description: A successfully created title
207         schema:
208           items:
209             $ref: "../swagger.yaml#/definitions/erm_eholdings_title"
210       400:
211         description: Bad parameter
212         schema:
213           $ref: "../swagger.yaml#/definitions/error"
214       401:
215         description: Authentication required
216         schema:
217           $ref: "../swagger.yaml#/definitions/error"
218       403:
219         description: Access forbidden
220         schema:
221           $ref: "../swagger.yaml#/definitions/error"
222       404:
223         description: Ressource not found
224         schema:
225           $ref: "../swagger.yaml#/definitions/error"
226       409:
227         description: Conflict in creating resource
228         schema:
229           $ref: "../swagger.yaml#/definitions/error"
230       500:
231         description: |-
232           Internal server error. Possible `error_code` attribute values:
233           * `internal_server_error`
234         schema:
235           $ref: "../swagger.yaml#/definitions/error"
236       503:
237         description: Under maintenance
238         schema:
239           $ref: "../swagger.yaml#/definitions/error"
240     x-koha-authorization:
241       permissions:
242         erm: 1
243 "/erm/eholdings/{provider}/titles/{title_id}":
244   get:
245     x-mojo-to: ERM::EHoldings::Titles#get
246     operationId: getErmEHoldingsTitles
247     tags:
248       - eholdings
249     summary: Get titles
250     produces:
251       - application/json
252     parameters:
253       - description: Provider name
254         in: path
255         name: provider
256         required: true
257         type: string
258       - $ref: "../swagger.yaml#/parameters/eholdings_title_id_pp"
259       - name: x-koha-embed
260         in: header
261         required: false
262         description: Embed list sent as a request header
263         type: array
264         items:
265           type: string
266           enum:
267             - resources
268             - resources.package
269         collectionFormat: csv
270     responses:
271       200:
272         description: An eHolding title
273         schema:
274           items:
275             $ref: "../swagger.yaml#/definitions/erm_eholdings_title"
276       401:
277         description: Authentication required
278         schema:
279           $ref: "../swagger.yaml#/definitions/error"
280       403:
281         description: Access forbidden
282         schema:
283           $ref: "../swagger.yaml#/definitions/error"
284       404:
285         description: Ressource not found
286         schema:
287           $ref: "../swagger.yaml#/definitions/error"
288       500:
289         description: |-
290           Internal server error. Possible `error_code` attribute values:
291           * `internal_server_error`
292         schema:
293           $ref: "../swagger.yaml#/definitions/error"
294       503:
295         description: Under maintenance
296         schema:
297           $ref: "../swagger.yaml#/definitions/error"
298     x-koha-authorization:
299       permissions:
300         erm: 1
301   put:
302     x-mojo-to: ERM::EHoldings::Titles#update
303     operationId: updateErmEHoldingsTitles
304     tags:
305       - eholdings
306     summary: Update titles
307     consumes:
308       - application/json
309     produces:
310       - application/json
311     parameters:
312       - description: Provider name
313         in: path
314         name: provider
315         required: true
316         type: string
317       - $ref: "../swagger.yaml#/parameters/eholdings_title_id_pp"
318       - name: body
319         in: body
320         description: A JSON object containing new information about existing title
321         required: true
322         schema:
323           $ref: "../swagger.yaml#/definitions/erm_eholdings_title"
324       - name: x-koha-embed
325         in: header
326         required: false
327         description: Embed list sent as a request header
328         type: array
329         items:
330           type: string
331           enum:
332             - resources
333             - resources.package
334         collectionFormat: csv
335     responses:
336       200:
337         description: A successfully updated title
338         schema:
339           items:
340             $ref: "../swagger.yaml#/definitions/erm_eholdings_title"
341       400:
342         description: Bad parameter
343         schema:
344           $ref: "../swagger.yaml#/definitions/error"
345       403:
346         description: Access forbidden
347         schema:
348           $ref: "../swagger.yaml#/definitions/error"
349       404:
350         description: Ressource not found
351         schema:
352           $ref: "../swagger.yaml#/definitions/error"
353       409:
354         description: Conflict in updating resource
355         schema:
356           $ref: "../swagger.yaml#/definitions/error"
357       500:
358         description: |-
359           Internal server error. Possible `error_code` attribute values:
360           * `internal_server_error`
361         schema:
362           $ref: "../swagger.yaml#/definitions/error"
363       503:
364         description: Under maintenance
365         schema:
366           $ref: "../swagger.yaml#/definitions/error"
367     x-koha-authorization:
368       permissions:
369         erm: 1
370   delete:
371     x-mojo-to: ERM::EHoldings::Titles#delete
372     operationId: deleteErmEHoldingsTitles
373     tags:
374       - eholdings
375     summary: Delete eHolding title
376     produces:
377       - application/json
378     parameters:
379       - description: Provider name
380         in: path
381         name: provider
382         required: true
383         type: string
384       - $ref: "../swagger.yaml#/parameters/eholdings_title_id_pp"
385     responses:
386       204:
387         description: title deleted
388       400:
389         description: title deletion failed
390         schema:
391           $ref: "../swagger.yaml#/definitions/error"
392       401:
393         description: Authentication required
394         schema:
395           $ref: "../swagger.yaml#/definitions/error"
396       403:
397         description: Access forbidden
398         schema:
399           $ref: "../swagger.yaml#/definitions/error"
400       404:
401         description: Ressource not found
402         schema:
403           $ref: "../swagger.yaml#/definitions/error"
404       409:
405         description: Conflict in deleting resource
406         schema:
407           $ref: "../swagger.yaml#/definitions/error"
408       500:
409         description: |-
410           Internal server error. Possible `error_code` attribute values:
411           * `internal_server_error`
412         schema:
413           $ref: "../swagger.yaml#/definitions/error"
414       503:
415         description: Under maintenance
416         schema:
417           $ref: "../swagger.yaml#/definitions/error"
418     x-koha-authorization:
419       permissions:
420         erm: 1
421 /erm/eholdings/local/titles/import:
422   post:
423     x-mojo-to: ERM::EHoldings::Titles#import_from_list
424     operationId: importErmEHoldingsTitles
425     tags:
426       - eholdings
427     summary: Import local titles
428     consumes:
429       - application/json
430     produces:
431       - application/json
432     parameters:
433       - description: The list_id of the list to import
434         in: body
435         name: body
436         required: true
437         schema:
438           type: object
439           properties:
440             list_id:
441               type: string
442             package_id:
443               type: string
444           additionalProperties: false
445     responses:
446       201:
447         description: Successfully enqueued the import job
448         schema:
449           type: object
450           properties:
451             job_id:
452               type: string
453           additionalProperties: false
454       400:
455         description: Bad parameter
456         schema:
457           $ref: "../swagger.yaml#/definitions/error"
458       401:
459         description: Authentication required
460         schema:
461           $ref: "../swagger.yaml#/definitions/error"
462       403:
463         description: Access forbidden
464         schema:
465           $ref: "../swagger.yaml#/definitions/error"
466       404:
467         description: Ressource not found
468         schema:
469           $ref: "../swagger.yaml#/definitions/error"
470       409:
471         description: Conflict in creating resource
472         schema:
473           $ref: "../swagger.yaml#/definitions/error"
474       500:
475         description: |-
476           Internal server error. Possible `error_code` attribute values:
477           * `internal_server_error`
478         schema:
479           $ref: "../swagger.yaml#/definitions/error"
480       503:
481         description: Under maintenance
482         schema:
483           $ref: "../swagger.yaml#/definitions/error"
484     x-koha-authorization:
485       permissions:
486         erm: 1