Class: RusticiSoftwareCloudV2::LearnerApi

Inherits:
Object
  • Object
show all
Defined in:
lib/rustici_software_cloud_v2/api/learner_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ LearnerApi

Returns a new instance of LearnerApi.



19
20
21
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#delete_all_learner_data(learner_id, user_email, opts = {}) ⇒ nil

Deletes all of the information associated with a learner in an application, by learner id. Deletes all of the information associated with a learner in an application, by learner id. This is meant for use with complying with GDPR requests from learners.

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • user_email

    The email of the user initiating this request on behalf of the learner being deleted. This must be a valid primary email address for a SCORM Cloud realm which this application is in.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


28
29
30
31
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 28

def delete_all_learner_data(learner_id, user_email, opts = {})
  delete_all_learner_data_with_http_info(learner_id, user_email, opts)
  nil
end

#delete_all_learner_data_with_http_info(learner_id, user_email, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Deletes all of the information associated with a learner in an application, by learner id. Deletes all of the information associated with a learner in an application, by learner id. This is meant for use with complying with GDPR requests from learners.

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • user_email

    The email of the user initiating this request on behalf of the learner being deleted. This must be a valid primary email address for a SCORM Cloud realm which this application is in.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 39

def delete_all_learner_data_with_http_info(learner_id, user_email, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LearnerApi.delete_all_learner_data ...'
  end
  # verify the required parameter 'learner_id' is set
  if @api_client.config.client_side_validation && learner_id.nil?
    fail ArgumentError, "Missing the required parameter 'learner_id' when calling LearnerApi.delete_all_learner_data"
  end
  # verify the required parameter 'user_email' is set
  if @api_client.config.client_side_validation && user_email.nil?
    fail ArgumentError, "Missing the required parameter 'user_email' when calling LearnerApi.delete_all_learner_data"
  end
  # resource path
  local_var_path = '/learner/{learnerId}/delete-information'.sub('{' + 'learnerId' + '}', learner_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'userEmail'] = user_email

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['APP_NORMAL', 'OAUTH']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LearnerApi#delete_all_learner_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_learner_tags(learner_id, tags, opts = {}) ⇒ nil

Delete the tags for this learner Delete the tags for this learner

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • tags
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


88
89
90
91
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 88

def delete_learner_tags(learner_id, tags, opts = {})
  delete_learner_tags_with_http_info(learner_id, tags, opts)
  nil
end

#delete_learner_tags_with_http_info(learner_id, tags, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete the tags for this learner Delete the tags for this learner

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • tags
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 99

def delete_learner_tags_with_http_info(learner_id, tags, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LearnerApi.delete_learner_tags ...'
  end
  # verify the required parameter 'learner_id' is set
  if @api_client.config.client_side_validation && learner_id.nil?
    fail ArgumentError, "Missing the required parameter 'learner_id' when calling LearnerApi.delete_learner_tags"
  end
  # verify the required parameter 'tags' is set
  if @api_client.config.client_side_validation && tags.nil?
    fail ArgumentError, "Missing the required parameter 'tags' when calling LearnerApi.delete_learner_tags"
  end
  # resource path
  local_var_path = '/learner/{learnerId}/tags'.sub('{' + 'learnerId' + '}', learner_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(tags)
  auth_names = ['APP_NORMAL', 'OAUTH']
  data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LearnerApi#delete_learner_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_learner_tags(learner_id, opts = {}) ⇒ TagListSchema

Get the tags for this learner Get the tags for this learner

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



146
147
148
149
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 146

def get_learner_tags(learner_id, opts = {})
  data, _status_code, _headers = get_learner_tags_with_http_info(learner_id, opts)
  data
end

#get_learner_tags_with_http_info(learner_id, opts = {}) ⇒ Array<(TagListSchema, Fixnum, Hash)>

Get the tags for this learner Get the tags for this learner

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(TagListSchema, Fixnum, Hash)>)

    TagListSchema data, response status code and response headers



156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 156

def get_learner_tags_with_http_info(learner_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LearnerApi.get_learner_tags ...'
  end
  # verify the required parameter 'learner_id' is set
  if @api_client.config.client_side_validation && learner_id.nil?
    fail ArgumentError, "Missing the required parameter 'learner_id' when calling LearnerApi.get_learner_tags"
  end
  # resource path
  local_var_path = '/learner/{learnerId}/tags'.sub('{' + 'learnerId' + '}', learner_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['APP_NORMAL', 'OAUTH']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'TagListSchema')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LearnerApi#get_learner_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_learner_tags(learner_id, tags, opts = {}) ⇒ nil

Set the tags for this learner Set the tags for this learner

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • tags
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


201
202
203
204
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 201

def put_learner_tags(learner_id, tags, opts = {})
  put_learner_tags_with_http_info(learner_id, tags, opts)
  nil
end

#put_learner_tags_batch(batch, opts = {}) ⇒ nil

Sets all of the provided tags on all of the provided learners Sets all of the provided tags on all of the provided learners

Parameters:

  • batch

    Object representing an array of ids to apply an array of tags to.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


259
260
261
262
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 259

def put_learner_tags_batch(batch, opts = {})
  put_learner_tags_batch_with_http_info(batch, opts)
  nil
end

#put_learner_tags_batch_with_http_info(batch, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Sets all of the provided tags on all of the provided learners Sets all of the provided tags on all of the provided learners

Parameters:

  • batch

    Object representing an array of ids to apply an array of tags to.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 269

def put_learner_tags_batch_with_http_info(batch, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LearnerApi.put_learner_tags_batch ...'
  end
  # verify the required parameter 'batch' is set
  if @api_client.config.client_side_validation && batch.nil?
    fail ArgumentError, "Missing the required parameter 'batch' when calling LearnerApi.put_learner_tags_batch"
  end
  # resource path
  local_var_path = '/learner/tags'

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(batch)
  auth_names = ['APP_NORMAL', 'OAUTH']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LearnerApi#put_learner_tags_batch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#put_learner_tags_with_http_info(learner_id, tags, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Set the tags for this learner Set the tags for this learner

Parameters:

  • learner_id

    The id of the learner for which to remove all data from an application

  • tags
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 212

def put_learner_tags_with_http_info(learner_id, tags, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LearnerApi.put_learner_tags ...'
  end
  # verify the required parameter 'learner_id' is set
  if @api_client.config.client_side_validation && learner_id.nil?
    fail ArgumentError, "Missing the required parameter 'learner_id' when calling LearnerApi.put_learner_tags"
  end
  # verify the required parameter 'tags' is set
  if @api_client.config.client_side_validation && tags.nil?
    fail ArgumentError, "Missing the required parameter 'tags' when calling LearnerApi.put_learner_tags"
  end
  # resource path
  local_var_path = '/learner/{learnerId}/tags'.sub('{' + 'learnerId' + '}', learner_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(tags)
  auth_names = ['APP_NORMAL', 'OAUTH']
  data, status_code, headers = @api_client.call_api(:PUT, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LearnerApi#put_learner_tags\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_learner_info(learner_id, learner_info, opts = {}) ⇒ nil

Update a learner’s info on all of their registrations. A learner in SCORM Cloud is not an entity on its own. In fact, learners only exist as information on individual registrations. This method will update the information on each of the registrations that the provided ‘learnerId` is attached to. You may update any of the values available in the LearnerSchema which is posted. Any values you do not wish to alter, omit from the post. Depending on the field, providing something like an empty string may have unintended consequences. Lastly, it’s important to note that this method is asynchronous. A success status will be returned, and that signifies that a background process has been spun up to alter the learner’s info. As such, you may find a short period of delay in seeing the changes shown on all registrations.

Parameters:

  • learner_id

    The id of the learner to be updated

  • learner_info
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


313
314
315
316
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 313

def update_learner_info(learner_id, learner_info, opts = {})
  update_learner_info_with_http_info(learner_id, learner_info, opts)
  nil
end

#update_learner_info_with_http_info(learner_id, learner_info, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update a learner&#39;s info on all of their registrations. A learner in SCORM Cloud is not an entity on its own. In fact, learners only exist as information on individual registrations. This method will update the information on each of the registrations that the provided &#x60;learnerId&#x60; is attached to. You may update any of the values available in the LearnerSchema which is posted. Any values you do not wish to alter, omit from the post. Depending on the field, providing something like an empty string may have unintended consequences. Lastly, it&#39;s important to note that this method is asynchronous. A success status will be returned, and that signifies that a background process has been spun up to alter the learner&#39;s info. As such, you may find a short period of delay in seeing the changes shown on all registrations.

Parameters:

  • learner_id

    The id of the learner to be updated

  • learner_info
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (Array<(nil, Fixnum, Hash)>)

    nil, response status code and response headers



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 324

def update_learner_info_with_http_info(learner_id, learner_info, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: LearnerApi.update_learner_info ...'
  end
  # verify the required parameter 'learner_id' is set
  if @api_client.config.client_side_validation && learner_id.nil?
    fail ArgumentError, "Missing the required parameter 'learner_id' when calling LearnerApi.update_learner_info"
  end
  # verify the required parameter 'learner_info' is set
  if @api_client.config.client_side_validation && learner_info.nil?
    fail ArgumentError, "Missing the required parameter 'learner_info' when calling LearnerApi.update_learner_info"
  end
  # resource path
  local_var_path = '/learner/{learnerId}/updateInfo'.sub('{' + 'learnerId' + '}', learner_id.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(learner_info)
  auth_names = ['APP_NORMAL', 'OAUTH']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: LearnerApi#update_learner_info\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end