Bug 23019: (follow-up) Fix test permissions and API definition bugs
[koha.git] / api / v1 / swagger / paths / import_batch_profiles.json
1 {
2   "/import_batch_profiles": {
3     "get": {
4       "x-mojo-to": "ImportBatchProfiles#list",
5       "operationId": "listImportBatchProfiles",
6       "tags": [
7         "ImportBatchProfiles"
8       ],
9       "parameters": [
10         {
11           "name": "name",
12           "in": "query",
13           "description": "Search on profile's name",
14           "required": false,
15           "type": "string"
16         },
17         {
18           "$ref": "../parameters.json#/match"
19         },
20         {
21           "$ref": "../parameters.json#/order_by"
22         },
23         {
24           "$ref": "../parameters.json#/page"
25         },
26         {
27           "$ref": "../parameters.json#/per_page"
28         }
29       ],
30       "consumes": [
31         "application/json"
32       ],
33       "produces": [
34         "application/json"
35       ],
36       "responses": {
37         "200": {
38           "description": "A list of import batch profiles",
39           "schema": {
40             "$ref": "../definitions.json#/import_batch_profiles"
41           }
42         },
43         "401": {
44           "description": "Authentication required",
45           "schema": {
46             "$ref": "../definitions.json#/error"
47           }
48         },
49         "403": {
50           "description": "Access forbidden",
51           "schema": {
52             "$ref": "../definitions.json#/error"
53           }
54         },
55         "500": {
56           "description": "Internal server error",
57           "schema": {
58             "$ref": "../definitions.json#/error"
59           }
60         },
61         "503": {
62           "description": "Under maintenance",
63           "schema": {
64             "$ref": "../definitions.json#/error"
65           }
66         }
67       },
68       "x-koha-authorization": {
69         "permissions": {
70           "tools": "stage_marc_import"
71         }
72       }
73     },
74     "post": {
75       "x-mojo-to": "ImportBatchProfiles#add",
76       "operationId": "addImportBatchProfiles",
77       "tags": [
78         "ImportBatchProfiles"
79       ],
80       "parameters": [
81         {
82           "name": "body",
83           "in": "body",
84           "description": "A JSON object containing a import batch profile",
85           "required": true,
86           "schema": {
87             "type": "object",
88             "properties": {
89               "name": {
90                 "description": "name of this profile",
91                 "type": "string"
92               },
93               "matcher_id": {
94                 "description": "the id of the match rule used (matchpoints.matcher_id)",
95                 "type": ["integer", "null"]
96               },
97               "template_id": {
98                 "description": "the id of the marc modification template",
99                 "type": ["integer", "null"]
100               },
101               "overlay_action": {
102                 "description": "how to handle duplicate records",
103                 "type": ["string", "null"]
104               },
105               "nomatch_action": {
106                 "description": "how to handle records where no match is found",
107                 "type": ["string", "null"]
108               },
109               "item_action": {
110                 "description": "what to do with item records",
111                 "type": ["string", "null"]
112               },
113               "parse_items": {
114                 "description": "should items be parsed",
115                 "type": ["boolean", "null"]
116               },
117               "record_type": {
118                 "description": "type of record in the batch",
119                 "type": ["string", "null"]
120               },
121               "encoding": {
122                 "description": "file encoding",
123                 "type": ["string", "null"]
124               },
125               "format": {
126                 "description": "marc format",
127                 "type": ["string", "null"]
128               },
129               "comments": {
130                 "description": "any comments added when the file was uploaded",
131                 "type": ["string", "null"]
132               }
133             }
134           }
135         }
136       ],
137       "consumes": ["application/json"],
138       "produces": ["application/json"],
139       "responses": {
140         "201": {
141           "description": "Created Profile",
142           "schema": {
143             "$ref": "../definitions.json#/import_batch_profile"
144           }
145         },
146         "400": {
147           "description": "Missing or wrong parameters",
148           "schema": {
149             "$ref": "../definitions.json#/error"
150           }
151         },
152         "401": {
153           "description": "Authentication required",
154           "schema": {
155             "$ref": "../definitions.json#/error"
156           }
157         },
158         "403": {
159           "description": "Hold not allowed",
160           "schema": {
161             "$ref": "../definitions.json#/error"
162           }
163         },
164         "404": {
165           "description": "Borrower not found",
166           "schema": {
167             "$ref": "../definitions.json#/error"
168           }
169         },
170         "500": {
171           "description": "Internal server error",
172           "schema": {
173             "$ref": "../definitions.json#/error"
174           }
175         },
176         "503": {
177           "description": "Under maintenance",
178           "schema": {
179             "$ref": "../definitions.json#/error"
180           }
181         }
182       },
183       "x-koha-authorization": {
184         "permissions": {
185           "tools": "stage_marc_import"
186         }
187       }
188     }
189   },
190   "/import_batch_profiles/{import_batch_profile_id}": {
191     "put": {
192       "x-mojo-to": "ImportBatchProfiles#edit",
193       "operationId": "editImportBatchProfiles",
194       "tags": [
195         "ImportBatchProfiles"
196       ],
197       "parameters": [
198         {
199           "$ref": "../parameters.json#/import_batch_profile_id_pp"
200         },
201         {
202           "name": "body",
203           "in": "body",
204           "description": "A JSON object containing a import batch profile",
205           "required": true,
206           "schema": {
207             "type": "object",
208             "properties": {
209               "name": {
210                 "description": "name of this profile",
211                 "type": "string"
212               },
213               "matcher_id": {
214                 "description": "the id of the match rule used (matchpoints.matcher_id)",
215                 "type": ["integer", "null"]
216               },
217               "template_id": {
218                 "description": "the id of the marc modification template",
219                 "type": ["integer", "null"]
220               },
221               "overlay_action": {
222                 "description": "how to handle duplicate records",
223                 "type": ["string", "null"]
224               },
225               "nomatch_action": {
226                 "description": "how to handle records where no match is found",
227                 "type": ["string", "null"]
228               },
229               "item_action": {
230                 "description": "what to do with item records",
231                 "type": ["string", "null"]
232               },
233               "parse_items": {
234                 "description": "should items be parsed",
235                 "type": ["boolean", "null"]
236               },
237               "record_type": {
238                 "description": "type of record in the batch",
239                 "type": ["string", "null"]
240               },
241               "encoding": {
242                 "description": "file encoding",
243                 "type": ["string", "null"]
244               },
245               "format": {
246                 "description": "marc format",
247                 "type": ["string", "null"]
248               },
249               "comments": {
250                 "description": "any comments added when the file was uploaded",
251                 "type": ["string", "null"]
252               }
253             }
254           }
255         }
256       ],
257       "consumes": ["application/json"],
258       "produces": ["application/json"],
259       "responses": {
260         "200": {
261           "description": "Updated profile",
262           "schema": {
263             "$ref": "../definitions.json#/import_batch_profile"
264           }
265         },
266         "400": {
267           "description": "Missing or wrong parameters",
268           "schema": {
269             "$ref": "../definitions.json#/error"
270           }
271         },
272         "401": {
273           "description": "Authentication required",
274           "schema": {
275             "$ref": "../definitions.json#/error"
276           }
277         },
278         "403": {
279           "description": "Hold not allowed",
280           "schema": {
281             "$ref": "../definitions.json#/error"
282           }
283         },
284         "404": {
285           "description": "Borrower not found",
286           "schema": {
287             "$ref": "../definitions.json#/error"
288           }
289         },
290         "500": {
291           "description": "Internal server error",
292           "schema": {
293             "$ref": "../definitions.json#/error"
294           }
295         },
296         "503": {
297           "description": "Under maintenance",
298           "schema": {
299             "$ref": "../definitions.json#/error"
300           }
301         }
302       },
303       "x-koha-authorization": {
304         "permissions": {
305           "tools": "stage_marc_import"
306         }
307       }
308     },
309     "delete": {
310       "x-mojo-to": "ImportBatchProfiles#delete",
311       "operationId": "deleteImportBatchProfiles",
312       "tags": ["ImportBatchProfiles"],
313       "parameters": [{
314           "$ref": "../parameters.json#/import_batch_profile_id_pp"
315         }
316       ],
317       "produces": ["application/json"],
318       "responses": {
319         "204": {
320           "description": "Profile deleted"
321         },
322         "401": {
323           "description": "Authentication required",
324           "schema": {
325             "$ref": "../definitions.json#/error"
326           }
327         },
328         "403": {
329           "description": "Hold not allowed",
330           "schema": {
331             "$ref": "../definitions.json#/error"
332           }
333         },
334         "404": {
335           "description": "Hold not found",
336           "schema": {
337             "$ref": "../definitions.json#/error"
338           }
339         },
340         "500": {
341           "description": "Internal server error",
342           "schema": {
343             "$ref": "../definitions.json#/error"
344           }
345         },
346         "503": {
347           "description": "Under maintenance",
348           "schema": {
349             "$ref": "../definitions.json#/error"
350           }
351         }
352       },
353       "x-koha-authorization": {
354         "permissions": {
355           "tools": "stage_marc_import"
356         }
357       }
358     }
359   }
360 }