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