passageidentity 0.2.3 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +21 -0
- data/README.md +18 -61
- data/docs/custom/AuthApi.md +141 -0
- data/docs/custom/ClientApi.md +107 -0
- data/docs/custom/UserApi.md +419 -0
- data/docs/generated/AppInfo.md +94 -0
- data/docs/generated/AppResponse.md +18 -0
- data/docs/generated/AppsApi.md +77 -0
- data/docs/generated/AuthMethods.md +22 -0
- data/docs/generated/CreateMagicLinkRequest.md +36 -0
- data/docs/generated/CreateUserRequest.md +22 -0
- data/docs/generated/ElementCustomization.md +56 -0
- data/docs/generated/FontFamily.md +15 -0
- data/docs/generated/LayoutConfig.md +26 -0
- data/docs/generated/Layouts.md +20 -0
- data/docs/generated/ListDevicesResponse.md +18 -0
- data/docs/generated/MagicLink.md +36 -0
- data/docs/generated/MagicLinkAuthMethod.md +22 -0
- data/docs/generated/MagicLinkChannel.md +15 -0
- data/docs/generated/MagicLinkResponse.md +18 -0
- data/docs/generated/MagicLinkType.md +15 -0
- data/docs/generated/MagicLinksApi.md +79 -0
- data/docs/generated/Model400Error.md +20 -0
- data/docs/generated/Model401Error.md +20 -0
- data/docs/generated/Model404Error.md +20 -0
- data/docs/generated/Model500Error.md +20 -0
- data/docs/generated/OtpAuthMethod.md +22 -0
- data/docs/generated/PasskeysAuthMethod.md +18 -0
- data/docs/generated/Technologies.md +15 -0
- data/docs/generated/TokensApi.md +78 -0
- data/docs/generated/TtlDisplayUnit.md +15 -0
- data/docs/generated/UpdateMagicLinkAuthMethod.md +22 -0
- data/docs/generated/UpdateOtpAuthMethod.md +22 -0
- data/docs/generated/UpdatePasskeysAuthMethod.md +18 -0
- data/docs/generated/UpdateUserRequest.md +22 -0
- data/docs/generated/UserDevicesApi.md +152 -0
- data/docs/generated/UserEventInfo.md +26 -0
- data/docs/generated/UserInfo.md +46 -0
- data/docs/generated/UserMetadataField.md +28 -0
- data/docs/generated/UserMetadataFieldType.md +15 -0
- data/docs/generated/UserResponse.md +18 -0
- data/docs/generated/UserStatus.md +15 -0
- data/docs/generated/UsersApi.md +440 -0
- data/docs/generated/WebAuthnDevices.md +34 -0
- data/docs/generated/WebAuthnIcons.md +20 -0
- data/docs/generated/WebAuthnType.md +15 -0
- data/generate.sh +31 -0
- data/lib/openapi_client/api/apps_api.rb +85 -0
- data/lib/openapi_client/api/magic_links_api.rb +96 -0
- data/lib/openapi_client/api/tokens_api.rb +91 -0
- data/lib/openapi_client/api/user_devices_api.rb +166 -0
- data/lib/openapi_client/api/users_api.rb +452 -0
- data/lib/openapi_client/api_client.rb +431 -0
- data/lib/openapi_client/api_error.rb +58 -0
- data/lib/openapi_client/configuration.rb +383 -0
- data/lib/openapi_client/models/app_info.rb +853 -0
- data/lib/openapi_client/models/app_response.rb +221 -0
- data/lib/openapi_client/models/auth_methods.rb +254 -0
- data/lib/openapi_client/models/create_magic_link_request.rb +374 -0
- data/lib/openapi_client/models/create_user_request.rb +234 -0
- data/lib/openapi_client/models/element_customization.rb +457 -0
- data/lib/openapi_client/models/font_family.rb +58 -0
- data/lib/openapi_client/models/layout_config.rb +285 -0
- data/lib/openapi_client/models/layouts.rb +241 -0
- data/lib/openapi_client/models/list_devices_response.rb +223 -0
- data/lib/openapi_client/models/magic_link.rb +387 -0
- data/lib/openapi_client/models/magic_link_auth_method.rb +302 -0
- data/lib/openapi_client/models/magic_link_channel.rb +40 -0
- data/lib/openapi_client/models/magic_link_response.rb +221 -0
- data/lib/openapi_client/models/magic_link_type.rb +40 -0
- data/lib/openapi_client/models/model400_error.rb +271 -0
- data/lib/openapi_client/models/model401_error.rb +271 -0
- data/lib/openapi_client/models/model404_error.rb +271 -0
- data/lib/openapi_client/models/model500_error.rb +271 -0
- data/lib/openapi_client/models/otp_auth_method.rb +302 -0
- data/lib/openapi_client/models/passkeys_auth_method.rb +228 -0
- data/lib/openapi_client/models/technologies.rb +46 -0
- data/lib/openapi_client/models/ttl_display_unit.rb +42 -0
- data/lib/openapi_client/models/update_magic_link_auth_method.rb +276 -0
- data/lib/openapi_client/models/update_otp_auth_method.rb +276 -0
- data/lib/openapi_client/models/update_passkeys_auth_method.rb +216 -0
- data/lib/openapi_client/models/update_user_request.rb +232 -0
- data/lib/openapi_client/models/user_event_info.rb +285 -0
- data/lib/openapi_client/models/user_info.rb +470 -0
- data/lib/openapi_client/models/user_metadata_field.rb +323 -0
- data/lib/openapi_client/models/user_metadata_field_type.rb +44 -0
- data/lib/openapi_client/models/user_response.rb +221 -0
- data/lib/openapi_client/models/user_status.rb +41 -0
- data/lib/openapi_client/models/web_authn_devices.rb +378 -0
- data/lib/openapi_client/models/web_authn_icons.rb +230 -0
- data/lib/openapi_client/models/web_authn_type.rb +41 -0
- data/lib/openapi_client/version.rb +15 -0
- data/lib/openapi_client.rb +74 -0
- data/lib/passageidentity/auth.rb +32 -5
- data/lib/passageidentity/client.rb +17 -121
- data/lib/passageidentity/user_api.rb +29 -131
- data/lib/passageidentity/version.rb +5 -0
- data/openapitools.json +7 -0
- data/passageidentity.gemspec +3 -1
- data/tests/auth_test.rb +6 -1
- data/tests/magic_link_test.rb +5 -4
- data/tests/user_api_test.rb +2 -2
- metadata +96 -2
@@ -0,0 +1,452 @@
|
|
1
|
+
=begin
|
2
|
+
#Passage Management API
|
3
|
+
|
4
|
+
#Passage's management API to manage your Passage apps and users.
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1
|
7
|
+
Contact: support@passage.id
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 7.1.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
|
+
# Activate User
|
23
|
+
# Activate a user. They will now be able to login.
|
24
|
+
# @param app_id [String] App ID
|
25
|
+
# @param user_id [String] User ID
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [UserResponse]
|
28
|
+
def activate_user(app_id, user_id, opts = {})
|
29
|
+
data, _status_code, _headers = activate_user_with_http_info(app_id, user_id, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Activate User
|
34
|
+
# Activate a user. They will now be able to login.
|
35
|
+
# @param app_id [String] App ID
|
36
|
+
# @param user_id [String] User ID
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
39
|
+
def activate_user_with_http_info(app_id, user_id, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.activate_user ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'app_id' is set
|
44
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.activate_user"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'user_id' is set
|
48
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.activate_user"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/apps/{app_id}/users/{user_id}/activate'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).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'])
|
61
|
+
|
62
|
+
# form parameters
|
63
|
+
form_params = opts[:form_params] || {}
|
64
|
+
|
65
|
+
# http body (model)
|
66
|
+
post_body = opts[:debug_body]
|
67
|
+
|
68
|
+
# return_type
|
69
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
70
|
+
|
71
|
+
# auth_names
|
72
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
73
|
+
|
74
|
+
new_options = opts.merge(
|
75
|
+
:operation => :"UsersApi.activate_user",
|
76
|
+
:header_params => header_params,
|
77
|
+
:query_params => query_params,
|
78
|
+
:form_params => form_params,
|
79
|
+
:body => post_body,
|
80
|
+
:auth_names => auth_names,
|
81
|
+
:return_type => return_type
|
82
|
+
)
|
83
|
+
|
84
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
85
|
+
if @api_client.config.debugging
|
86
|
+
@api_client.config.logger.debug "API called: UsersApi#activate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
87
|
+
end
|
88
|
+
return data, status_code, headers
|
89
|
+
end
|
90
|
+
|
91
|
+
# Create User
|
92
|
+
# Create user for an application. Must provide an email of phone number identifier.
|
93
|
+
# @param app_id [String] App ID
|
94
|
+
# @param create_user_request [CreateUserRequest] email, phone, user_metadata
|
95
|
+
# @param [Hash] opts the optional parameters
|
96
|
+
# @return [UserResponse]
|
97
|
+
def create_user(app_id, create_user_request, opts = {})
|
98
|
+
data, _status_code, _headers = create_user_with_http_info(app_id, create_user_request, opts)
|
99
|
+
data
|
100
|
+
end
|
101
|
+
|
102
|
+
# Create User
|
103
|
+
# Create user for an application. Must provide an email of phone number identifier.
|
104
|
+
# @param app_id [String] App ID
|
105
|
+
# @param create_user_request [CreateUserRequest] email, phone, user_metadata
|
106
|
+
# @param [Hash] opts the optional parameters
|
107
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
108
|
+
def create_user_with_http_info(app_id, create_user_request, opts = {})
|
109
|
+
if @api_client.config.debugging
|
110
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.create_user ...'
|
111
|
+
end
|
112
|
+
# verify the required parameter 'app_id' is set
|
113
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
114
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.create_user"
|
115
|
+
end
|
116
|
+
# verify the required parameter 'create_user_request' is set
|
117
|
+
if @api_client.config.client_side_validation && create_user_request.nil?
|
118
|
+
fail ArgumentError, "Missing the required parameter 'create_user_request' when calling UsersApi.create_user"
|
119
|
+
end
|
120
|
+
# resource path
|
121
|
+
local_var_path = '/apps/{app_id}/users'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s))
|
122
|
+
|
123
|
+
# query parameters
|
124
|
+
query_params = opts[:query_params] || {}
|
125
|
+
|
126
|
+
# header parameters
|
127
|
+
header_params = opts[:header_params] || {}
|
128
|
+
# HTTP header 'Accept' (if needed)
|
129
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
130
|
+
# HTTP header 'Content-Type'
|
131
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
132
|
+
if !content_type.nil?
|
133
|
+
header_params['Content-Type'] = content_type
|
134
|
+
end
|
135
|
+
|
136
|
+
# form parameters
|
137
|
+
form_params = opts[:form_params] || {}
|
138
|
+
|
139
|
+
# http body (model)
|
140
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_user_request)
|
141
|
+
|
142
|
+
# return_type
|
143
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
144
|
+
|
145
|
+
# auth_names
|
146
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
147
|
+
|
148
|
+
new_options = opts.merge(
|
149
|
+
:operation => :"UsersApi.create_user",
|
150
|
+
:header_params => header_params,
|
151
|
+
:query_params => query_params,
|
152
|
+
:form_params => form_params,
|
153
|
+
:body => post_body,
|
154
|
+
:auth_names => auth_names,
|
155
|
+
:return_type => return_type
|
156
|
+
)
|
157
|
+
|
158
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
159
|
+
if @api_client.config.debugging
|
160
|
+
@api_client.config.logger.debug "API called: UsersApi#create_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
161
|
+
end
|
162
|
+
return data, status_code, headers
|
163
|
+
end
|
164
|
+
|
165
|
+
# Deactivate User
|
166
|
+
# Deactivate a user. Their account will still exist, but they will not be able to login.
|
167
|
+
# @param app_id [String] App ID
|
168
|
+
# @param user_id [String] User ID
|
169
|
+
# @param [Hash] opts the optional parameters
|
170
|
+
# @return [UserResponse]
|
171
|
+
def deactivate_user(app_id, user_id, opts = {})
|
172
|
+
data, _status_code, _headers = deactivate_user_with_http_info(app_id, user_id, opts)
|
173
|
+
data
|
174
|
+
end
|
175
|
+
|
176
|
+
# Deactivate User
|
177
|
+
# Deactivate a user. Their account will still exist, but they will not be able to login.
|
178
|
+
# @param app_id [String] App ID
|
179
|
+
# @param user_id [String] User ID
|
180
|
+
# @param [Hash] opts the optional parameters
|
181
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
182
|
+
def deactivate_user_with_http_info(app_id, user_id, opts = {})
|
183
|
+
if @api_client.config.debugging
|
184
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.deactivate_user ...'
|
185
|
+
end
|
186
|
+
# verify the required parameter 'app_id' is set
|
187
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
188
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.deactivate_user"
|
189
|
+
end
|
190
|
+
# verify the required parameter 'user_id' is set
|
191
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
192
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.deactivate_user"
|
193
|
+
end
|
194
|
+
# resource path
|
195
|
+
local_var_path = '/apps/{app_id}/users/{user_id}/deactivate'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
196
|
+
|
197
|
+
# query parameters
|
198
|
+
query_params = opts[:query_params] || {}
|
199
|
+
|
200
|
+
# header parameters
|
201
|
+
header_params = opts[:header_params] || {}
|
202
|
+
# HTTP header 'Accept' (if needed)
|
203
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
204
|
+
|
205
|
+
# form parameters
|
206
|
+
form_params = opts[:form_params] || {}
|
207
|
+
|
208
|
+
# http body (model)
|
209
|
+
post_body = opts[:debug_body]
|
210
|
+
|
211
|
+
# return_type
|
212
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
213
|
+
|
214
|
+
# auth_names
|
215
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
216
|
+
|
217
|
+
new_options = opts.merge(
|
218
|
+
:operation => :"UsersApi.deactivate_user",
|
219
|
+
:header_params => header_params,
|
220
|
+
:query_params => query_params,
|
221
|
+
:form_params => form_params,
|
222
|
+
:body => post_body,
|
223
|
+
:auth_names => auth_names,
|
224
|
+
:return_type => return_type
|
225
|
+
)
|
226
|
+
|
227
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
228
|
+
if @api_client.config.debugging
|
229
|
+
@api_client.config.logger.debug "API called: UsersApi#deactivate_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
230
|
+
end
|
231
|
+
return data, status_code, headers
|
232
|
+
end
|
233
|
+
|
234
|
+
# Delete User
|
235
|
+
# Delete a user.
|
236
|
+
# @param app_id [String] App ID
|
237
|
+
# @param user_id [String] User ID
|
238
|
+
# @param [Hash] opts the optional parameters
|
239
|
+
# @return [nil]
|
240
|
+
def delete_user(app_id, user_id, opts = {})
|
241
|
+
delete_user_with_http_info(app_id, user_id, opts)
|
242
|
+
nil
|
243
|
+
end
|
244
|
+
|
245
|
+
# Delete User
|
246
|
+
# Delete a user.
|
247
|
+
# @param app_id [String] App ID
|
248
|
+
# @param user_id [String] User ID
|
249
|
+
# @param [Hash] opts the optional parameters
|
250
|
+
# @return [Array<(nil, Integer, Hash)>] nil, response status code and response headers
|
251
|
+
def delete_user_with_http_info(app_id, user_id, opts = {})
|
252
|
+
if @api_client.config.debugging
|
253
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.delete_user ...'
|
254
|
+
end
|
255
|
+
# verify the required parameter 'app_id' is set
|
256
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
257
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.delete_user"
|
258
|
+
end
|
259
|
+
# verify the required parameter 'user_id' is set
|
260
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
261
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.delete_user"
|
262
|
+
end
|
263
|
+
# resource path
|
264
|
+
local_var_path = '/apps/{app_id}/users/{user_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
265
|
+
|
266
|
+
# query parameters
|
267
|
+
query_params = opts[:query_params] || {}
|
268
|
+
|
269
|
+
# header parameters
|
270
|
+
header_params = opts[:header_params] || {}
|
271
|
+
# HTTP header 'Accept' (if needed)
|
272
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
273
|
+
|
274
|
+
# form parameters
|
275
|
+
form_params = opts[:form_params] || {}
|
276
|
+
|
277
|
+
# http body (model)
|
278
|
+
post_body = opts[:debug_body]
|
279
|
+
|
280
|
+
# return_type
|
281
|
+
return_type = opts[:debug_return_type]
|
282
|
+
|
283
|
+
# auth_names
|
284
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
285
|
+
|
286
|
+
new_options = opts.merge(
|
287
|
+
:operation => :"UsersApi.delete_user",
|
288
|
+
:header_params => header_params,
|
289
|
+
:query_params => query_params,
|
290
|
+
:form_params => form_params,
|
291
|
+
:body => post_body,
|
292
|
+
:auth_names => auth_names,
|
293
|
+
:return_type => return_type
|
294
|
+
)
|
295
|
+
|
296
|
+
data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, new_options)
|
297
|
+
if @api_client.config.debugging
|
298
|
+
@api_client.config.logger.debug "API called: UsersApi#delete_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
299
|
+
end
|
300
|
+
return data, status_code, headers
|
301
|
+
end
|
302
|
+
|
303
|
+
# Get User
|
304
|
+
# Get information about a user.
|
305
|
+
# @param app_id [String] App ID
|
306
|
+
# @param user_id [String] User ID
|
307
|
+
# @param [Hash] opts the optional parameters
|
308
|
+
# @return [UserResponse]
|
309
|
+
def get_user(app_id, user_id, opts = {})
|
310
|
+
data, _status_code, _headers = get_user_with_http_info(app_id, user_id, opts)
|
311
|
+
data
|
312
|
+
end
|
313
|
+
|
314
|
+
# Get User
|
315
|
+
# Get information about a user.
|
316
|
+
# @param app_id [String] App ID
|
317
|
+
# @param user_id [String] User ID
|
318
|
+
# @param [Hash] opts the optional parameters
|
319
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
320
|
+
def get_user_with_http_info(app_id, user_id, opts = {})
|
321
|
+
if @api_client.config.debugging
|
322
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.get_user ...'
|
323
|
+
end
|
324
|
+
# verify the required parameter 'app_id' is set
|
325
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
326
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.get_user"
|
327
|
+
end
|
328
|
+
# verify the required parameter 'user_id' is set
|
329
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
330
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.get_user"
|
331
|
+
end
|
332
|
+
# resource path
|
333
|
+
local_var_path = '/apps/{app_id}/users/{user_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
334
|
+
|
335
|
+
# query parameters
|
336
|
+
query_params = opts[:query_params] || {}
|
337
|
+
|
338
|
+
# header parameters
|
339
|
+
header_params = opts[:header_params] || {}
|
340
|
+
# HTTP header 'Accept' (if needed)
|
341
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
342
|
+
|
343
|
+
# form parameters
|
344
|
+
form_params = opts[:form_params] || {}
|
345
|
+
|
346
|
+
# http body (model)
|
347
|
+
post_body = opts[:debug_body]
|
348
|
+
|
349
|
+
# return_type
|
350
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
351
|
+
|
352
|
+
# auth_names
|
353
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
354
|
+
|
355
|
+
new_options = opts.merge(
|
356
|
+
:operation => :"UsersApi.get_user",
|
357
|
+
:header_params => header_params,
|
358
|
+
:query_params => query_params,
|
359
|
+
:form_params => form_params,
|
360
|
+
:body => post_body,
|
361
|
+
:auth_names => auth_names,
|
362
|
+
:return_type => return_type
|
363
|
+
)
|
364
|
+
|
365
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
366
|
+
if @api_client.config.debugging
|
367
|
+
@api_client.config.logger.debug "API called: UsersApi#get_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
368
|
+
end
|
369
|
+
return data, status_code, headers
|
370
|
+
end
|
371
|
+
|
372
|
+
# Update User
|
373
|
+
# Update a user's information.
|
374
|
+
# @param app_id [String] App ID
|
375
|
+
# @param user_id [String] User ID
|
376
|
+
# @param update_user_request [UpdateUserRequest] user settings
|
377
|
+
# @param [Hash] opts the optional parameters
|
378
|
+
# @return [UserResponse]
|
379
|
+
def update_user(app_id, user_id, update_user_request, opts = {})
|
380
|
+
data, _status_code, _headers = update_user_with_http_info(app_id, user_id, update_user_request, opts)
|
381
|
+
data
|
382
|
+
end
|
383
|
+
|
384
|
+
# Update User
|
385
|
+
# Update a user's information.
|
386
|
+
# @param app_id [String] App ID
|
387
|
+
# @param user_id [String] User ID
|
388
|
+
# @param update_user_request [UpdateUserRequest] user settings
|
389
|
+
# @param [Hash] opts the optional parameters
|
390
|
+
# @return [Array<(UserResponse, Integer, Hash)>] UserResponse data, response status code and response headers
|
391
|
+
def update_user_with_http_info(app_id, user_id, update_user_request, opts = {})
|
392
|
+
if @api_client.config.debugging
|
393
|
+
@api_client.config.logger.debug 'Calling API: UsersApi.update_user ...'
|
394
|
+
end
|
395
|
+
# verify the required parameter 'app_id' is set
|
396
|
+
if @api_client.config.client_side_validation && app_id.nil?
|
397
|
+
fail ArgumentError, "Missing the required parameter 'app_id' when calling UsersApi.update_user"
|
398
|
+
end
|
399
|
+
# verify the required parameter 'user_id' is set
|
400
|
+
if @api_client.config.client_side_validation && user_id.nil?
|
401
|
+
fail ArgumentError, "Missing the required parameter 'user_id' when calling UsersApi.update_user"
|
402
|
+
end
|
403
|
+
# verify the required parameter 'update_user_request' is set
|
404
|
+
if @api_client.config.client_side_validation && update_user_request.nil?
|
405
|
+
fail ArgumentError, "Missing the required parameter 'update_user_request' when calling UsersApi.update_user"
|
406
|
+
end
|
407
|
+
# resource path
|
408
|
+
local_var_path = '/apps/{app_id}/users/{user_id}'.sub('{' + 'app_id' + '}', CGI.escape(app_id.to_s)).sub('{' + 'user_id' + '}', CGI.escape(user_id.to_s))
|
409
|
+
|
410
|
+
# query parameters
|
411
|
+
query_params = opts[:query_params] || {}
|
412
|
+
|
413
|
+
# header parameters
|
414
|
+
header_params = opts[:header_params] || {}
|
415
|
+
# HTTP header 'Accept' (if needed)
|
416
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
417
|
+
# HTTP header 'Content-Type'
|
418
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
419
|
+
if !content_type.nil?
|
420
|
+
header_params['Content-Type'] = content_type
|
421
|
+
end
|
422
|
+
|
423
|
+
# form parameters
|
424
|
+
form_params = opts[:form_params] || {}
|
425
|
+
|
426
|
+
# http body (model)
|
427
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(update_user_request)
|
428
|
+
|
429
|
+
# return_type
|
430
|
+
return_type = opts[:debug_return_type] || 'UserResponse'
|
431
|
+
|
432
|
+
# auth_names
|
433
|
+
auth_names = opts[:debug_auth_names] || ['bearerAuth']
|
434
|
+
|
435
|
+
new_options = opts.merge(
|
436
|
+
:operation => :"UsersApi.update_user",
|
437
|
+
:header_params => header_params,
|
438
|
+
:query_params => query_params,
|
439
|
+
:form_params => form_params,
|
440
|
+
:body => post_body,
|
441
|
+
:auth_names => auth_names,
|
442
|
+
:return_type => return_type
|
443
|
+
)
|
444
|
+
|
445
|
+
data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, new_options)
|
446
|
+
if @api_client.config.debugging
|
447
|
+
@api_client.config.logger.debug "API called: UsersApi#update_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
448
|
+
end
|
449
|
+
return data, status_code, headers
|
450
|
+
end
|
451
|
+
end
|
452
|
+
end
|