Bug 28461: Fix SMTP servers and extended attributes
[koha.git] / api / v1 / swagger / paths / patrons_extended_attributes.json
1 {
2   "/patrons/{patron_id}/extended_attributes": {
3     "get": {
4       "x-mojo-to": "Patrons::Attributes#list_patron_attributes",
5       "operationId": "getPatronAttributes",
6       "tags": [
7         "patrons"
8       ],
9       "parameters": [
10         {
11           "$ref": "../parameters.json#/patron_id_pp"
12         },
13         {
14           "$ref": "../parameters.json#/match"
15         },
16         {
17           "$ref": "../parameters.json#/order_by"
18         },
19         {
20           "$ref": "../parameters.json#/page"
21         },
22         {
23           "$ref": "../parameters.json#/per_page"
24         },
25         {
26           "$ref": "../parameters.json#/q_param"
27         },
28         {
29           "$ref": "../parameters.json#/q_body"
30         },
31         {
32           "$ref": "../parameters.json#/q_header"
33         }
34       ],
35       "produces": [
36         "application/json"
37       ],
38       "responses": {
39         "200": {
40           "description": "The patron extended attributes",
41           "schema": {
42             "type": "array",
43             "items": {
44               "$ref": "../definitions.json#/patron_extended_attribute"
45             }
46           }
47         },
48         "401": {
49           "description": "Authentication required",
50           "schema": {
51             "$ref": "../definitions.json#/error"
52           }
53         },
54         "403": {
55           "description": "Access forbidden",
56           "schema": {
57             "$ref": "../definitions.json#/error"
58           }
59         },
60         "404": {
61           "description": "Patron not found",
62           "schema": {
63             "$ref": "../definitions.json#/error"
64           }
65         },
66         "500": {
67           "description": "Internal server error",
68           "schema": {
69             "$ref": "../definitions.json#/error"
70           }
71         },
72         "503": {
73           "description": "Under maintenance",
74           "schema": {
75             "$ref": "../definitions.json#/error"
76           }
77         }
78       },
79       "x-koha-authorization": {
80         "permissions": {
81           "borrowers": "edit_borrowers"
82         }
83       }
84     },
85     "post": {
86       "x-mojo-to": "Patrons::Attributes#add",
87       "operationId": "addPatronAttribute",
88       "tags": [
89         "patrons"
90       ],
91       "parameters": [
92         {
93           "$ref": "../parameters.json#/patron_id_pp"
94         },
95         {
96           "name": "body",
97           "in": "body",
98           "description": "A JSON representation of the patron extended attribute",
99           "required": true,
100           "schema": {
101             "$ref": "../definitions.json#/patron_extended_attribute"
102           }
103         }
104       ],
105       "produces": [
106         "application/json"
107       ],
108       "responses": {
109         "201": {
110           "description": "A successfully created patron extended attribute",
111           "schema": {
112             "$ref": "../definitions.json#/patron_extended_attribute"
113           }
114         },
115         "400": {
116           "description": "Bad parameter",
117           "schema": {
118             "$ref": "../definitions.json#/error"
119           }
120         },
121         "401": {
122           "description": "Authentication required",
123           "schema": {
124             "$ref": "../definitions.json#/error"
125           }
126         },
127         "403": {
128           "description": "Access forbidden",
129           "schema": {
130             "$ref": "../definitions.json#/error"
131           }
132         },
133         "404": {
134           "description": "Patron not found",
135           "schema": {
136             "$ref": "../definitions.json#/error"
137           }
138         },
139         "409": {
140           "description": "Conflict in creating resource",
141           "schema": {
142             "$ref": "../definitions.json#/error"
143           }
144         },
145         "500": {
146           "description": "Internal server error",
147           "schema": {
148             "$ref": "../definitions.json#/error"
149           }
150         },
151         "503": {
152           "description": "Under maintenance",
153           "schema": {
154             "$ref": "../definitions.json#/error"
155           }
156         }
157       },
158       "x-koha-authorization": {
159         "permissions": {
160           "borrowers": "edit_borrowers"
161         }
162       }
163     },
164     "put": {
165       "x-mojo-to": "Patrons::Attributes#overwrite",
166       "operationId": "overwritePatronAttributes",
167       "tags": [
168         "patrons"
169       ],
170       "parameters": [
171         {
172           "$ref": "../parameters.json#/patron_id_pp"
173         },
174         {
175           "name": "body",
176           "in": "body",
177           "description": "A JSON representation of the patron extended attribute",
178           "required": true,
179           "schema": {
180             "type": "array",
181             "items": {
182               "$ref": "../definitions.json#/patron_extended_attribute"
183             }
184           }
185         }
186       ],
187       "produces": [
188         "application/json"
189       ],
190       "responses": {
191         "200": {
192           "description": "The successfully created patron extended attributes",
193           "schema": {
194             "type": "array",
195             "items": {
196               "$ref": "../definitions.json#/patron_extended_attribute"
197             }
198           }
199         },
200         "400": {
201           "description": "Bad parameters",
202           "schema": {
203             "$ref": "../definitions.json#/error"
204           }
205         },
206         "401": {
207           "description": "Authentication required",
208           "schema": {
209             "$ref": "../definitions.json#/error"
210           }
211         },
212         "403": {
213           "description": "Access forbidden",
214           "schema": {
215             "$ref": "../definitions.json#/error"
216           }
217         },
218         "404": {
219           "description": "Patron not found",
220           "schema": {
221             "$ref": "../definitions.json#/error"
222           }
223         },
224         "409": {
225           "description": "Conflict in creating resource",
226           "schema": {
227             "$ref": "../definitions.json#/error"
228           }
229         },
230         "500": {
231           "description": "Internal server error",
232           "schema": {
233             "$ref": "../definitions.json#/error"
234           }
235         },
236         "503": {
237           "description": "Under maintenance",
238           "schema": {
239             "$ref": "../definitions.json#/error"
240           }
241         }
242       },
243       "x-koha-authorization": {
244         "permissions": {
245           "borrowers": "edit_borrowers"
246         }
247       }
248     }
249   },
250   "/patrons/{patron_id}/extended_attributes/{extended_attribute_id}": {
251     "patch": {
252       "x-mojo-to": "Patrons::Attributes#update",
253       "operationId": "updatePatronAttribute",
254       "tags": [
255         "patrons"
256       ],
257       "parameters": [
258         {
259           "$ref": "../parameters.json#/patron_id_pp"
260         },
261         {
262           "name": "extended_attribute_id",
263           "in": "path",
264           "description": "Internal patron extended attribute identifier",
265           "type": "integer",
266           "required": true
267         },
268         {
269           "name": "body",
270           "in": "body",
271           "description": "An object containing the updated values for the patron extended attribute",
272           "required": true,
273           "schema": {
274             "type": "object",
275             "properties": {
276               "value": {
277                 "description": "Extended attribute value",
278                 "type": "string"
279               }
280             },
281             "additionalProperties": false
282           }
283         }
284       ],
285       "produces": [
286         "application/json"
287       ],
288       "responses": {
289         "200": {
290           "description": "A successfully updated patron extended attribute",
291           "schema": {
292             "$ref": "../definitions.json#/patron_extended_attribute"
293           }
294         },
295         "400": {
296           "description": "Bad parameter",
297           "schema": {
298             "$ref": "../definitions.json#/error"
299           }
300         },
301         "401": {
302           "description": "Authentication required",
303           "schema": {
304             "$ref": "../definitions.json#/error"
305           }
306         },
307         "403": {
308           "description": "Access forbidden",
309           "schema": {
310             "$ref": "../definitions.json#/error"
311           }
312         },
313         "404": {
314           "description": "Object not found",
315           "schema": {
316             "$ref": "../definitions.json#/error"
317           }
318         },
319         "409": {
320           "description": "Conflict in updating resource",
321           "schema": {
322             "$ref": "../definitions.json#/error"
323           }
324         },
325         "500": {
326           "description": "Internal server error",
327           "schema": {
328             "$ref": "../definitions.json#/error"
329           }
330         },
331         "503": {
332           "description": "Under maintenance",
333           "schema": {
334             "$ref": "../definitions.json#/error"
335           }
336         }
337       },
338       "x-koha-authorization": {
339         "permissions": {
340           "borrowers": "edit_borrowers"
341         }
342       }
343     },
344     "delete": {
345       "x-mojo-to": "Patrons::Attributes#delete",
346       "operationId": "deletePatronAttribute",
347       "tags": [
348         "patrons"
349       ],
350       "parameters": [
351         {
352           "$ref": "../parameters.json#/patron_id_pp"
353         },
354         {
355           "name": "extended_attribute_id",
356           "in": "path",
357           "description": "Internal patron extended attribute identifier",
358           "type": "integer",
359           "required": true
360         }
361       ],
362       "produces": [
363         "application/json"
364       ],
365       "responses": {
366         "204": {
367           "description": "Extended patron attribute deleted"
368         },
369         "401": {
370           "description": "Authentication required",
371           "schema": {
372             "$ref": "../definitions.json#/error"
373           }
374         },
375         "403": {
376           "description": "Access forbidden",
377           "schema": {
378             "$ref": "../definitions.json#/error"
379           }
380         },
381         "404": {
382           "description": "Patron not found",
383           "schema": {
384             "$ref": "../definitions.json#/error"
385           }
386         },
387         "500": {
388           "description": "Internal server error",
389           "schema": {
390             "$ref": "../definitions.json#/error"
391           }
392         },
393         "503": {
394           "description": "Under maintenance",
395           "schema": {
396             "$ref": "../definitions.json#/error"
397           }
398         }
399       },
400       "x-koha-authorization": {
401         "permissions": {
402           "borrowers": "edit_borrowers"
403         }
404       }
405     }
406   }
407 }