yalla_auth_ruby_client 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.
- checksums.yaml +7 -0
- data/Gemfile +9 -0
- data/README.md +111 -0
- data/Rakefile +10 -0
- data/docs/App.md +32 -0
- data/docs/AppsApi.md +399 -0
- data/docs/AuthApi.md +70 -0
- data/docs/AuthValidateTokenGet200Response.md +20 -0
- data/docs/Role.md +34 -0
- data/docs/User.md +30 -0
- data/docs/UserAppAdd.md +18 -0
- data/docs/UserRoleAdd.md +24 -0
- data/docs/UsersApi.md +531 -0
- data/git_push.sh +57 -0
- data/lib/openapi_client/api/apps_api.rb +439 -0
- data/lib/openapi_client/api/auth_api.rb +84 -0
- data/lib/openapi_client/api/users_api.rb +587 -0
- data/lib/openapi_client/api_client.rb +392 -0
- data/lib/openapi_client/api_error.rb +58 -0
- data/lib/openapi_client/configuration.rb +311 -0
- data/lib/openapi_client/models/app.rb +283 -0
- data/lib/openapi_client/models/auth_validate_token_get200_response.rb +229 -0
- data/lib/openapi_client/models/role.rb +292 -0
- data/lib/openapi_client/models/user.rb +274 -0
- data/lib/openapi_client/models/user_app_add.rb +220 -0
- data/lib/openapi_client/models/user_role_add.rb +247 -0
- data/lib/openapi_client/version.rb +15 -0
- data/lib/openapi_client.rb +48 -0
- data/spec/api/apps_api_spec.rb +108 -0
- data/spec/api/auth_api_spec.rb +46 -0
- data/spec/api/users_api_spec.rb +134 -0
- data/spec/models/app_spec.rb +78 -0
- data/spec/models/auth_validate_token_get200_response_spec.rb +42 -0
- data/spec/models/role_spec.rb +84 -0
- data/spec/models/user_app_add_spec.rb +36 -0
- data/spec/models/user_role_add_spec.rb +54 -0
- data/spec/models/user_spec.rb +72 -0
- data/spec/spec_helper.rb +111 -0
- data/yalla_auth_ruby_client.gemspec +39 -0
- metadata +128 -0
@@ -0,0 +1,587 @@
|
|
1
|
+
=begin
|
2
|
+
#API V1
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: v1
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.12.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module OpenapiClient
|
16
|
+
class UsersApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# add role to user
|
23
|
+
# @param user_id [String] id
|
24
|
+
# @param access_token [String]
|
25
|
+
# @param [Hash] opts the optional parameters
|
26
|
+
# @option opts [UserRoleAdd] :user_role_add
|
27
|
+
# @return [nil]
|
28
|
+
def add_role_to_user(user_id, access_token, opts = {})
|
29
|
+
add_role_to_user_with_http_info(user_id, access_token, opts)
|
30
|
+
nil
|
31
|
+
end
|
32
|
+
|
33
|
+
# add role to user
|
34
|
+
# @param user_id [String] id
|
35
|
+
# @param access_token [String]
|
36
|
+
# @param [Hash] opts the optional parameters
|
37
|
+
# @option opts [UserRoleAdd] :user_role_add
|
38
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
39
|
+
def add_role_to_user_with_http_info(user_id, access_token, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.add_role_to_user ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'user_id' is set
|
44
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.add_role_to_user"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'access_token' is set
|
48
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.add_role_to_user"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/api/v1/users/{user_id}/roles'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
|
57
|
+
# header parameters
|
58
|
+
header_params = opts[:header_params] || {}
|
59
|
+
# HTTP header 'Accept' (if needed)
|
60
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
61
|
+
# HTTP header 'Content-Type'
|
62
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
63
|
+
if !content_type.nil?
|
64
|
+
header_params['Content-Type'] = content_type
|
65
|
+
end
|
66
|
+
header_params[:'access-token'] = access_token
|
67
|
+
|
68
|
+
# form parameters
|
69
|
+
form_params = opts[:form_params] || {}
|
70
|
+
|
71
|
+
# http body (model)
|
72
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'user_role_add'])
|
73
|
+
|
74
|
+
# return_type
|
75
|
+
return_type = opts[:debug_return_type]
|
76
|
+
|
77
|
+
# auth_names
|
78
|
+
auth_names = opts[:debug_auth_names] || []
|
79
|
+
|
80
|
+
new_options = opts.merge(
|
81
|
+
:operation => :"UsersApi.add_role_to_user",
|
82
|
+
:header_params => header_params,
|
83
|
+
:query_params => query_params,
|
84
|
+
:form_params => form_params,
|
85
|
+
:body => post_body,
|
86
|
+
:auth_names => auth_names,
|
87
|
+
:return_type => return_type
|
88
|
+
)
|
89
|
+
|
90
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
91
|
+
if @api_client.config.debugging
|
92
|
+
@api_client.config.logger.debug "API called: UsersApi#add_role_to_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
93
|
+
end
|
94
|
+
return data, status_code, headers
|
95
|
+
end
|
96
|
+
|
97
|
+
# delete role
|
98
|
+
# @param access_token [String]
|
99
|
+
# @param user_id [String] id
|
100
|
+
# @param role_id [String] id
|
101
|
+
# @param [Hash] opts the optional parameters
|
102
|
+
# @return [nil]
|
103
|
+
def delete_role_from_user(access_token, user_id, role_id, opts = {})
|
104
|
+
delete_role_from_user_with_http_info(access_token, user_id, role_id, opts)
|
105
|
+
nil
|
106
|
+
end
|
107
|
+
|
108
|
+
# delete role
|
109
|
+
# @param access_token [String]
|
110
|
+
# @param user_id [String] id
|
111
|
+
# @param role_id [String] id
|
112
|
+
# @param [Hash] opts the optional parameters
|
113
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
114
|
+
def delete_role_from_user_with_http_info(access_token, user_id, role_id, opts = {})
|
115
|
+
if @api_client.config.debugging
|
116
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.delete_role_from_user ...'
|
117
|
+
end
|
118
|
+
# verify the required parameter 'access_token' is set
|
119
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
120
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.delete_role_from_user"
|
121
|
+
end
|
122
|
+
# verify the required parameter 'user_id' is set
|
123
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
124
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_role_from_user"
|
125
|
+
end
|
126
|
+
# verify the required parameter 'role_id' is set
|
127
|
+
if @api_client.config.client_side_validation && role_id.nil?
|
128
|
+
fail ArgumentError, "Missing the required parameter 'role_id' when calling UsersApi.delete_role_from_user"
|
129
|
+
end
|
130
|
+
# resource path
|
131
|
+
local_var_path = '/api/v1/users/{user_id}/roles/{role_id}'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s)).sub('{' + 'role_id' + '}', CGI.escape(role_id.to_s))
|
132
|
+
|
133
|
+
# query parameters
|
134
|
+
query_params = opts[:query_params] || {}
|
135
|
+
|
136
|
+
# header parameters
|
137
|
+
header_params = opts[:header_params] || {}
|
138
|
+
# HTTP header 'Accept' (if needed)
|
139
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
140
|
+
header_params[:'access-token'] = access_token
|
141
|
+
|
142
|
+
# form parameters
|
143
|
+
form_params = opts[:form_params] || {}
|
144
|
+
|
145
|
+
# http body (model)
|
146
|
+
post_body = opts[:debug_body]
|
147
|
+
|
148
|
+
# return_type
|
149
|
+
return_type = opts[:debug_return_type]
|
150
|
+
|
151
|
+
# auth_names
|
152
|
+
auth_names = opts[:debug_auth_names] || []
|
153
|
+
|
154
|
+
new_options = opts.merge(
|
155
|
+
:operation => :"UsersApi.delete_role_from_user",
|
156
|
+
:header_params => header_params,
|
157
|
+
:query_params => query_params,
|
158
|
+
:form_params => form_params,
|
159
|
+
:body => post_body,
|
160
|
+
:auth_names => auth_names,
|
161
|
+
:return_type => return_type
|
162
|
+
)
|
163
|
+
|
164
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
165
|
+
if @api_client.config.debugging
|
166
|
+
@api_client.config.logger.debug "API called: UsersApi#delete_role_from_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
167
|
+
end
|
168
|
+
return data, status_code, headers
|
169
|
+
end
|
170
|
+
|
171
|
+
# delete user
|
172
|
+
# @param id [String] id
|
173
|
+
# @param access_token [String]
|
174
|
+
# @param [Hash] opts the optional parameters
|
175
|
+
# @return [nil]
|
176
|
+
def delete_user(id, access_token, opts = {})
|
177
|
+
delete_user_with_http_info(id, access_token, opts)
|
178
|
+
nil
|
179
|
+
end
|
180
|
+
|
181
|
+
# delete user
|
182
|
+
# @param id [String] id
|
183
|
+
# @param access_token [String]
|
184
|
+
# @param [Hash] opts the optional parameters
|
185
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
186
|
+
def delete_user_with_http_info(id, access_token, opts = {})
|
187
|
+
if @api_client.config.debugging
|
188
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...'
|
189
|
+
end
|
190
|
+
# verify the required parameter 'id' is set
|
191
|
+
if @api_client.config.client_side_validation && id.nil?
|
192
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.delete_user"
|
193
|
+
end
|
194
|
+
# verify the required parameter 'access_token' is set
|
195
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
196
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.delete_user"
|
197
|
+
end
|
198
|
+
# resource path
|
199
|
+
local_var_path = '/api/v1/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
200
|
+
|
201
|
+
# query parameters
|
202
|
+
query_params = opts[:query_params] || {}
|
203
|
+
|
204
|
+
# header parameters
|
205
|
+
header_params = opts[:header_params] || {}
|
206
|
+
# HTTP header 'Accept' (if needed)
|
207
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
208
|
+
header_params[:'access-token'] = access_token
|
209
|
+
|
210
|
+
# form parameters
|
211
|
+
form_params = opts[:form_params] || {}
|
212
|
+
|
213
|
+
# http body (model)
|
214
|
+
post_body = opts[:debug_body]
|
215
|
+
|
216
|
+
# return_type
|
217
|
+
return_type = opts[:debug_return_type]
|
218
|
+
|
219
|
+
# auth_names
|
220
|
+
auth_names = opts[:debug_auth_names] || []
|
221
|
+
|
222
|
+
new_options = opts.merge(
|
223
|
+
:operation => :"UsersApi.delete_user",
|
224
|
+
:header_params => header_params,
|
225
|
+
:query_params => query_params,
|
226
|
+
:form_params => form_params,
|
227
|
+
:body => post_body,
|
228
|
+
:auth_names => auth_names,
|
229
|
+
:return_type => return_type
|
230
|
+
)
|
231
|
+
|
232
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
233
|
+
if @api_client.config.debugging
|
234
|
+
@api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
235
|
+
end
|
236
|
+
return data, status_code, headers
|
237
|
+
end
|
238
|
+
|
239
|
+
# show user
|
240
|
+
# @param access_token [String]
|
241
|
+
# @param id [String] id
|
242
|
+
# @param [Hash] opts the optional parameters
|
243
|
+
# @return [nil]
|
244
|
+
def get_user(access_token, id, opts = {})
|
245
|
+
get_user_with_http_info(access_token, id, opts)
|
246
|
+
nil
|
247
|
+
end
|
248
|
+
|
249
|
+
# show user
|
250
|
+
# @param access_token [String]
|
251
|
+
# @param id [String] id
|
252
|
+
# @param [Hash] opts the optional parameters
|
253
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
254
|
+
def get_user_with_http_info(access_token, id, opts = {})
|
255
|
+
if @api_client.config.debugging
|
256
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.get_user ...'
|
257
|
+
end
|
258
|
+
# verify the required parameter 'access_token' is set
|
259
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
260
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.get_user"
|
261
|
+
end
|
262
|
+
# verify the required parameter 'id' is set
|
263
|
+
if @api_client.config.client_side_validation && id.nil?
|
264
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.get_user"
|
265
|
+
end
|
266
|
+
# resource path
|
267
|
+
local_var_path = '/api/v1/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
268
|
+
|
269
|
+
# query parameters
|
270
|
+
query_params = opts[:query_params] || {}
|
271
|
+
|
272
|
+
# header parameters
|
273
|
+
header_params = opts[:header_params] || {}
|
274
|
+
# HTTP header 'Accept' (if needed)
|
275
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
276
|
+
header_params[:'access-token'] = access_token
|
277
|
+
|
278
|
+
# form parameters
|
279
|
+
form_params = opts[:form_params] || {}
|
280
|
+
|
281
|
+
# http body (model)
|
282
|
+
post_body = opts[:debug_body]
|
283
|
+
|
284
|
+
# return_type
|
285
|
+
return_type = opts[:debug_return_type]
|
286
|
+
|
287
|
+
# auth_names
|
288
|
+
auth_names = opts[:debug_auth_names] || []
|
289
|
+
|
290
|
+
new_options = opts.merge(
|
291
|
+
:operation => :"UsersApi.get_user",
|
292
|
+
:header_params => header_params,
|
293
|
+
:query_params => query_params,
|
294
|
+
:form_params => form_params,
|
295
|
+
:body => post_body,
|
296
|
+
:auth_names => auth_names,
|
297
|
+
:return_type => return_type
|
298
|
+
)
|
299
|
+
|
300
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
301
|
+
if @api_client.config.debugging
|
302
|
+
@api_client.config.logger.debug "API called: UsersApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
303
|
+
end
|
304
|
+
return data, status_code, headers
|
305
|
+
end
|
306
|
+
|
307
|
+
# list roles of a user
|
308
|
+
# @param access_token [String]
|
309
|
+
# @param user_id [String] id
|
310
|
+
# @param [Hash] opts the optional parameters
|
311
|
+
# @return [nil]
|
312
|
+
def get_user_roles(access_token, user_id, opts = {})
|
313
|
+
get_user_roles_with_http_info(access_token, user_id, opts)
|
314
|
+
nil
|
315
|
+
end
|
316
|
+
|
317
|
+
# list roles of a user
|
318
|
+
# @param access_token [String]
|
319
|
+
# @param user_id [String] id
|
320
|
+
# @param [Hash] opts the optional parameters
|
321
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
322
|
+
def get_user_roles_with_http_info(access_token, user_id, opts = {})
|
323
|
+
if @api_client.config.debugging
|
324
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.get_user_roles ...'
|
325
|
+
end
|
326
|
+
# verify the required parameter 'access_token' is set
|
327
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
328
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.get_user_roles"
|
329
|
+
end
|
330
|
+
# verify the required parameter 'user_id' is set
|
331
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
332
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user_roles"
|
333
|
+
end
|
334
|
+
# resource path
|
335
|
+
local_var_path = '/api/v1/users/{user_id}/roles'.sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
336
|
+
|
337
|
+
# query parameters
|
338
|
+
query_params = opts[:query_params] || {}
|
339
|
+
|
340
|
+
# header parameters
|
341
|
+
header_params = opts[:header_params] || {}
|
342
|
+
# HTTP header 'Accept' (if needed)
|
343
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
344
|
+
header_params[:'access-token'] = access_token
|
345
|
+
|
346
|
+
# form parameters
|
347
|
+
form_params = opts[:form_params] || {}
|
348
|
+
|
349
|
+
# http body (model)
|
350
|
+
post_body = opts[:debug_body]
|
351
|
+
|
352
|
+
# return_type
|
353
|
+
return_type = opts[:debug_return_type]
|
354
|
+
|
355
|
+
# auth_names
|
356
|
+
auth_names = opts[:debug_auth_names] || []
|
357
|
+
|
358
|
+
new_options = opts.merge(
|
359
|
+
:operation => :"UsersApi.get_user_roles",
|
360
|
+
:header_params => header_params,
|
361
|
+
:query_params => query_params,
|
362
|
+
:form_params => form_params,
|
363
|
+
:body => post_body,
|
364
|
+
:auth_names => auth_names,
|
365
|
+
:return_type => return_type
|
366
|
+
)
|
367
|
+
|
368
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
369
|
+
if @api_client.config.debugging
|
370
|
+
@api_client.config.logger.debug "API called: UsersApi#get_user_roles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
371
|
+
end
|
372
|
+
return data, status_code, headers
|
373
|
+
end
|
374
|
+
|
375
|
+
# list users
|
376
|
+
# @param access_token [String]
|
377
|
+
# @param [Hash] opts the optional parameters
|
378
|
+
# @return [nil]
|
379
|
+
def get_users(access_token, opts = {})
|
380
|
+
get_users_with_http_info(access_token, opts)
|
381
|
+
nil
|
382
|
+
end
|
383
|
+
|
384
|
+
# list users
|
385
|
+
# @param access_token [String]
|
386
|
+
# @param [Hash] opts the optional parameters
|
387
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
388
|
+
def get_users_with_http_info(access_token, opts = {})
|
389
|
+
if @api_client.config.debugging
|
390
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.get_users ...'
|
391
|
+
end
|
392
|
+
# verify the required parameter 'access_token' is set
|
393
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
394
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.get_users"
|
395
|
+
end
|
396
|
+
# resource path
|
397
|
+
local_var_path = '/api/v1/users'
|
398
|
+
|
399
|
+
# query parameters
|
400
|
+
query_params = opts[:query_params] || {}
|
401
|
+
|
402
|
+
# header parameters
|
403
|
+
header_params = opts[:header_params] || {}
|
404
|
+
# HTTP header 'Accept' (if needed)
|
405
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
406
|
+
header_params[:'access-token'] = access_token
|
407
|
+
|
408
|
+
# form parameters
|
409
|
+
form_params = opts[:form_params] || {}
|
410
|
+
|
411
|
+
# http body (model)
|
412
|
+
post_body = opts[:debug_body]
|
413
|
+
|
414
|
+
# return_type
|
415
|
+
return_type = opts[:debug_return_type]
|
416
|
+
|
417
|
+
# auth_names
|
418
|
+
auth_names = opts[:debug_auth_names] || []
|
419
|
+
|
420
|
+
new_options = opts.merge(
|
421
|
+
:operation => :"UsersApi.get_users",
|
422
|
+
:header_params => header_params,
|
423
|
+
:query_params => query_params,
|
424
|
+
:form_params => form_params,
|
425
|
+
:body => post_body,
|
426
|
+
:auth_names => auth_names,
|
427
|
+
:return_type => return_type
|
428
|
+
)
|
429
|
+
|
430
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
431
|
+
if @api_client.config.debugging
|
432
|
+
@api_client.config.logger.debug "API called: UsersApi#get_users\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
433
|
+
end
|
434
|
+
return data, status_code, headers
|
435
|
+
end
|
436
|
+
|
437
|
+
# update user
|
438
|
+
# @param id [String] id
|
439
|
+
# @param access_token [String]
|
440
|
+
# @param [Hash] opts the optional parameters
|
441
|
+
# @option opts [User] :user
|
442
|
+
# @return [nil]
|
443
|
+
def patch_user(id, access_token, opts = {})
|
444
|
+
patch_user_with_http_info(id, access_token, opts)
|
445
|
+
nil
|
446
|
+
end
|
447
|
+
|
448
|
+
# update user
|
449
|
+
# @param id [String] id
|
450
|
+
# @param access_token [String]
|
451
|
+
# @param [Hash] opts the optional parameters
|
452
|
+
# @option opts [User] :user
|
453
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
454
|
+
def patch_user_with_http_info(id, access_token, opts = {})
|
455
|
+
if @api_client.config.debugging
|
456
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.patch_user ...'
|
457
|
+
end
|
458
|
+
# verify the required parameter 'id' is set
|
459
|
+
if @api_client.config.client_side_validation && id.nil?
|
460
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.patch_user"
|
461
|
+
end
|
462
|
+
# verify the required parameter 'access_token' is set
|
463
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
464
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.patch_user"
|
465
|
+
end
|
466
|
+
# resource path
|
467
|
+
local_var_path = '/api/v1/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
468
|
+
|
469
|
+
# query parameters
|
470
|
+
query_params = opts[:query_params] || {}
|
471
|
+
|
472
|
+
# header parameters
|
473
|
+
header_params = opts[:header_params] || {}
|
474
|
+
# HTTP header 'Accept' (if needed)
|
475
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
476
|
+
# HTTP header 'Content-Type'
|
477
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
478
|
+
if !content_type.nil?
|
479
|
+
header_params['Content-Type'] = content_type
|
480
|
+
end
|
481
|
+
header_params[:'access-token'] = access_token
|
482
|
+
|
483
|
+
# form parameters
|
484
|
+
form_params = opts[:form_params] || {}
|
485
|
+
|
486
|
+
# http body (model)
|
487
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'user'])
|
488
|
+
|
489
|
+
# return_type
|
490
|
+
return_type = opts[:debug_return_type]
|
491
|
+
|
492
|
+
# auth_names
|
493
|
+
auth_names = opts[:debug_auth_names] || []
|
494
|
+
|
495
|
+
new_options = opts.merge(
|
496
|
+
:operation => :"UsersApi.patch_user",
|
497
|
+
:header_params => header_params,
|
498
|
+
:query_params => query_params,
|
499
|
+
:form_params => form_params,
|
500
|
+
:body => post_body,
|
501
|
+
:auth_names => auth_names,
|
502
|
+
:return_type => return_type
|
503
|
+
)
|
504
|
+
|
505
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
506
|
+
if @api_client.config.debugging
|
507
|
+
@api_client.config.logger.debug "API called: UsersApi#patch_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
508
|
+
end
|
509
|
+
return data, status_code, headers
|
510
|
+
end
|
511
|
+
|
512
|
+
# update user
|
513
|
+
# @param id [String] id
|
514
|
+
# @param access_token [String]
|
515
|
+
# @param [Hash] opts the optional parameters
|
516
|
+
# @option opts [User] :user
|
517
|
+
# @return [nil]
|
518
|
+
def update_user(id, access_token, opts = {})
|
519
|
+
update_user_with_http_info(id, access_token, opts)
|
520
|
+
nil
|
521
|
+
end
|
522
|
+
|
523
|
+
# update user
|
524
|
+
# @param id [String] id
|
525
|
+
# @param access_token [String]
|
526
|
+
# @param [Hash] opts the optional parameters
|
527
|
+
# @option opts [User] :user
|
528
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
529
|
+
def update_user_with_http_info(id, access_token, opts = {})
|
530
|
+
if @api_client.config.debugging
|
531
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.update_user ...'
|
532
|
+
end
|
533
|
+
# verify the required parameter 'id' is set
|
534
|
+
if @api_client.config.client_side_validation && id.nil?
|
535
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling UsersApi.update_user"
|
536
|
+
end
|
537
|
+
# verify the required parameter 'access_token' is set
|
538
|
+
if @api_client.config.client_side_validation && access_token.nil?
|
539
|
+
fail ArgumentError, "Missing the required parameter 'access_token' when calling UsersApi.update_user"
|
540
|
+
end
|
541
|
+
# resource path
|
542
|
+
local_var_path = '/api/v1/users/{id}'.sub('{' + 'id' + '}', CGI.escape(id.to_s))
|
543
|
+
|
544
|
+
# query parameters
|
545
|
+
query_params = opts[:query_params] || {}
|
546
|
+
|
547
|
+
# header parameters
|
548
|
+
header_params = opts[:header_params] || {}
|
549
|
+
# HTTP header 'Accept' (if needed)
|
550
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
551
|
+
# HTTP header 'Content-Type'
|
552
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
553
|
+
if !content_type.nil?
|
554
|
+
header_params['Content-Type'] = content_type
|
555
|
+
end
|
556
|
+
header_params[:'access-token'] = access_token
|
557
|
+
|
558
|
+
# form parameters
|
559
|
+
form_params = opts[:form_params] || {}
|
560
|
+
|
561
|
+
# http body (model)
|
562
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'user'])
|
563
|
+
|
564
|
+
# return_type
|
565
|
+
return_type = opts[:debug_return_type]
|
566
|
+
|
567
|
+
# auth_names
|
568
|
+
auth_names = opts[:debug_auth_names] || []
|
569
|
+
|
570
|
+
new_options = opts.merge(
|
571
|
+
:operation => :"UsersApi.update_user",
|
572
|
+
:header_params => header_params,
|
573
|
+
:query_params => query_params,
|
574
|
+
:form_params => form_params,
|
575
|
+
:body => post_body,
|
576
|
+
:auth_names => auth_names,
|
577
|
+
:return_type => return_type
|
578
|
+
)
|
579
|
+
|
580
|
+
data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)
|
581
|
+
if @api_client.config.debugging
|
582
|
+
@api_client.config.logger.debug "API called: UsersApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
583
|
+
end
|
584
|
+
return data, status_code, headers
|
585
|
+
end
|
586
|
+
end
|
587
|
+
end
|