Bug 26633: Add API documentation
[koha.git] / api / v1 / swagger / paths / public_patrons.json
1 {
2     "/public/patrons/{patron_id}/password": {
3         "post": {
4             "x-mojo-to": "Patrons::Password#set_public",
5             "operationId": "setPatronPasswordPublic",
6             "tags": [
7                 "patron"
8             ],
9             "parameters": [
10                 {
11                     "$ref": "../parameters.json#/patron_id_pp"
12                 },
13                 {
14                     "name": "body",
15                     "in": "body",
16                     "description": "A JSON object containing password information",
17                     "schema": {
18                         "type": "object",
19                         "properties": {
20                             "password": {
21                                 "description": "New password (plain text)",
22                                 "type": "string"
23                             },
24                             "password_repeated": {
25                                 "description": "Repeated new password (plain text)",
26                                 "type": "string"
27                             },
28                             "old_password": {
29                                 "description": "Patron's original password",
30                                 "type": "string"
31                             }
32                         },
33                         "required": [
34                             "password",
35                             "password_repeated",
36                             "old_password"
37                         ]
38                     }
39                 }
40             ],
41             "produces": [
42                 "application/json"
43             ],
44             "responses": {
45                 "200": {
46                     "description": "Password changed"
47                 },
48                 "400": {
49                     "description": "Bad request",
50                     "schema": {
51                         "$ref": "../definitions.json#/error"
52                     }
53                 },
54                 "401": {
55                     "description": "Authentication required",
56                     "schema": {
57                         "$ref": "../definitions.json#/error"
58                     }
59                 },
60                 "403": {
61                     "description": "Access forbidden",
62                     "schema": {
63                         "$ref": "../definitions.json#/error"
64                     }
65                 },
66                 "404": {
67                     "description": "Patron not found",
68                     "schema": {
69                         "$ref": "../definitions.json#/error"
70                     }
71                 },
72                 "500": {
73                     "description": "Internal server error",
74                     "schema": {
75                         "$ref": "../definitions.json#/error"
76                     }
77                 },
78                 "503": {
79                     "description": "Under maintenance",
80                     "schema": {
81                         "$ref": "../definitions.json#/error"
82                     }
83                 }
84             },
85             "x-koha-authorization": {
86                 "allow-owner": true
87             }
88         }
89     },
90     "/public/patrons/{patron_id}/guarantors/can_see_charges": {
91         "put": {
92             "x-mojo-to": "Patrons#guarantors_can_see_charges",
93             "operationId": "setPatronGuarantorsCanSeeCharges",
94             "tags": [
95                 "patron"
96             ],
97             "parameters": [
98                 {
99                     "$ref": "../parameters.json#/patron_id_pp"
100                 },
101                 {
102                     "name": "body",
103                     "in": "body",
104                     "description": "A boolean representing if guarantors should be able to see the patron's charges",
105                     "required": true,
106                     "schema": {
107                         "type": "object",
108                         "properties": {
109                             "allowed": {
110                                 "type": "boolean"
111                             }
112                         }
113                     }
114                 }
115             ],
116             "produces": [
117                 "application/json"
118             ],
119             "responses": {
120                 "200": {
121                     "description": "Charges view policy for guarantors changed"
122                 },
123                 "400": {
124                     "description": "Bad request",
125                     "schema": {
126                         "$ref": "../definitions.json#/error"
127                     }
128                 },
129                 "401": {
130                     "description": "Authentication required",
131                     "schema": {
132                         "$ref": "../definitions.json#/error"
133                     }
134                 },
135                 "403": {
136                     "description": "Access forbidden",
137                     "schema": {
138                         "$ref": "../definitions.json#/error"
139                     }
140                 },
141                 "404": {
142                     "description": "Patron not found",
143                     "schema": {
144                         "$ref": "../definitions.json#/error"
145                     }
146                 },
147                 "500": {
148                     "description": "Internal server error",
149                     "schema": {
150                         "$ref": "../definitions.json#/error"
151                     }
152                 },
153                 "503": {
154                     "description": "Under maintenance",
155                     "schema": {
156                         "$ref": "../definitions.json#/error"
157                     }
158                 }
159             },
160             "x-koha-authorization": {
161                 "allow-owner": true
162             }
163         }
164     },
165     "/public/patrons/{patron_id}/guarantors/can_see_checkouts": {
166         "put": {
167             "x-mojo-to": "Patrons#guarantors_can_see_checkouts",
168             "operationId": "setPatronGuarantorsCanSeeCheckouts",
169             "tags": [
170                 "patron"
171             ],
172             "parameters": [
173                 {
174                     "$ref": "../parameters.json#/patron_id_pp"
175                 },
176                 {
177                     "name": "body",
178                     "in": "body",
179                     "description": "A boolean representing if guarantors should be able to see the patron's checkouts",
180                     "required": true,
181                     "schema": {
182                         "type": "object",
183                         "properties": {
184                             "allowed": {
185                                 "type": "boolean"
186                             }
187                         }
188                     }
189                 }
190             ],
191             "produces": [
192                 "application/json"
193             ],
194             "responses": {
195                 "200": {
196                     "description": "Check-out view policy for guarantors changed"
197                 },
198                 "400": {
199                     "description": "Bad request",
200                     "schema": {
201                         "$ref": "../definitions.json#/error"
202                     }
203                 },
204                 "401": {
205                     "description": "Authentication required",
206                     "schema": {
207                         "$ref": "../definitions.json#/error"
208                     }
209                 },
210                 "403": {
211                     "description": "Access forbidden",
212                     "schema": {
213                         "$ref": "../definitions.json#/error"
214                     }
215                 },
216                 "404": {
217                     "description": "Patron not found",
218                     "schema": {
219                         "$ref": "../definitions.json#/error"
220                     }
221                 },
222                 "500": {
223                     "description": "Internal server error",
224                     "schema": {
225                         "$ref": "../definitions.json#/error"
226                     }
227                 },
228                 "503": {
229                     "description": "Under maintenance",
230                     "schema": {
231                         "$ref": "../definitions.json#/error"
232                     }
233                 }
234             },
235             "x-koha-authorization": {
236                 "allow-owner": true
237             }
238         }
239     }
240 }