Class: RusticiSoftwareCloudV2::ApplicationManagementApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ApplicationManagementApi

Returns a new instance of ApplicationManagementApi.



19
20
21
# File 'lib/rustici_software_cloud_v2/api/application_management_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/application_management_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_application(application_name, opts = {}) ⇒ ApplicationSchema

A call to this method will create a new application and return a basic object describing it.

Parameters:

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

    the optional parameters

Returns:



26
27
28
29
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 26

def create_application(application_name, opts = {})
  data, _status_code, _headers = create_application_with_http_info(application_name, opts)
  data
end

#create_application_with_http_info(application_name, opts = {}) ⇒ Array<(ApplicationSchema, Fixnum, Hash)>

A call to this method will create a new application and return a basic object describing it.

Parameters:

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

    the optional parameters

Returns:

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

    ApplicationSchema data, response status code and response headers



35
36
37
38
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
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 35

def create_application_with_http_info(application_name, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.create_application ...'
  end
  # verify the required parameter 'application_name' is set
  if @api_client.config.client_side_validation && application_name.nil?
    fail ArgumentError, "Missing the required parameter 'application_name' when calling ApplicationManagementApi.create_application"
  end
  # resource path
  local_var_path = '/appManagement/applications'

  # 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(application_name)
  auth_names = ['APP_MANAGEMENT', '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,
    :return_type => 'ApplicationSchema')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApplicationManagementApi#create_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_credential(child_app_id, credential_request, opts = {}) ⇒ CredentialCreatedSchema

Create a new credential (aka secret key) for use with the ‘childAppId`.

Parameters:

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

    the optional parameters

Returns:



79
80
81
82
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 79

def create_credential(child_app_id, credential_request, opts = {})
  data, _status_code, _headers = create_credential_with_http_info(child_app_id, credential_request, opts)
  data
end

#create_credential_with_http_info(child_app_id, credential_request, opts = {}) ⇒ Array<(CredentialCreatedSchema, Fixnum, Hash)>

Create a new credential (aka secret key) for use with the &#x60;childAppId&#x60;.

Parameters:

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

    the optional parameters

Returns:

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

    CredentialCreatedSchema data, response status code and response headers



89
90
91
92
93
94
95
96
97
98
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
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 89

def create_credential_with_http_info(child_app_id, credential_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.create_credential ...'
  end
  # verify the required parameter 'child_app_id' is set
  if @api_client.config.client_side_validation && child_app_id.nil?
    fail ArgumentError, "Missing the required parameter 'child_app_id' when calling ApplicationManagementApi.create_credential"
  end
  # verify the required parameter 'credential_request' is set
  if @api_client.config.client_side_validation && credential_request.nil?
    fail ArgumentError, "Missing the required parameter 'credential_request' when calling ApplicationManagementApi.create_credential"
  end
  # resource path
  local_var_path = '/appManagement/{childAppId}/credentials'.sub('{' + 'childAppId' + '}', child_app_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(credential_request)
  auth_names = ['APP_MANAGEMENT', '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,
    :return_type => 'CredentialCreatedSchema')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApplicationManagementApi#create_credential\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#create_token(token_request, opts = {}) ⇒ StringResultSchema

Creates, signs and returns an OAuth2 token based on the provided permissions, if the credentials used to request the token have the permissions being requested. Note: the token is not stored and therefore can not be modified or deleted. The requested permissions are encoded in the token which is then signed. As long as the secret used to create it is not changed the token will be valid until it expires.

Parameters:

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

    the optional parameters

Returns:



136
137
138
139
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 136

def create_token(token_request, opts = {})
  data, _status_code, _headers = create_token_with_http_info(token_request, opts)
  data
end

#create_token_with_http_info(token_request, opts = {}) ⇒ Array<(StringResultSchema, Fixnum, Hash)>

Creates, signs and returns an OAuth2 token based on the provided permissions, if the credentials used to request the token have the permissions being requested. Note: the token is not stored and therefore can not be modified or deleted. The requested permissions are encoded in the token which is then signed. As long as the secret used to create it is not changed the token will be valid until it expires.

Parameters:

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

    the optional parameters

Returns:

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

    StringResultSchema data, response status code and response headers



145
146
147
148
149
150
151
152
153
154
155
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
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 145

def create_token_with_http_info(token_request, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.create_token ...'
  end
  # verify the required parameter 'token_request' is set
  if @api_client.config.client_side_validation && token_request.nil?
    fail ArgumentError, "Missing the required parameter 'token_request' when calling ApplicationManagementApi.create_token"
  end
  # resource path
  local_var_path = '/appManagement/token'

  # 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(token_request)
  auth_names = ['APP_NORMAL']
  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,
    :return_type => 'StringResultSchema')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApplicationManagementApi#create_token\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_application(child_app_id, opts = {}) ⇒ nil

Delete an application. If the application contains content, it must first be manually removed before calling this method, else an error will be thrown.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


188
189
190
191
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 188

def delete_application(child_app_id, opts = {})
  delete_application_with_http_info(child_app_id, opts)
  nil
end

#delete_application_configuration_setting(setting_id, opts = {}) ⇒ nil

Clears the ‘settingId` value for this level Clears the setting value at this level. This is effectively reverting the setting to the system level default.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :learning_standard (String)

    If specified, the request will be scoped to the provided learning standard.

  • :single_sco (BOOLEAN)

    Required if learningStandard is specified. Scopes settings to whether a package has only one SCO or assignable unit within it or not. To apply a configuration setting to a learning standard for single and multi-SCO content, it must be set for both scopes.

Returns:

  • (nil)


242
243
244
245
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 242

def delete_application_configuration_setting(setting_id, opts = {})
  delete_application_configuration_setting_with_http_info(setting_id, opts)
  nil
end

#delete_application_configuration_setting_with_http_info(setting_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Clears the &#x60;settingId&#x60; value for this level Clears the setting value at this level. This is effectively reverting the setting to the system level default.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :learning_standard (String)

    If specified, the request will be scoped to the provided learning standard.

  • :single_sco (BOOLEAN)

    Required if learningStandard is specified. Scopes settings to whether a package has only one SCO or assignable unit within it or not. To apply a configuration setting to a learning standard for single and multi-SCO content, it must be set for both scopes.

Returns:

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

    nil, response status code and response headers



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
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
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 254

def delete_application_configuration_setting_with_http_info(setting_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.delete_application_configuration_setting ...'
  end
  # verify the required parameter 'setting_id' is set
  if @api_client.config.client_side_validation && setting_id.nil?
    fail ArgumentError, "Missing the required parameter 'setting_id' when calling ApplicationManagementApi.delete_application_configuration_setting"
  end
  if @api_client.config.client_side_validation && opts[:'learning_standard'] && !['SCORM_11', 'SCORM_12', 'SCORM_2004_2ND_EDITION', 'SCORM_2004_3RD_EDITION', 'SCORM_2004_4TH_EDITION', 'AICC', 'XAPI', 'CMI5'].include?(opts[:'learning_standard'])
    fail ArgumentError, 'invalid value for "learning_standard", must be one of SCORM_11, SCORM_12, SCORM_2004_2ND_EDITION, SCORM_2004_3RD_EDITION, SCORM_2004_4TH_EDITION, AICC, XAPI, CMI5'
  end
  # resource path
  local_var_path = '/appManagement/configuration/{settingId}'.sub('{' + 'settingId' + '}', setting_id.to_s)

  # query parameters
  query_params = {}
  query_params[:'learningStandard'] = opts[:'learning_standard'] if !opts[:'learning_standard'].nil?
  query_params[:'singleSco'] = opts[:'single_sco'] if !opts[:'single_sco'].nil?

  # 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(: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: ApplicationManagementApi#delete_application_configuration_setting\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_application_with_http_info(child_app_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete an application. If the application contains content, it must first be manually removed before calling this method, else an error will be thrown.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 197

def delete_application_with_http_info(child_app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.delete_application ...'
  end
  # verify the required parameter 'child_app_id' is set
  if @api_client.config.client_side_validation && child_app_id.nil?
    fail ArgumentError, "Missing the required parameter 'child_app_id' when calling ApplicationManagementApi.delete_application"
  end
  # resource path
  local_var_path = '/appManagement/applications/{childAppId}'.sub('{' + 'childAppId' + '}', child_app_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_MANAGEMENT', '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: ApplicationManagementApi#delete_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#delete_credential(child_app_id, credential_id, opts = {}) ⇒ nil

Delete ‘credentialId` from the system. Note: if an application’s last secret key is deleted it will not be able to use the SCORM Cloud api until another key is granted to it via ‘CreateCredential`. Removing the last secret key may also disable some priviledges in the website.

Parameters:

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

    the optional parameters

Returns:

  • (nil)


302
303
304
305
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 302

def delete_credential(child_app_id, credential_id, opts = {})
  delete_credential_with_http_info(child_app_id, credential_id, opts)
  nil
end

#delete_credential_with_http_info(child_app_id, credential_id, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Delete &#x60;credentialId&#x60; from the system. Note: if an application&#39;s last secret key is deleted it will not be able to use the SCORM Cloud api until another key is granted to it via &#x60;CreateCredential&#x60;. Removing the last secret key may also disable some priviledges in the website.

Parameters:

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

    the optional parameters

Returns:

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

    nil, response status code and response headers



312
313
314
315
316
317
318
319
320
321
322
323
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
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 312

def delete_credential_with_http_info(child_app_id, credential_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.delete_credential ...'
  end
  # verify the required parameter 'child_app_id' is set
  if @api_client.config.client_side_validation && child_app_id.nil?
    fail ArgumentError, "Missing the required parameter 'child_app_id' when calling ApplicationManagementApi.delete_credential"
  end
  # verify the required parameter 'credential_id' is set
  if @api_client.config.client_side_validation && credential_id.nil?
    fail ArgumentError, "Missing the required parameter 'credential_id' when calling ApplicationManagementApi.delete_credential"
  end
  # resource path
  local_var_path = '/appManagement/{childAppId}/credentials/{credentialId}'.sub('{' + 'childAppId' + '}', child_app_id.to_s).sub('{' + 'credentialId' + '}', credential_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_MANAGEMENT', '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: ApplicationManagementApi#delete_credential\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_application_configuration(opts = {}) ⇒ SettingListSchema

Returns all configuration settings for this level. These settings will only affect items within this application which do not have that setting themselves. >Note —– >This resource actually represents 2 distinct levels which are: >- ALL content in an application. This is achieved by leaving ‘learningStandard` and `singleSco` as `null`. Anything set at the learningStandard/singleSco level will take precedence over these settings. - Content falling into a learningStandard/singleSco category. This allows setting more specific defaults for a particular learningStandard/singleSco combination. Note: both `learningStandard` and `singleSco` must be provided, as this level is considered to be identified by those items joined.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :learning_standard (String)

    If specified, the request will be scoped to the provided learning standard.

  • :single_sco (BOOLEAN)

    Required if learningStandard is specified. Scopes settings to whether a package has only one SCO or assignable unit within it or not. To apply a configuration setting to a learning standard for single and multi-SCO content, it must be set for both scopes.

  • :include_metadata (BOOLEAN) — default: default to false

Returns:



360
361
362
363
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 360

def get_application_configuration(opts = {})
  data, _status_code, _headers = get_application_configuration_with_http_info(opts)
  data
end

#get_application_configuration_with_http_info(opts = {}) ⇒ Array<(SettingListSchema, Fixnum, Hash)>

Returns all configuration settings for this level. These settings will only affect items within this application which do not have that setting themselves. &gt;Note —– &gt;This resource actually represents 2 distinct levels which are: &gt;- ALL content in an application. This is achieved by leaving &#x60;learningStandard&#x60; and &#x60;singleSco&#x60; as &#x60;null&#x60;. Anything set at the learningStandard/singleSco level will take precedence over these settings. - Content falling into a learningStandard/singleSco category. This allows setting more specific defaults for a particular learningStandard/singleSco combination. Note: both &#x60;learningStandard&#x60; and &#x60;singleSco&#x60; must be provided, as this level is considered to be identified by those items joined.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :learning_standard (String)

    If specified, the request will be scoped to the provided learning standard.

  • :single_sco (BOOLEAN)

    Required if learningStandard is specified. Scopes settings to whether a package has only one SCO or assignable unit within it or not. To apply a configuration setting to a learning standard for single and multi-SCO content, it must be set for both scopes.

  • :include_metadata (BOOLEAN)

Returns:

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

    SettingListSchema data, response status code and response headers



371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 371

def get_application_configuration_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.get_application_configuration ...'
  end
  if @api_client.config.client_side_validation && opts[:'learning_standard'] && !['SCORM_11', 'SCORM_12', 'SCORM_2004_2ND_EDITION', 'SCORM_2004_3RD_EDITION', 'SCORM_2004_4TH_EDITION', 'AICC', 'XAPI', 'CMI5'].include?(opts[:'learning_standard'])
    fail ArgumentError, 'invalid value for "learning_standard", must be one of SCORM_11, SCORM_12, SCORM_2004_2ND_EDITION, SCORM_2004_3RD_EDITION, SCORM_2004_4TH_EDITION, AICC, XAPI, CMI5'
  end
  # resource path
  local_var_path = '/appManagement/configuration'

  # query parameters
  query_params = {}
  query_params[:'learningStandard'] = opts[:'learning_standard'] if !opts[:'learning_standard'].nil?
  query_params[:'singleSco'] = opts[:'single_sco'] if !opts[:'single_sco'].nil?
  query_params[:'includeMetadata'] = opts[:'include_metadata'] if !opts[:'include_metadata'].nil?

  # 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 => 'SettingListSchema')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApplicationManagementApi#get_application_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_application_list(opts = {}) ⇒ ApplicationListSchema

Get a list of all applications for the realm. Get list of all applications in this realm.

Parameters:

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

    the optional parameters

Returns:



416
417
418
419
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 416

def get_application_list(opts = {})
  data, _status_code, _headers = get_application_list_with_http_info(opts)
  data
end

#get_application_list_with_http_info(opts = {}) ⇒ Array<(ApplicationListSchema, Fixnum, Hash)>

Get a list of all applications for the realm. Get list of all applications in this realm.

Parameters:

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

    the optional parameters

Returns:

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

    ApplicationListSchema data, response status code and response headers



425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 425

def get_application_list_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.get_application_list ...'
  end
  # resource path
  local_var_path = '/appManagement/applications'

  # 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_MANAGEMENT', '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 => 'ApplicationListSchema')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApplicationManagementApi#get_application_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_credentials(child_app_id, opts = {}) ⇒ CredentialListSchema

Retrieve a list of all credentials (aka secret keys) belonging to ‘childAppId` and their statuses.

Parameters:

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

    the optional parameters

Returns:



464
465
466
467
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 464

def get_credentials(child_app_id, opts = {})
  data, _status_code, _headers = get_credentials_with_http_info(child_app_id, opts)
  data
end

#get_credentials_with_http_info(child_app_id, opts = {}) ⇒ Array<(CredentialListSchema, Fixnum, Hash)>

Retrieve a list of all credentials (aka secret keys) belonging to &#x60;childAppId&#x60; and their statuses.

Parameters:

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

    the optional parameters

Returns:

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

    CredentialListSchema data, response status code and response headers



473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 473

def get_credentials_with_http_info(child_app_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.get_credentials ...'
  end
  # verify the required parameter 'child_app_id' is set
  if @api_client.config.client_side_validation && child_app_id.nil?
    fail ArgumentError, "Missing the required parameter 'child_app_id' when calling ApplicationManagementApi.get_credentials"
  end
  # resource path
  local_var_path = '/appManagement/{childAppId}/credentials'.sub('{' + 'childAppId' + '}', child_app_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_MANAGEMENT', '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 => 'CredentialListSchema')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ApplicationManagementApi#get_credentials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#set_application_configuration(configuration_settings, opts = {}) ⇒ nil

Set configuration settings for the application level. These settings will only affect items within the application which do not have their own configuration set. This can be used to effectively set application level defaults.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :learning_standard (String)

    If specified, the request will be scoped to the provided learning standard.

  • :single_sco (BOOLEAN)

    Required if learningStandard is specified. Scopes settings to whether a package has only one SCO or assignable unit within it or not. To apply a configuration setting to a learning standard for single and multi-SCO content, it must be set for both scopes.

Returns:

  • (nil)


518
519
520
521
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 518

def set_application_configuration(configuration_settings, opts = {})
  set_application_configuration_with_http_info(configuration_settings, opts)
  nil
end

#set_application_configuration_with_http_info(configuration_settings, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Set configuration settings for the application level. These settings will only affect items within the application which do not have their own configuration set. This can be used to effectively set application level defaults.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :learning_standard (String)

    If specified, the request will be scoped to the provided learning standard.

  • :single_sco (BOOLEAN)

    Required if learningStandard is specified. Scopes settings to whether a package has only one SCO or assignable unit within it or not. To apply a configuration setting to a learning standard for single and multi-SCO content, it must be set for both scopes.

Returns:

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

    nil, response status code and response headers



529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 529

def set_application_configuration_with_http_info(configuration_settings, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.set_application_configuration ...'
  end
  # verify the required parameter 'configuration_settings' is set
  if @api_client.config.client_side_validation && configuration_settings.nil?
    fail ArgumentError, "Missing the required parameter 'configuration_settings' when calling ApplicationManagementApi.set_application_configuration"
  end
  if @api_client.config.client_side_validation && opts[:'learning_standard'] && !['SCORM_11', 'SCORM_12', 'SCORM_2004_2ND_EDITION', 'SCORM_2004_3RD_EDITION', 'SCORM_2004_4TH_EDITION', 'AICC', 'XAPI', 'CMI5'].include?(opts[:'learning_standard'])
    fail ArgumentError, 'invalid value for "learning_standard", must be one of SCORM_11, SCORM_12, SCORM_2004_2ND_EDITION, SCORM_2004_3RD_EDITION, SCORM_2004_4TH_EDITION, AICC, XAPI, CMI5'
  end
  # resource path
  local_var_path = '/appManagement/configuration'

  # query parameters
  query_params = {}
  query_params[:'learningStandard'] = opts[:'learning_standard'] if !opts[:'learning_standard'].nil?
  query_params[:'singleSco'] = opts[:'single_sco'] if !opts[:'single_sco'].nil?

  # 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(configuration_settings)
  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: ApplicationManagementApi#set_application_configuration\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#update_credential(child_app_id, credential_id, credential_update, opts = {}) ⇒ nil

Update the name or status associated with ‘credentialId`. If the status is updated to disabled, the credential will no longer be valid for authorization through the API. If the last (or only) key for an application is disabled it may affect some website priviledges

Parameters:

  • child_app_id
  • credential_id
  • credential_update
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

  • (nil)


578
579
580
581
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 578

def update_credential(child_app_id, credential_id, credential_update, opts = {})
  update_credential_with_http_info(child_app_id, credential_id, credential_update, opts)
  nil
end

#update_credential_with_http_info(child_app_id, credential_id, credential_update, opts = {}) ⇒ Array<(nil, Fixnum, Hash)>

Update the name or status associated with &#x60;credentialId&#x60;. If the status is updated to disabled, the credential will no longer be valid for authorization through the API. If the last (or only) key for an application is disabled it may affect some website priviledges

Parameters:

  • child_app_id
  • credential_id
  • credential_update
  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:

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

    nil, response status code and response headers



589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
# File 'lib/rustici_software_cloud_v2/api/application_management_api.rb', line 589

def update_credential_with_http_info(child_app_id, credential_id, credential_update, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: ApplicationManagementApi.update_credential ...'
  end
  # verify the required parameter 'child_app_id' is set
  if @api_client.config.client_side_validation && child_app_id.nil?
    fail ArgumentError, "Missing the required parameter 'child_app_id' when calling ApplicationManagementApi.update_credential"
  end
  # verify the required parameter 'credential_id' is set
  if @api_client.config.client_side_validation && credential_id.nil?
    fail ArgumentError, "Missing the required parameter 'credential_id' when calling ApplicationManagementApi.update_credential"
  end
  # verify the required parameter 'credential_update' is set
  if @api_client.config.client_side_validation && credential_update.nil?
    fail ArgumentError, "Missing the required parameter 'credential_update' when calling ApplicationManagementApi.update_credential"
  end
  # resource path
  local_var_path = '/appManagement/{childAppId}/credentials/{credentialId}'.sub('{' + 'childAppId' + '}', child_app_id.to_s).sub('{' + 'credentialId' + '}', credential_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(credential_update)
  auth_names = ['APP_MANAGEMENT', '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: ApplicationManagementApi#update_credential\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end