login_radius 3.0.0 → 10.0.0.pre.beta
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/LICENSE.txt +21 -0
- data/README.md +58 -52
- data/lib/login_radius.rb +30 -15
- data/lib/login_radius/api/account/account_api.rb +581 -0
- data/lib/login_radius/api/account/role_api.rb +330 -0
- data/lib/login_radius/api/account/sott_api.rb +47 -0
- data/lib/login_radius/api/advanced/configuration_api.rb +57 -0
- data/lib/login_radius/api/advanced/consent_management_api.rb +161 -0
- data/lib/login_radius/api/advanced/custom_object_api.rb +316 -0
- data/lib/login_radius/api/advanced/custom_registration_data_api.rb +195 -0
- data/lib/login_radius/api/advanced/multi_factor_authentication_api.rb +606 -0
- data/lib/login_radius/api/advanced/re_authentication_api.rb +243 -0
- data/lib/login_radius/api/advanced/web_hook_api.rb +101 -0
- data/lib/login_radius/api/authentication/authentication_api.rb +986 -0
- data/lib/login_radius/api/authentication/one_touch_login_api.rb +160 -0
- data/lib/login_radius/api/authentication/password_less_login_api.rb +158 -0
- data/lib/login_radius/api/authentication/phone_authentication_api.rb +329 -0
- data/lib/login_radius/api/authentication/pin_authentication_api.rb +316 -0
- data/lib/login_radius/api/authentication/risk_based_authentication_api.rb +286 -0
- data/lib/login_radius/api/authentication/smart_login_api.rb +146 -0
- data/lib/login_radius/api/social/native_social_api.rb +193 -0
- data/lib/login_radius/api/social/social_api.rb +802 -0
- data/lib/login_radius/error.rb +7 -0
- data/lib/login_radius/request_client.rb +295 -0
- data/lib/login_radius/response.rb +12 -0
- data/lib/login_radius/version.rb +3 -3
- data/login_radius.gemspec +36 -0
- metadata +61 -20
- data/LICENSE +0 -22
- data/lib/hash.rb +0 -12
- data/lib/login_radius/advanced_api.rb +0 -133
- data/lib/login_radius/authentication_api.rb +0 -597
- data/lib/login_radius/exception.rb +0 -4
- data/lib/login_radius/management_api.rb +0 -327
- data/lib/login_radius/rest_request.rb +0 -142
- data/lib/login_radius/social_api.rb +0 -402
- data/lib/login_radius/two_fa_api.rb +0 -191
- data/lib/string.rb +0 -8
@@ -0,0 +1,316 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Created by LoginRadius Development Team
|
4
|
+
# Copyright 2019 LoginRadius Inc. All rights reserved.
|
5
|
+
require_relative '../../request_client'
|
6
|
+
|
7
|
+
module LoginRadius
|
8
|
+
# CustomObjectApi module
|
9
|
+
class CustomObjectApi
|
10
|
+
include RequestClient
|
11
|
+
|
12
|
+
attr_accessor :site_name, :api_key, :api_secret
|
13
|
+
|
14
|
+
# Initializes a LoginRadius Account object with an apikey and secret
|
15
|
+
# Takes in a hash containing site_name(required), api_key(required), api_secret(required)
|
16
|
+
def initialize
|
17
|
+
@site_name = ENV['SITE_NAME']
|
18
|
+
@api_key = ENV['API_KEY']
|
19
|
+
@api_secret = ENV['API_SECRET']
|
20
|
+
raise LoginRadius::Error.new, "'site_name' is a required option for Account class initialization." \
|
21
|
+
unless @site_name != '' && @site_name != nil
|
22
|
+
raise LoginRadius::Error.new, "'api_key' is a required option for Account class initialization." \
|
23
|
+
unless @api_key != '' && @api_key != nil
|
24
|
+
raise LoginRadius::Error.new, "'api_secret is a required option for Account class initialization." \
|
25
|
+
unless @api_secret != '' && @api_secret != nil
|
26
|
+
end
|
27
|
+
|
28
|
+
# This API is used to write information in JSON format to the custom object for the specified account.
|
29
|
+
#
|
30
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
31
|
+
# @param object_name - LoginRadius Custom Object Name
|
32
|
+
# @param payload - LoginRadius Custom Object Name
|
33
|
+
#
|
34
|
+
# @return Response containing Definition for Complete user custom object data
|
35
|
+
# 6.1
|
36
|
+
def create_custom_object_by_token(access_token, object_name, payload)
|
37
|
+
if isNullOrWhiteSpace(access_token)
|
38
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
39
|
+
end
|
40
|
+
if isNullOrWhiteSpace(object_name)
|
41
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
42
|
+
end
|
43
|
+
if payload.blank?
|
44
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
45
|
+
end
|
46
|
+
|
47
|
+
query_parameters = {}
|
48
|
+
query_parameters['access_token'] = access_token
|
49
|
+
query_parameters['apiKey'] = @api_key
|
50
|
+
query_parameters['objectName'] = object_name
|
51
|
+
|
52
|
+
resource_path = 'identity/v2/auth/customobject'
|
53
|
+
post_request(resource_path, query_parameters, payload)
|
54
|
+
end
|
55
|
+
|
56
|
+
# This API is used to update the specified custom object data of the specified account. If the value of updatetype is 'replace' then it will fully replace custom object with the new custom object and if the value of updatetype is 'partialreplace' then it will perform an upsert type operation
|
57
|
+
#
|
58
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
59
|
+
# @param object_name - LoginRadius Custom Object Name
|
60
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
61
|
+
# @param payload - LoginRadius Custom Object Name
|
62
|
+
# @param update_type - Possible values: replace, partialreplace.
|
63
|
+
#
|
64
|
+
# @return Response containing Definition for Complete user custom object data
|
65
|
+
# 6.2
|
66
|
+
def update_custom_object_by_token(access_token, object_name, object_record_id, payload, update_type = '')
|
67
|
+
if isNullOrWhiteSpace(access_token)
|
68
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
69
|
+
end
|
70
|
+
if isNullOrWhiteSpace(object_name)
|
71
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
72
|
+
end
|
73
|
+
if isNullOrWhiteSpace(object_record_id)
|
74
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
75
|
+
end
|
76
|
+
if payload.blank?
|
77
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
78
|
+
end
|
79
|
+
|
80
|
+
query_parameters = {}
|
81
|
+
query_parameters['access_token'] = access_token
|
82
|
+
query_parameters['apiKey'] = @api_key
|
83
|
+
query_parameters['objectName'] = object_name
|
84
|
+
unless update_type == false
|
85
|
+
query_parameters['updateType'] = update_type
|
86
|
+
end
|
87
|
+
|
88
|
+
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
89
|
+
put_request(resource_path, query_parameters, payload)
|
90
|
+
end
|
91
|
+
|
92
|
+
# This API is used to retrieve the specified Custom Object data for the specified account.
|
93
|
+
#
|
94
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
95
|
+
# @param object_name - LoginRadius Custom Object Name
|
96
|
+
#
|
97
|
+
# @return Complete user CustomObject data
|
98
|
+
# 6.3
|
99
|
+
def get_custom_object_by_token(access_token, object_name)
|
100
|
+
if isNullOrWhiteSpace(access_token)
|
101
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
102
|
+
end
|
103
|
+
if isNullOrWhiteSpace(object_name)
|
104
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
105
|
+
end
|
106
|
+
|
107
|
+
query_parameters = {}
|
108
|
+
query_parameters['access_token'] = access_token
|
109
|
+
query_parameters['apiKey'] = @api_key
|
110
|
+
query_parameters['objectName'] = object_name
|
111
|
+
|
112
|
+
resource_path = 'identity/v2/auth/customobject'
|
113
|
+
get_request(resource_path, query_parameters, nil)
|
114
|
+
end
|
115
|
+
|
116
|
+
# This API is used to retrieve the Custom Object data for the specified account.
|
117
|
+
#
|
118
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
119
|
+
# @param object_name - LoginRadius Custom Object Name
|
120
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
121
|
+
#
|
122
|
+
# @return Response containing Definition for Complete user custom object data
|
123
|
+
# 6.4
|
124
|
+
def get_custom_object_by_record_id_and_token(access_token, object_name, object_record_id)
|
125
|
+
if isNullOrWhiteSpace(access_token)
|
126
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
127
|
+
end
|
128
|
+
if isNullOrWhiteSpace(object_name)
|
129
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
130
|
+
end
|
131
|
+
if isNullOrWhiteSpace(object_record_id)
|
132
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
133
|
+
end
|
134
|
+
|
135
|
+
query_parameters = {}
|
136
|
+
query_parameters['access_token'] = access_token
|
137
|
+
query_parameters['apiKey'] = @api_key
|
138
|
+
query_parameters['objectName'] = object_name
|
139
|
+
|
140
|
+
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
141
|
+
get_request(resource_path, query_parameters, nil)
|
142
|
+
end
|
143
|
+
|
144
|
+
# This API is used to remove the specified Custom Object data using ObjectRecordId of a specified account.
|
145
|
+
#
|
146
|
+
# @param access_token - Uniquely generated identifier key by LoginRadius that is activated after successful authentication.
|
147
|
+
# @param object_name - LoginRadius Custom Object Name
|
148
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
149
|
+
#
|
150
|
+
# @return Response containing Definition of Delete Request
|
151
|
+
# 6.5
|
152
|
+
def delete_custom_object_by_token(access_token, object_name, object_record_id)
|
153
|
+
if isNullOrWhiteSpace(access_token)
|
154
|
+
raise LoginRadius::Error.new, getValidationMessage('access_token')
|
155
|
+
end
|
156
|
+
if isNullOrWhiteSpace(object_name)
|
157
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
158
|
+
end
|
159
|
+
if isNullOrWhiteSpace(object_record_id)
|
160
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
161
|
+
end
|
162
|
+
|
163
|
+
query_parameters = {}
|
164
|
+
query_parameters['access_token'] = access_token
|
165
|
+
query_parameters['apiKey'] = @api_key
|
166
|
+
query_parameters['objectName'] = object_name
|
167
|
+
|
168
|
+
resource_path = 'identity/v2/auth/customobject/' + object_record_id
|
169
|
+
delete_request(resource_path, query_parameters, nil)
|
170
|
+
end
|
171
|
+
|
172
|
+
# This API is used to write information in JSON format to the custom object for the specified account.
|
173
|
+
#
|
174
|
+
# @param object_name - LoginRadius Custom Object Name
|
175
|
+
# @param payload - LoginRadius Custom Object Name
|
176
|
+
# @param uid - UID, the unified identifier for each user account
|
177
|
+
#
|
178
|
+
# @return Response containing Definition for Complete user custom object data
|
179
|
+
# 19.1
|
180
|
+
def create_custom_object_by_uid(object_name, payload, uid)
|
181
|
+
if isNullOrWhiteSpace(object_name)
|
182
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
183
|
+
end
|
184
|
+
if payload.blank?
|
185
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
186
|
+
end
|
187
|
+
if isNullOrWhiteSpace(uid)
|
188
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
189
|
+
end
|
190
|
+
|
191
|
+
query_parameters = {}
|
192
|
+
query_parameters['apiKey'] = @api_key
|
193
|
+
query_parameters['apiSecret'] = @api_secret
|
194
|
+
query_parameters['objectName'] = object_name
|
195
|
+
|
196
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject'
|
197
|
+
post_request(resource_path, query_parameters, payload)
|
198
|
+
end
|
199
|
+
|
200
|
+
# This API is used to update the specified custom object data of a specified account. If the value of updatetype is 'replace' then it will fully replace custom object with new custom object and if the value of updatetype is partialreplace then it will perform an upsert type operation.
|
201
|
+
#
|
202
|
+
# @param object_name - LoginRadius Custom Object Name
|
203
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
204
|
+
# @param payload - LoginRadius Custom Object Name
|
205
|
+
# @param uid - UID, the unified identifier for each user account
|
206
|
+
# @param update_type - Possible values: replace, partialreplace.
|
207
|
+
#
|
208
|
+
# @return Response containing Definition for Complete user custom object data
|
209
|
+
# 19.2
|
210
|
+
def update_custom_object_by_uid(object_name, object_record_id, payload, uid, update_type = '')
|
211
|
+
if isNullOrWhiteSpace(object_name)
|
212
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
213
|
+
end
|
214
|
+
if isNullOrWhiteSpace(object_record_id)
|
215
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
216
|
+
end
|
217
|
+
if payload.blank?
|
218
|
+
raise LoginRadius::Error.new, getValidationMessage('payload')
|
219
|
+
end
|
220
|
+
if isNullOrWhiteSpace(uid)
|
221
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
222
|
+
end
|
223
|
+
|
224
|
+
query_parameters = {}
|
225
|
+
query_parameters['apiKey'] = @api_key
|
226
|
+
query_parameters['apiSecret'] = @api_secret
|
227
|
+
query_parameters['objectName'] = object_name
|
228
|
+
unless update_type == false
|
229
|
+
query_parameters['updateType'] = update_type
|
230
|
+
end
|
231
|
+
|
232
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
233
|
+
put_request(resource_path, query_parameters, payload)
|
234
|
+
end
|
235
|
+
|
236
|
+
# This API is used to retrieve all the custom objects by UID from cloud storage.
|
237
|
+
#
|
238
|
+
# @param object_name - LoginRadius Custom Object Name
|
239
|
+
# @param uid - UID, the unified identifier for each user account
|
240
|
+
#
|
241
|
+
# @return Complete user CustomObject data
|
242
|
+
# 19.3
|
243
|
+
def get_custom_object_by_uid(object_name, uid)
|
244
|
+
if isNullOrWhiteSpace(object_name)
|
245
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
246
|
+
end
|
247
|
+
if isNullOrWhiteSpace(uid)
|
248
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
249
|
+
end
|
250
|
+
|
251
|
+
query_parameters = {}
|
252
|
+
query_parameters['apiKey'] = @api_key
|
253
|
+
query_parameters['apiSecret'] = @api_secret
|
254
|
+
query_parameters['objectName'] = object_name
|
255
|
+
|
256
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject'
|
257
|
+
get_request(resource_path, query_parameters, nil)
|
258
|
+
end
|
259
|
+
|
260
|
+
# This API is used to retrieve the Custom Object data for the specified account.
|
261
|
+
#
|
262
|
+
# @param object_name - LoginRadius Custom Object Name
|
263
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
264
|
+
# @param uid - UID, the unified identifier for each user account
|
265
|
+
#
|
266
|
+
# @return Response containing Definition for Complete user custom object data
|
267
|
+
# 19.4
|
268
|
+
def get_custom_object_by_record_id(object_name, object_record_id, uid)
|
269
|
+
if isNullOrWhiteSpace(object_name)
|
270
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
271
|
+
end
|
272
|
+
if isNullOrWhiteSpace(object_record_id)
|
273
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
274
|
+
end
|
275
|
+
if isNullOrWhiteSpace(uid)
|
276
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
277
|
+
end
|
278
|
+
|
279
|
+
query_parameters = {}
|
280
|
+
query_parameters['apiKey'] = @api_key
|
281
|
+
query_parameters['apiSecret'] = @api_secret
|
282
|
+
query_parameters['objectName'] = object_name
|
283
|
+
|
284
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
285
|
+
get_request(resource_path, query_parameters, nil)
|
286
|
+
end
|
287
|
+
|
288
|
+
# This API is used to remove the specified Custom Object data using ObjectRecordId of specified account.
|
289
|
+
#
|
290
|
+
# @param object_name - LoginRadius Custom Object Name
|
291
|
+
# @param object_record_id - Unique identifier of the user's record in Custom Object
|
292
|
+
# @param uid - UID, the unified identifier for each user account
|
293
|
+
#
|
294
|
+
# @return Response containing Definition of Delete Request
|
295
|
+
# 19.5
|
296
|
+
def delete_custom_object_by_record_id(object_name, object_record_id, uid)
|
297
|
+
if isNullOrWhiteSpace(object_name)
|
298
|
+
raise LoginRadius::Error.new, getValidationMessage('object_name')
|
299
|
+
end
|
300
|
+
if isNullOrWhiteSpace(object_record_id)
|
301
|
+
raise LoginRadius::Error.new, getValidationMessage('object_record_id')
|
302
|
+
end
|
303
|
+
if isNullOrWhiteSpace(uid)
|
304
|
+
raise LoginRadius::Error.new, getValidationMessage('uid')
|
305
|
+
end
|
306
|
+
|
307
|
+
query_parameters = {}
|
308
|
+
query_parameters['apiKey'] = @api_key
|
309
|
+
query_parameters['apiSecret'] = @api_secret
|
310
|
+
query_parameters['objectName'] = object_name
|
311
|
+
|
312
|
+
resource_path = 'identity/v2/manage/account/' + uid + '/customobject/' + object_record_id
|
313
|
+
delete_request(resource_path, query_parameters, nil)
|
314
|
+
end
|
315
|
+
end
|
316
|
+
end
|
@@ -0,0 +1,195 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Created by LoginRadius Development Team
|
4
|
+
# Copyright 2019 LoginRadius Inc. All rights reserved.
|
5
|
+
require_relative '../../request_client'
|
6
|
+
|
7
|
+
module LoginRadius
|
8
|
+
# CustomRegistrationDataApi module
|
9
|
+
class CustomRegistrationDataApi
|
10
|
+
include RequestClient
|
11
|
+
|
12
|
+
attr_accessor :site_name, :api_key, :api_secret
|
13
|
+
|
14
|
+
# Initializes a LoginRadius Account object with an apikey and secret
|
15
|
+
# Takes in a hash containing site_name(required), api_key(required), api_secret(required)
|
16
|
+
def initialize
|
17
|
+
@site_name = ENV['SITE_NAME']
|
18
|
+
@api_key = ENV['API_KEY']
|
19
|
+
@api_secret = ENV['API_SECRET']
|
20
|
+
raise LoginRadius::Error.new, "'site_name' is a required option for Account class initialization." \
|
21
|
+
unless @site_name != '' && @site_name != nil
|
22
|
+
raise LoginRadius::Error.new, "'api_key' is a required option for Account class initialization." \
|
23
|
+
unless @api_key != '' && @api_key != nil
|
24
|
+
raise LoginRadius::Error.new, "'api_secret is a required option for Account class initialization." \
|
25
|
+
unless @api_secret != '' && @api_secret != nil
|
26
|
+
end
|
27
|
+
|
28
|
+
# This API is used to retrieve dropdown data.
|
29
|
+
#
|
30
|
+
# @param type - Type of the Datasource
|
31
|
+
# @param limit - Retrieve number of records at a time(max limit is 50)
|
32
|
+
# @param parent_id - Id of parent dropdown member(if any).
|
33
|
+
# @param skip - Skip number of records from start
|
34
|
+
#
|
35
|
+
# @return Complete user Registration data
|
36
|
+
# 7.1
|
37
|
+
def auth_get_registration_data(type, limit = '', parent_id = '', skip = '')
|
38
|
+
if isNullOrWhiteSpace(type)
|
39
|
+
raise LoginRadius::Error.new, getValidationMessage('type')
|
40
|
+
end
|
41
|
+
|
42
|
+
query_parameters = {}
|
43
|
+
query_parameters['apiKey'] = @api_key
|
44
|
+
unless limit == false
|
45
|
+
query_parameters['limit'] = limit
|
46
|
+
end
|
47
|
+
unless isNullOrWhiteSpace(parent_id)
|
48
|
+
query_parameters['parentId'] = parent_id
|
49
|
+
end
|
50
|
+
unless skip == false
|
51
|
+
query_parameters['skip'] = skip
|
52
|
+
end
|
53
|
+
|
54
|
+
resource_path = 'identity/v2/auth/registrationdata/' + type
|
55
|
+
get_request(resource_path, query_parameters, nil)
|
56
|
+
end
|
57
|
+
|
58
|
+
# This API allows you to validate code for a particular dropdown member.
|
59
|
+
#
|
60
|
+
# @param code - Secret Code
|
61
|
+
# @param record_id - Selected dropdown item’s record id
|
62
|
+
#
|
63
|
+
# @return Response containing Definition of Complete Validation data
|
64
|
+
# 7.2
|
65
|
+
def validate_registration_data_code(code, record_id)
|
66
|
+
if isNullOrWhiteSpace(code)
|
67
|
+
raise LoginRadius::Error.new, getValidationMessage('code')
|
68
|
+
end
|
69
|
+
if isNullOrWhiteSpace(record_id)
|
70
|
+
raise LoginRadius::Error.new, getValidationMessage('record_id')
|
71
|
+
end
|
72
|
+
|
73
|
+
query_parameters = {}
|
74
|
+
query_parameters['apiKey'] = @api_key
|
75
|
+
|
76
|
+
body_parameters = {}
|
77
|
+
body_parameters['code'] = code
|
78
|
+
body_parameters['recordId'] = record_id
|
79
|
+
|
80
|
+
resource_path = 'identity/v2/auth/registrationdata/validatecode'
|
81
|
+
post_request(resource_path, query_parameters, body_parameters)
|
82
|
+
end
|
83
|
+
|
84
|
+
# This API is used to retrieve dropdown data.
|
85
|
+
#
|
86
|
+
# @param type - Type of the Datasource
|
87
|
+
# @param limit - Retrive number of records at a time(max limit is 50
|
88
|
+
# @param parent_id - Id of parent dropdown member(if any).
|
89
|
+
# @param skip - Skip number of records from start
|
90
|
+
#
|
91
|
+
# @return Complete user Registration data Fields
|
92
|
+
# 16.1
|
93
|
+
def get_registration_data(type, limit = '', parent_id = '', skip = '')
|
94
|
+
if isNullOrWhiteSpace(type)
|
95
|
+
raise LoginRadius::Error.new, getValidationMessage('type')
|
96
|
+
end
|
97
|
+
|
98
|
+
query_parameters = {}
|
99
|
+
query_parameters['apiKey'] = @api_key
|
100
|
+
query_parameters['apiSecret'] = @api_secret
|
101
|
+
unless limit == false
|
102
|
+
query_parameters['limit'] = limit
|
103
|
+
end
|
104
|
+
unless isNullOrWhiteSpace(parent_id)
|
105
|
+
query_parameters['parentId'] = parent_id
|
106
|
+
end
|
107
|
+
unless skip == false
|
108
|
+
query_parameters['skip'] = skip
|
109
|
+
end
|
110
|
+
|
111
|
+
resource_path = 'identity/v2/manage/registrationdata/' + type
|
112
|
+
get_request(resource_path, query_parameters, nil)
|
113
|
+
end
|
114
|
+
|
115
|
+
# This API allows you to fill data into a dropdown list which you have created for user Registration. For more details on how to use this API please see our Custom Registration Data Overview
|
116
|
+
#
|
117
|
+
# @param registration_data_create_model_list - Model Class containing Definition of List of Registration Data
|
118
|
+
#
|
119
|
+
# @return Response containing Definition of Complete Validation data
|
120
|
+
# 16.2
|
121
|
+
def add_registration_data(registration_data_create_model_list)
|
122
|
+
if registration_data_create_model_list.blank?
|
123
|
+
raise LoginRadius::Error.new, getValidationMessage('registration_data_create_model_list')
|
124
|
+
end
|
125
|
+
|
126
|
+
query_parameters = {}
|
127
|
+
query_parameters['apiKey'] = @api_key
|
128
|
+
query_parameters['apiSecret'] = @api_secret
|
129
|
+
|
130
|
+
resource_path = 'identity/v2/manage/registrationdata'
|
131
|
+
post_request(resource_path, query_parameters, registration_data_create_model_list)
|
132
|
+
end
|
133
|
+
|
134
|
+
# This API allows you to update a dropdown item
|
135
|
+
#
|
136
|
+
# @param registration_data_update_model - Model Class containing Definition of payload for Registration Data update API
|
137
|
+
# @param record_id - Registration data RecordId
|
138
|
+
#
|
139
|
+
# @return Complete user Registration data Field
|
140
|
+
# 16.3
|
141
|
+
def update_registration_data(registration_data_update_model, record_id)
|
142
|
+
if registration_data_update_model.blank?
|
143
|
+
raise LoginRadius::Error.new, getValidationMessage('registration_data_update_model')
|
144
|
+
end
|
145
|
+
if isNullOrWhiteSpace(record_id)
|
146
|
+
raise LoginRadius::Error.new, getValidationMessage('record_id')
|
147
|
+
end
|
148
|
+
|
149
|
+
query_parameters = {}
|
150
|
+
query_parameters['apiKey'] = @api_key
|
151
|
+
query_parameters['apiSecret'] = @api_secret
|
152
|
+
|
153
|
+
resource_path = 'identity/v2/manage/registrationdata/' + record_id
|
154
|
+
put_request(resource_path, query_parameters, registration_data_update_model)
|
155
|
+
end
|
156
|
+
|
157
|
+
# This API allows you to delete an item from a dropdown list.
|
158
|
+
#
|
159
|
+
# @param record_id - Registration data RecordId
|
160
|
+
#
|
161
|
+
# @return Response containing Definition of Delete Request
|
162
|
+
# 16.4
|
163
|
+
def delete_registration_data(record_id)
|
164
|
+
if isNullOrWhiteSpace(record_id)
|
165
|
+
raise LoginRadius::Error.new, getValidationMessage('record_id')
|
166
|
+
end
|
167
|
+
|
168
|
+
query_parameters = {}
|
169
|
+
query_parameters['apiKey'] = @api_key
|
170
|
+
query_parameters['apiSecret'] = @api_secret
|
171
|
+
|
172
|
+
resource_path = 'identity/v2/manage/registrationdata/' + record_id
|
173
|
+
delete_request(resource_path, query_parameters, nil)
|
174
|
+
end
|
175
|
+
|
176
|
+
# This API allows you to delete all records contained in a datasource.
|
177
|
+
#
|
178
|
+
# @param type - Type of the Datasource
|
179
|
+
#
|
180
|
+
# @return Response containing Definition of Delete Request
|
181
|
+
# 16.5
|
182
|
+
def delete_all_records_by_data_source(type)
|
183
|
+
if isNullOrWhiteSpace(type)
|
184
|
+
raise LoginRadius::Error.new, getValidationMessage('type')
|
185
|
+
end
|
186
|
+
|
187
|
+
query_parameters = {}
|
188
|
+
query_parameters['apiKey'] = @api_key
|
189
|
+
query_parameters['apiSecret'] = @api_secret
|
190
|
+
|
191
|
+
resource_path = 'identity/v2/manage/registrationdata/type/' + type
|
192
|
+
delete_request(resource_path, query_parameters, nil)
|
193
|
+
end
|
194
|
+
end
|
195
|
+
end
|