Class: RusticiSoftwareCloudV2::LearnerApi

Inherits:
Object
  • Object
show all
Extended by:
Gem::Deprecate
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.



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

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

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



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

def api_client
  @api_client
end

Instance Method Details

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

Deletes all PII for a learnerId Deletes all of the PII information for the learner. This is meant for use with complying with GDPR requests from learners. >Note: >This method is asynchronous. A returned success status indicates a background process has been started, but there will still be a delay before the deletion of PII information takes place.

Parameters:

  • learner_id

    The id of the learner

  • 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)


30
31
32
33
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 30

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 PII for a learnerId Deletes all of the PII information for the learner. This is meant for use with complying with GDPR requests from learners. &gt;Note: &gt;This method is asynchronous. A returned success status indicates a background process has been started, but there will still be a delay before the deletion of PII information takes place.

Parameters:

  • learner_id

    The id of the learner

  • 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



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
82
83
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 41

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 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 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 tags from a learnerId Delete the specified tags from the learner. Deleting tags that do not exist will still result in a success.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:

  • (nil)


91
92
93
94
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 91

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 tags from a learnerId Delete the specified tags from the learner. Deleting tags that do not exist will still result in a success.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
141
142
143
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 102

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 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 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 tags for a learnerId Returns the tags for the learner.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:



150
151
152
153
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 150

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 tags for a learnerId Returns the tags for the learner.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:

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

    TagListSchema data, response status code and response headers



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
195
196
197
198
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 160

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 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

Add tags to a learnerId Applies the provided tags to the learner. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:

  • (nil)


206
207
208
209
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 206

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

Add a group of tags to a group of learnerIds Applies all of the provided tags on all of the provided learners. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage.

Parameters:

  • batch

    Array of ids, and array of tags for bulk tag operations

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

    the optional parameters

Returns:

  • (nil)


265
266
267
268
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 265

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)>

Add a group of tags to a group of learnerIds Applies all of the provided tags on all of the provided learners. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage.

Parameters:

  • batch

    Array of ids, and array of tags for bulk tag operations

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
307
308
309
310
311
312
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 275

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 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)>

Add tags to a learnerId Applies the provided tags to the learner. Tags are used to easily identify resources. Adding tags can enable more refined searches when working with Reportage.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
254
255
256
257
258
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 217

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 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 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 all Registrations for a learnerId Updates information about a group of registrations, such as learner email and name. 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. >Caution: >Providing an empty string will cause the value in SCORM Cloud to be set to empty. This may have unintended consequences with regards to functionality. >Note: >This method is asynchronous. A returned success status indicates a background process has been started, but there will still be a delay before the changes on the registrations take place.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:

  • (nil)


320
321
322
323
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 320

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 all Registrations for a learnerId Updates information about a group of registrations, such as learner email and name. 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. &gt;Caution: &gt;Providing an empty string will cause the value in SCORM Cloud to be set to empty. This may have unintended consequences with regards to functionality. &gt;Note: &gt;This method is asynchronous. A returned success status indicates a background process has been started, but there will still be a delay before the changes on the registrations take place.

Parameters:

  • learner_id

    The id of the learner

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



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
366
367
368
369
370
371
372
# File 'lib/rustici_software_cloud_v2/api/learner_api.rb', line 331

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 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 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