gopad 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,671 @@
1
+ # Gopad OpenAPI
2
+ #
3
+ # API definition for Gopad, Etherpad for markdown with go
4
+ #
5
+ # The version of the OpenAPI document: 1.0.0-alpha1
6
+ # Contact: gopad@webhippie.de
7
+ # Generated by: https://openapi-generator.tech
8
+ # Generator version: 7.6.0
9
+ #
10
+
11
+ require 'cgi'
12
+
13
+ module Gopad
14
+ class UserApi
15
+ attr_accessor :api_client
16
+
17
+ def initialize(api_client = ApiClient.default)
18
+ @api_client = api_client
19
+ end
20
+
21
+ # Assign a team to user
22
+ # @param user_id [String] A user identifier or slug
23
+ # @param user_team_params [UserTeamParams] The user team data to attach
24
+ # @param [Hash] opts the optional parameters
25
+ # @return [Notification]
26
+ def attach_user_to_team(user_id, user_team_params, opts = {})
27
+ data, _status_code, _headers = attach_user_to_team_with_http_info(user_id, user_team_params, opts)
28
+ data
29
+ end
30
+
31
+ # Assign a team to user
32
+ # @param user_id [String] A user identifier or slug
33
+ # @param user_team_params [UserTeamParams] The user team data to attach
34
+ # @param [Hash] opts the optional parameters
35
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
36
+ def attach_user_to_team_with_http_info(user_id, user_team_params, opts = {})
37
+ if @api_client.config.debugging
38
+ @api_client.config.logger.debug 'Calling API: UserApi.attach_user_to_team ...'
39
+ end
40
+ # verify the required parameter 'user_id' is set
41
+ if @api_client.config.client_side_validation && user_id.nil?
42
+ raise ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.attach_user_to_team"
43
+ end
44
+ # verify the required parameter 'user_team_params' is set
45
+ if @api_client.config.client_side_validation && user_team_params.nil?
46
+ raise ArgumentError, "Missing the required parameter 'user_team_params' when calling UserApi.attach_user_to_team"
47
+ end
48
+
49
+ # resource path
50
+ local_var_path = '/users/{user_id}/teams'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
51
+
52
+ # query parameters
53
+ query_params = opts[:query_params] || {}
54
+
55
+ # header parameters
56
+ header_params = opts[:header_params] || {}
57
+ # HTTP header 'Accept' (if needed)
58
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
59
+ # HTTP header 'Content-Type'
60
+ content_type = @api_client.select_header_content_type(['application/json'])
61
+ unless content_type.nil?
62
+ header_params['Content-Type'] = content_type
63
+ end
64
+
65
+ # form parameters
66
+ form_params = opts[:form_params] || {}
67
+
68
+ # http body (model)
69
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_team_params)
70
+
71
+ # return_type
72
+ return_type = opts[:debug_return_type] || 'Notification'
73
+
74
+ # auth_names
75
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
76
+
77
+ new_options = opts.merge(
78
+ operation: :'UserApi.attach_user_to_team',
79
+ header_params: header_params,
80
+ query_params: query_params,
81
+ form_params: form_params,
82
+ body: post_body,
83
+ auth_names: auth_names,
84
+ return_type: return_type
85
+ )
86
+
87
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
88
+ if @api_client.config.debugging
89
+ @api_client.config.logger.debug "API called: UserApi#attach_user_to_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
90
+ end
91
+ [data, status_code, headers]
92
+ end
93
+
94
+ # Create a new user
95
+ # @param user [User] The user data to create
96
+ # @param [Hash] opts the optional parameters
97
+ # @return [User]
98
+ def create_user(user, opts = {})
99
+ data, _status_code, _headers = create_user_with_http_info(user, opts)
100
+ data
101
+ end
102
+
103
+ # Create a new user
104
+ # @param user [User] The user data to create
105
+ # @param [Hash] opts the optional parameters
106
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
107
+ def create_user_with_http_info(user, opts = {})
108
+ if @api_client.config.debugging
109
+ @api_client.config.logger.debug 'Calling API: UserApi.create_user ...'
110
+ end
111
+ # verify the required parameter 'user' is set
112
+ if @api_client.config.client_side_validation && user.nil?
113
+ raise ArgumentError, "Missing the required parameter 'user' when calling UserApi.create_user"
114
+ end
115
+
116
+ # resource path
117
+ local_var_path = '/users'
118
+
119
+ # query parameters
120
+ query_params = opts[:query_params] || {}
121
+
122
+ # header parameters
123
+ header_params = opts[:header_params] || {}
124
+ # HTTP header 'Accept' (if needed)
125
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
126
+ # HTTP header 'Content-Type'
127
+ content_type = @api_client.select_header_content_type(['application/json'])
128
+ unless content_type.nil?
129
+ header_params['Content-Type'] = content_type
130
+ end
131
+
132
+ # form parameters
133
+ form_params = opts[:form_params] || {}
134
+
135
+ # http body (model)
136
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
137
+
138
+ # return_type
139
+ return_type = opts[:debug_return_type] || 'User'
140
+
141
+ # auth_names
142
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
143
+
144
+ new_options = opts.merge(
145
+ operation: :'UserApi.create_user',
146
+ header_params: header_params,
147
+ query_params: query_params,
148
+ form_params: form_params,
149
+ body: post_body,
150
+ auth_names: auth_names,
151
+ return_type: return_type
152
+ )
153
+
154
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
155
+ if @api_client.config.debugging
156
+ @api_client.config.logger.debug "API called: UserApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
157
+ end
158
+ [data, status_code, headers]
159
+ end
160
+
161
+ # Delete a specific user
162
+ # @param user_id [String] A user identifier or slug
163
+ # @param [Hash] opts the optional parameters
164
+ # @return [Notification]
165
+ def delete_user(user_id, opts = {})
166
+ data, _status_code, _headers = delete_user_with_http_info(user_id, opts)
167
+ data
168
+ end
169
+
170
+ # Delete a specific user
171
+ # @param user_id [String] A user identifier or slug
172
+ # @param [Hash] opts the optional parameters
173
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
174
+ def delete_user_with_http_info(user_id, opts = {})
175
+ if @api_client.config.debugging
176
+ @api_client.config.logger.debug 'Calling API: UserApi.delete_user ...'
177
+ end
178
+ # verify the required parameter 'user_id' is set
179
+ if @api_client.config.client_side_validation && user_id.nil?
180
+ raise ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.delete_user"
181
+ end
182
+
183
+ # resource path
184
+ local_var_path = '/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
185
+
186
+ # query parameters
187
+ query_params = opts[:query_params] || {}
188
+
189
+ # header parameters
190
+ header_params = opts[:header_params] || {}
191
+ # HTTP header 'Accept' (if needed)
192
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
193
+
194
+ # form parameters
195
+ form_params = opts[:form_params] || {}
196
+
197
+ # http body (model)
198
+ post_body = opts[:debug_body]
199
+
200
+ # return_type
201
+ return_type = opts[:debug_return_type] || 'Notification'
202
+
203
+ # auth_names
204
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
205
+
206
+ new_options = opts.merge(
207
+ operation: :'UserApi.delete_user',
208
+ header_params: header_params,
209
+ query_params: query_params,
210
+ form_params: form_params,
211
+ body: post_body,
212
+ auth_names: auth_names,
213
+ return_type: return_type
214
+ )
215
+
216
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
217
+ if @api_client.config.debugging
218
+ @api_client.config.logger.debug "API called: UserApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
219
+ end
220
+ [data, status_code, headers]
221
+ end
222
+
223
+ # Remove a team from user
224
+ # @param user_id [String] A user identifier or slug
225
+ # @param user_team_params [UserTeamParams] The user team data to delete
226
+ # @param [Hash] opts the optional parameters
227
+ # @return [Notification]
228
+ def delete_user_from_team(user_id, user_team_params, opts = {})
229
+ data, _status_code, _headers = delete_user_from_team_with_http_info(user_id, user_team_params, opts)
230
+ data
231
+ end
232
+
233
+ # Remove a team from user
234
+ # @param user_id [String] A user identifier or slug
235
+ # @param user_team_params [UserTeamParams] The user team data to delete
236
+ # @param [Hash] opts the optional parameters
237
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
238
+ def delete_user_from_team_with_http_info(user_id, user_team_params, opts = {})
239
+ if @api_client.config.debugging
240
+ @api_client.config.logger.debug 'Calling API: UserApi.delete_user_from_team ...'
241
+ end
242
+ # verify the required parameter 'user_id' is set
243
+ if @api_client.config.client_side_validation && user_id.nil?
244
+ raise ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.delete_user_from_team"
245
+ end
246
+ # verify the required parameter 'user_team_params' is set
247
+ if @api_client.config.client_side_validation && user_team_params.nil?
248
+ raise ArgumentError, "Missing the required parameter 'user_team_params' when calling UserApi.delete_user_from_team"
249
+ end
250
+
251
+ # resource path
252
+ local_var_path = '/users/{user_id}/teams'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
253
+
254
+ # query parameters
255
+ query_params = opts[:query_params] || {}
256
+
257
+ # header parameters
258
+ header_params = opts[:header_params] || {}
259
+ # HTTP header 'Accept' (if needed)
260
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
261
+ # HTTP header 'Content-Type'
262
+ content_type = @api_client.select_header_content_type(['application/json'])
263
+ unless content_type.nil?
264
+ header_params['Content-Type'] = content_type
265
+ end
266
+
267
+ # form parameters
268
+ form_params = opts[:form_params] || {}
269
+
270
+ # http body (model)
271
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_team_params)
272
+
273
+ # return_type
274
+ return_type = opts[:debug_return_type] || 'Notification'
275
+
276
+ # auth_names
277
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
278
+
279
+ new_options = opts.merge(
280
+ operation: :'UserApi.delete_user_from_team',
281
+ header_params: header_params,
282
+ query_params: query_params,
283
+ form_params: form_params,
284
+ body: post_body,
285
+ auth_names: auth_names,
286
+ return_type: return_type
287
+ )
288
+
289
+ data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
290
+ if @api_client.config.debugging
291
+ @api_client.config.logger.debug "API called: UserApi#delete_user_from_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
292
+ end
293
+ [data, status_code, headers]
294
+ end
295
+
296
+ # Fetch all teams assigned to user
297
+ # @param user_id [String] A user identifier or slug
298
+ # @param [Hash] opts the optional parameters
299
+ # @option opts [String] :search Search query
300
+ # @option opts [String] :sort Sorting column
301
+ # @option opts [String] :order Sorting order
302
+ # @option opts [Integer] :limit Paging limit
303
+ # @option opts [Integer] :offset Paging offset
304
+ # @return [UserTeams]
305
+ def list_user_teams(user_id, opts = {})
306
+ data, _status_code, _headers = list_user_teams_with_http_info(user_id, opts)
307
+ data
308
+ end
309
+
310
+ # Fetch all teams assigned to user
311
+ # @param user_id [String] A user identifier or slug
312
+ # @param [Hash] opts the optional parameters
313
+ # @option opts [String] :search Search query
314
+ # @option opts [String] :sort Sorting column
315
+ # @option opts [String] :order Sorting order
316
+ # @option opts [Integer] :limit Paging limit
317
+ # @option opts [Integer] :offset Paging offset
318
+ # @return [Array<(UserTeams, Integer, Hash)>] UserTeams data, response status code and response headers
319
+ def list_user_teams_with_http_info(user_id, opts = {})
320
+ if @api_client.config.debugging
321
+ @api_client.config.logger.debug 'Calling API: UserApi.list_user_teams ...'
322
+ end
323
+ # verify the required parameter 'user_id' is set
324
+ if @api_client.config.client_side_validation && user_id.nil?
325
+ raise ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.list_user_teams"
326
+ end
327
+
328
+ allowable_values = %w[slug name]
329
+ if @api_client.config.client_side_validation && opts[:sort] && !allowable_values.include?(opts[:sort])
330
+ raise ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
331
+ end
332
+
333
+ allowable_values = %w[asc desc]
334
+ if @api_client.config.client_side_validation && opts[:order] && !allowable_values.include?(opts[:order])
335
+ raise ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
336
+ end
337
+
338
+ # resource path
339
+ local_var_path = '/users/{user_id}/teams'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
340
+
341
+ # query parameters
342
+ query_params = opts[:query_params] || {}
343
+ query_params[:search] = opts[:search] unless opts[:search].nil?
344
+ query_params[:sort] = opts[:sort] unless opts[:sort].nil?
345
+ query_params[:order] = opts[:order] unless opts[:order].nil?
346
+ query_params[:limit] = opts[:limit] unless opts[:limit].nil?
347
+ query_params[:offset] = opts[:offset] unless opts[:offset].nil?
348
+
349
+ # header parameters
350
+ header_params = opts[:header_params] || {}
351
+ # HTTP header 'Accept' (if needed)
352
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
353
+
354
+ # form parameters
355
+ form_params = opts[:form_params] || {}
356
+
357
+ # http body (model)
358
+ post_body = opts[:debug_body]
359
+
360
+ # return_type
361
+ return_type = opts[:debug_return_type] || 'UserTeams'
362
+
363
+ # auth_names
364
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
365
+
366
+ new_options = opts.merge(
367
+ operation: :'UserApi.list_user_teams',
368
+ header_params: header_params,
369
+ query_params: query_params,
370
+ form_params: form_params,
371
+ body: post_body,
372
+ auth_names: auth_names,
373
+ return_type: return_type
374
+ )
375
+
376
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
377
+ if @api_client.config.debugging
378
+ @api_client.config.logger.debug "API called: UserApi#list_user_teams\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
379
+ end
380
+ [data, status_code, headers]
381
+ end
382
+
383
+ # Fetch all available users
384
+ # @param [Hash] opts the optional parameters
385
+ # @option opts [String] :search Search query
386
+ # @option opts [String] :sort Sorting column
387
+ # @option opts [String] :order Sorting order
388
+ # @option opts [Integer] :limit Paging limit
389
+ # @option opts [Integer] :offset Paging offset
390
+ # @return [Users]
391
+ def list_users(opts = {})
392
+ data, _status_code, _headers = list_users_with_http_info(opts)
393
+ data
394
+ end
395
+
396
+ # Fetch all available users
397
+ # @param [Hash] opts the optional parameters
398
+ # @option opts [String] :search Search query
399
+ # @option opts [String] :sort Sorting column
400
+ # @option opts [String] :order Sorting order
401
+ # @option opts [Integer] :limit Paging limit
402
+ # @option opts [Integer] :offset Paging offset
403
+ # @return [Array<(Users, Integer, Hash)>] Users data, response status code and response headers
404
+ def list_users_with_http_info(opts = {})
405
+ if @api_client.config.debugging
406
+ @api_client.config.logger.debug 'Calling API: UserApi.list_users ...'
407
+ end
408
+ allowable_values = %w[username email fullname admin active]
409
+ if @api_client.config.client_side_validation && opts[:sort] && !allowable_values.include?(opts[:sort])
410
+ raise ArgumentError, "invalid value for \"sort\", must be one of #{allowable_values}"
411
+ end
412
+
413
+ allowable_values = %w[asc desc]
414
+ if @api_client.config.client_side_validation && opts[:order] && !allowable_values.include?(opts[:order])
415
+ raise ArgumentError, "invalid value for \"order\", must be one of #{allowable_values}"
416
+ end
417
+
418
+ # resource path
419
+ local_var_path = '/users'
420
+
421
+ # query parameters
422
+ query_params = opts[:query_params] || {}
423
+ query_params[:search] = opts[:search] unless opts[:search].nil?
424
+ query_params[:sort] = opts[:sort] unless opts[:sort].nil?
425
+ query_params[:order] = opts[:order] unless opts[:order].nil?
426
+ query_params[:limit] = opts[:limit] unless opts[:limit].nil?
427
+ query_params[:offset] = opts[:offset] unless opts[:offset].nil?
428
+
429
+ # header parameters
430
+ header_params = opts[:header_params] || {}
431
+ # HTTP header 'Accept' (if needed)
432
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
433
+
434
+ # form parameters
435
+ form_params = opts[:form_params] || {}
436
+
437
+ # http body (model)
438
+ post_body = opts[:debug_body]
439
+
440
+ # return_type
441
+ return_type = opts[:debug_return_type] || 'Users'
442
+
443
+ # auth_names
444
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
445
+
446
+ new_options = opts.merge(
447
+ operation: :'UserApi.list_users',
448
+ header_params: header_params,
449
+ query_params: query_params,
450
+ form_params: form_params,
451
+ body: post_body,
452
+ auth_names: auth_names,
453
+ return_type: return_type
454
+ )
455
+
456
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
457
+ if @api_client.config.debugging
458
+ @api_client.config.logger.debug "API called: UserApi#list_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
459
+ end
460
+ [data, status_code, headers]
461
+ end
462
+
463
+ # Update team perms for user
464
+ # @param user_id [String] A user identifier or slug
465
+ # @param user_team_params [UserTeamParams] The user team data to update
466
+ # @param [Hash] opts the optional parameters
467
+ # @return [Notification]
468
+ def permit_user_team(user_id, user_team_params, opts = {})
469
+ data, _status_code, _headers = permit_user_team_with_http_info(user_id, user_team_params, opts)
470
+ data
471
+ end
472
+
473
+ # Update team perms for user
474
+ # @param user_id [String] A user identifier or slug
475
+ # @param user_team_params [UserTeamParams] The user team data to update
476
+ # @param [Hash] opts the optional parameters
477
+ # @return [Array<(Notification, Integer, Hash)>] Notification data, response status code and response headers
478
+ def permit_user_team_with_http_info(user_id, user_team_params, opts = {})
479
+ if @api_client.config.debugging
480
+ @api_client.config.logger.debug 'Calling API: UserApi.permit_user_team ...'
481
+ end
482
+ # verify the required parameter 'user_id' is set
483
+ if @api_client.config.client_side_validation && user_id.nil?
484
+ raise ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.permit_user_team"
485
+ end
486
+ # verify the required parameter 'user_team_params' is set
487
+ if @api_client.config.client_side_validation && user_team_params.nil?
488
+ raise ArgumentError, "Missing the required parameter 'user_team_params' when calling UserApi.permit_user_team"
489
+ end
490
+
491
+ # resource path
492
+ local_var_path = '/users/{user_id}/teams'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
493
+
494
+ # query parameters
495
+ query_params = opts[:query_params] || {}
496
+
497
+ # header parameters
498
+ header_params = opts[:header_params] || {}
499
+ # HTTP header 'Accept' (if needed)
500
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
501
+ # HTTP header 'Content-Type'
502
+ content_type = @api_client.select_header_content_type(['application/json'])
503
+ unless content_type.nil?
504
+ header_params['Content-Type'] = content_type
505
+ end
506
+
507
+ # form parameters
508
+ form_params = opts[:form_params] || {}
509
+
510
+ # http body (model)
511
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user_team_params)
512
+
513
+ # return_type
514
+ return_type = opts[:debug_return_type] || 'Notification'
515
+
516
+ # auth_names
517
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
518
+
519
+ new_options = opts.merge(
520
+ operation: :'UserApi.permit_user_team',
521
+ header_params: header_params,
522
+ query_params: query_params,
523
+ form_params: form_params,
524
+ body: post_body,
525
+ auth_names: auth_names,
526
+ return_type: return_type
527
+ )
528
+
529
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
530
+ if @api_client.config.debugging
531
+ @api_client.config.logger.debug "API called: UserApi#permit_user_team\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
532
+ end
533
+ [data, status_code, headers]
534
+ end
535
+
536
+ # Fetch a specific user
537
+ # @param user_id [String] A user identifier or slug
538
+ # @param [Hash] opts the optional parameters
539
+ # @return [User]
540
+ def show_user(user_id, opts = {})
541
+ data, _status_code, _headers = show_user_with_http_info(user_id, opts)
542
+ data
543
+ end
544
+
545
+ # Fetch a specific user
546
+ # @param user_id [String] A user identifier or slug
547
+ # @param [Hash] opts the optional parameters
548
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
549
+ def show_user_with_http_info(user_id, opts = {})
550
+ if @api_client.config.debugging
551
+ @api_client.config.logger.debug 'Calling API: UserApi.show_user ...'
552
+ end
553
+ # verify the required parameter 'user_id' is set
554
+ if @api_client.config.client_side_validation && user_id.nil?
555
+ raise ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.show_user"
556
+ end
557
+
558
+ # resource path
559
+ local_var_path = '/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
560
+
561
+ # query parameters
562
+ query_params = opts[:query_params] || {}
563
+
564
+ # header parameters
565
+ header_params = opts[:header_params] || {}
566
+ # HTTP header 'Accept' (if needed)
567
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
568
+
569
+ # form parameters
570
+ form_params = opts[:form_params] || {}
571
+
572
+ # http body (model)
573
+ post_body = opts[:debug_body]
574
+
575
+ # return_type
576
+ return_type = opts[:debug_return_type] || 'User'
577
+
578
+ # auth_names
579
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
580
+
581
+ new_options = opts.merge(
582
+ operation: :'UserApi.show_user',
583
+ header_params: header_params,
584
+ query_params: query_params,
585
+ form_params: form_params,
586
+ body: post_body,
587
+ auth_names: auth_names,
588
+ return_type: return_type
589
+ )
590
+
591
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
592
+ if @api_client.config.debugging
593
+ @api_client.config.logger.debug "API called: UserApi#show_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
594
+ end
595
+ [data, status_code, headers]
596
+ end
597
+
598
+ # Update a specific user
599
+ # @param user_id [String] A user identifier or slug
600
+ # @param user [User] The user data to update
601
+ # @param [Hash] opts the optional parameters
602
+ # @return [User]
603
+ def update_user(user_id, user, opts = {})
604
+ data, _status_code, _headers = update_user_with_http_info(user_id, user, opts)
605
+ data
606
+ end
607
+
608
+ # Update a specific user
609
+ # @param user_id [String] A user identifier or slug
610
+ # @param user [User] The user data to update
611
+ # @param [Hash] opts the optional parameters
612
+ # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
613
+ def update_user_with_http_info(user_id, user, opts = {})
614
+ if @api_client.config.debugging
615
+ @api_client.config.logger.debug 'Calling API: UserApi.update_user ...'
616
+ end
617
+ # verify the required parameter 'user_id' is set
618
+ if @api_client.config.client_side_validation && user_id.nil?
619
+ raise ArgumentError, "Missing the required parameter 'user_id' when calling UserApi.update_user"
620
+ end
621
+ # verify the required parameter 'user' is set
622
+ if @api_client.config.client_side_validation && user.nil?
623
+ raise ArgumentError, "Missing the required parameter 'user' when calling UserApi.update_user"
624
+ end
625
+
626
+ # resource path
627
+ local_var_path = '/users/{user_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
628
+
629
+ # query parameters
630
+ query_params = opts[:query_params] || {}
631
+
632
+ # header parameters
633
+ header_params = opts[:header_params] || {}
634
+ # HTTP header 'Accept' (if needed)
635
+ header_params['Accept'] = @api_client.select_header_accept(['application/json'])
636
+ # HTTP header 'Content-Type'
637
+ content_type = @api_client.select_header_content_type(['application/json'])
638
+ unless content_type.nil?
639
+ header_params['Content-Type'] = content_type
640
+ end
641
+
642
+ # form parameters
643
+ form_params = opts[:form_params] || {}
644
+
645
+ # http body (model)
646
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(user)
647
+
648
+ # return_type
649
+ return_type = opts[:debug_return_type] || 'User'
650
+
651
+ # auth_names
652
+ auth_names = opts[:debug_auth_names] || %w[Cookie Basic Header]
653
+
654
+ new_options = opts.merge(
655
+ operation: :'UserApi.update_user',
656
+ header_params: header_params,
657
+ query_params: query_params,
658
+ form_params: form_params,
659
+ body: post_body,
660
+ auth_names: auth_names,
661
+ return_type: return_type
662
+ )
663
+
664
+ data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
665
+ if @api_client.config.debugging
666
+ @api_client.config.logger.debug "API called: UserApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
667
+ end
668
+ [data, status_code, headers]
669
+ end
670
+ end
671
+ end