rustici_software_cloud_v2 1.0.0beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. data/Gemfile +7 -0
  2. data/LICENSE +201 -0
  3. data/README.md +283 -0
  4. data/Rakefile +8 -0
  5. data/docs/ActivityResultSchema.md +20 -0
  6. data/docs/ApplicationListSchema.md +8 -0
  7. data/docs/ApplicationManagementApi.md +570 -0
  8. data/docs/ApplicationSchema.md +9 -0
  9. data/docs/ApplicationToken.md +10 -0
  10. data/docs/AuthenticationApi.md +64 -0
  11. data/docs/CommentSchema.md +10 -0
  12. data/docs/CompletionAmountSchema.md +8 -0
  13. data/docs/CourseActivitySchema.md +15 -0
  14. data/docs/CourseApi.md +1459 -0
  15. data/docs/CourseListNonPagedSchema.md +8 -0
  16. data/docs/CourseListSchema.md +9 -0
  17. data/docs/CourseReferenceSchema.md +10 -0
  18. data/docs/CourseSchema.md +20 -0
  19. data/docs/CourseTagsBatchSchema.md +9 -0
  20. data/docs/CreateRegistrationSchema.md +17 -0
  21. data/docs/CredentialCreatedSchema.md +12 -0
  22. data/docs/CredentialListSchema.md +8 -0
  23. data/docs/CredentialRequestSchema.md +9 -0
  24. data/docs/CredentialSchema.md +12 -0
  25. data/docs/ImportFetchRequestSchema.md +8 -0
  26. data/docs/ImportJobResultSchema.md +11 -0
  27. data/docs/ImportResultSchema.md +11 -0
  28. data/docs/IntegerResultSchema.md +8 -0
  29. data/docs/ItemValuePairSchema.md +9 -0
  30. data/docs/LaunchHistoryListSchema.md +8 -0
  31. data/docs/LaunchHistorySchema.md +17 -0
  32. data/docs/LaunchLinkRequestSchema.md +17 -0
  33. data/docs/LaunchLinkSchema.md +8 -0
  34. data/docs/LearnerPreferenceSchema.md +11 -0
  35. data/docs/LearnerSchema.md +11 -0
  36. data/docs/LinkSchema.md +8 -0
  37. data/docs/MessageSchema.md +8 -0
  38. data/docs/MetadataSchema.md +14 -0
  39. data/docs/ObjectiveSchema.md +20 -0
  40. data/docs/PermissionsSchema.md +9 -0
  41. data/docs/PingApi.md +57 -0
  42. data/docs/PingSchema.md +8 -0
  43. data/docs/PostBackSchema.md +12 -0
  44. data/docs/RegistrationApi.md +1490 -0
  45. data/docs/RegistrationCompletion.md +7 -0
  46. data/docs/RegistrationListSchema.md +9 -0
  47. data/docs/RegistrationSchema.md +27 -0
  48. data/docs/RegistrationSuccess.md +7 -0
  49. data/docs/RegistrationTagsBatchSchema.md +9 -0
  50. data/docs/ResponseError.md +8 -0
  51. data/docs/RuntimeInteractionSchema.md +18 -0
  52. data/docs/RuntimeObjectiveSchema.md +16 -0
  53. data/docs/RuntimeSchema.md +27 -0
  54. data/docs/ScoreSchema.md +8 -0
  55. data/docs/SettingItem.md +12 -0
  56. data/docs/SettingListSchema.md +8 -0
  57. data/docs/SettingMetadata.md +15 -0
  58. data/docs/SettingMetadataValidValues.md +9 -0
  59. data/docs/SettingValidValue.md +9 -0
  60. data/docs/SettingsIndividualSchema.md +10 -0
  61. data/docs/SettingsPostSchema.md +8 -0
  62. data/docs/SharedDataEntrySchema.md +9 -0
  63. data/docs/StaticPropertiesSchema.md +13 -0
  64. data/docs/StringResultSchema.md +8 -0
  65. data/docs/TagListSchema.md +8 -0
  66. data/docs/TagPostSchema.md +7 -0
  67. data/docs/TitleSchema.md +8 -0
  68. data/docs/TokenRequestSchema.md +9 -0
  69. data/docs/XapiAccount.md +9 -0
  70. data/docs/XapiActivity.md +10 -0
  71. data/docs/XapiActivityDefinition.md +19 -0
  72. data/docs/XapiAgentGroup.md +14 -0
  73. data/docs/XapiAttachment.md +14 -0
  74. data/docs/XapiContext.md +16 -0
  75. data/docs/XapiContextActivity.md +11 -0
  76. data/docs/XapiInteractionComponent.md +9 -0
  77. data/docs/XapiResult.md +13 -0
  78. data/docs/XapiScore.md +11 -0
  79. data/docs/XapiStatement.md +20 -0
  80. data/docs/XapiStatementReference.md +9 -0
  81. data/docs/XapiStatementResult.md +9 -0
  82. data/docs/XapiVerb.md +9 -0
  83. data/git_push.sh +55 -0
  84. data/lib/rustici_software_cloud_v2.rb +116 -0
  85. data/lib/rustici_software_cloud_v2/api/application_management_api.rb +574 -0
  86. data/lib/rustici_software_cloud_v2/api/authentication_api.rb +87 -0
  87. data/lib/rustici_software_cloud_v2/api/course_api.rb +1469 -0
  88. data/lib/rustici_software_cloud_v2/api/ping_api.rb +69 -0
  89. data/lib/rustici_software_cloud_v2/api/registration_api.rb +1499 -0
  90. data/lib/rustici_software_cloud_v2/api_client.rb +389 -0
  91. data/lib/rustici_software_cloud_v2/api_error.rb +38 -0
  92. data/lib/rustici_software_cloud_v2/configuration.rb +237 -0
  93. data/lib/rustici_software_cloud_v2/models/activity_result_schema.rb +341 -0
  94. data/lib/rustici_software_cloud_v2/models/application_list_schema.rb +185 -0
  95. data/lib/rustici_software_cloud_v2/models/application_schema.rb +194 -0
  96. data/lib/rustici_software_cloud_v2/models/application_token.rb +201 -0
  97. data/lib/rustici_software_cloud_v2/models/comment_schema.rb +201 -0
  98. data/lib/rustici_software_cloud_v2/models/completion_amount_schema.rb +184 -0
  99. data/lib/rustici_software_cloud_v2/models/course_activity_schema.rb +289 -0
  100. data/lib/rustici_software_cloud_v2/models/course_list_non_paged_schema.rb +185 -0
  101. data/lib/rustici_software_cloud_v2/models/course_list_schema.rb +194 -0
  102. data/lib/rustici_software_cloud_v2/models/course_reference_schema.rb +202 -0
  103. data/lib/rustici_software_cloud_v2/models/course_schema.rb +328 -0
  104. data/lib/rustici_software_cloud_v2/models/course_tags_batch_schema.rb +204 -0
  105. data/lib/rustici_software_cloud_v2/models/create_registration_schema.rb +287 -0
  106. data/lib/rustici_software_cloud_v2/models/credential_created_schema.rb +223 -0
  107. data/lib/rustici_software_cloud_v2/models/credential_list_schema.rb +185 -0
  108. data/lib/rustici_software_cloud_v2/models/credential_request_schema.rb +194 -0
  109. data/lib/rustici_software_cloud_v2/models/credential_schema.rb +223 -0
  110. data/lib/rustici_software_cloud_v2/models/import_fetch_request_schema.rb +190 -0
  111. data/lib/rustici_software_cloud_v2/models/import_job_result_schema.rb +244 -0
  112. data/lib/rustici_software_cloud_v2/models/import_result_schema.rb +215 -0
  113. data/lib/rustici_software_cloud_v2/models/integer_result_schema.rb +188 -0
  114. data/lib/rustici_software_cloud_v2/models/item_value_pair_schema.rb +192 -0
  115. data/lib/rustici_software_cloud_v2/models/launch_history_list_schema.rb +185 -0
  116. data/lib/rustici_software_cloud_v2/models/launch_history_schema.rb +317 -0
  117. data/lib/rustici_software_cloud_v2/models/launch_link_request_schema.rb +282 -0
  118. data/lib/rustici_software_cloud_v2/models/launch_link_schema.rb +188 -0
  119. data/lib/rustici_software_cloud_v2/models/learner_preference_schema.rb +210 -0
  120. data/lib/rustici_software_cloud_v2/models/learner_schema.rb +216 -0
  121. data/lib/rustici_software_cloud_v2/models/link_schema.rb +188 -0
  122. data/lib/rustici_software_cloud_v2/models/message_schema.rb +188 -0
  123. data/lib/rustici_software_cloud_v2/models/metadata_schema.rb +239 -0
  124. data/lib/rustici_software_cloud_v2/models/objective_schema.rb +355 -0
  125. data/lib/rustici_software_cloud_v2/models/permissions_schema.rb +195 -0
  126. data/lib/rustici_software_cloud_v2/models/ping_schema.rb +188 -0
  127. data/lib/rustici_software_cloud_v2/models/post_back_schema.rb +273 -0
  128. data/lib/rustici_software_cloud_v2/models/registration_completion.rb +31 -0
  129. data/lib/rustici_software_cloud_v2/models/registration_list_schema.rb +199 -0
  130. data/lib/rustici_software_cloud_v2/models/registration_schema.rb +360 -0
  131. data/lib/rustici_software_cloud_v2/models/registration_success.rb +31 -0
  132. data/lib/rustici_software_cloud_v2/models/registration_tags_batch_schema.rb +204 -0
  133. data/lib/rustici_software_cloud_v2/models/response_error.rb +188 -0
  134. data/lib/rustici_software_cloud_v2/models/runtime_interaction_schema.rb +311 -0
  135. data/lib/rustici_software_cloud_v2/models/runtime_objective_schema.rb +305 -0
  136. data/lib/rustici_software_cloud_v2/models/runtime_schema.rb +398 -0
  137. data/lib/rustici_software_cloud_v2/models/score_schema.rb +184 -0
  138. data/lib/rustici_software_cloud_v2/models/setting_item.rb +256 -0
  139. data/lib/rustici_software_cloud_v2/models/setting_list_schema.rb +190 -0
  140. data/lib/rustici_software_cloud_v2/models/setting_metadata.rb +294 -0
  141. data/lib/rustici_software_cloud_v2/models/setting_metadata_valid_values.rb +209 -0
  142. data/lib/rustici_software_cloud_v2/models/setting_valid_value.rb +193 -0
  143. data/lib/rustici_software_cloud_v2/models/settings_individual_schema.rb +203 -0
  144. data/lib/rustici_software_cloud_v2/models/settings_post_schema.rb +185 -0
  145. data/lib/rustici_software_cloud_v2/models/shared_data_entry_schema.rb +192 -0
  146. data/lib/rustici_software_cloud_v2/models/static_properties_schema.rb +228 -0
  147. data/lib/rustici_software_cloud_v2/models/string_result_schema.rb +188 -0
  148. data/lib/rustici_software_cloud_v2/models/tag_list_schema.rb +185 -0
  149. data/lib/rustici_software_cloud_v2/models/tag_post_schema.rb +174 -0
  150. data/lib/rustici_software_cloud_v2/models/title_schema.rb +183 -0
  151. data/lib/rustici_software_cloud_v2/models/token_request_schema.rb +203 -0
  152. data/lib/rustici_software_cloud_v2/models/xapi_account.rb +203 -0
  153. data/lib/rustici_software_cloud_v2/models/xapi_activity.rb +209 -0
  154. data/lib/rustici_software_cloud_v2/models/xapi_activity_definition.rb +301 -0
  155. data/lib/rustici_software_cloud_v2/models/xapi_agent_group.rb +279 -0
  156. data/lib/rustici_software_cloud_v2/models/xapi_attachment.rb +267 -0
  157. data/lib/rustici_software_cloud_v2/models/xapi_context.rb +258 -0
  158. data/lib/rustici_software_cloud_v2/models/xapi_context_activity.rb +219 -0
  159. data/lib/rustici_software_cloud_v2/models/xapi_interaction_component.rb +200 -0
  160. data/lib/rustici_software_cloud_v2/models/xapi_result.rb +231 -0
  161. data/lib/rustici_software_cloud_v2/models/xapi_score.rb +211 -0
  162. data/lib/rustici_software_cloud_v2/models/xapi_statement.rb +294 -0
  163. data/lib/rustici_software_cloud_v2/models/xapi_statement_reference.rb +205 -0
  164. data/lib/rustici_software_cloud_v2/models/xapi_statement_result.rb +200 -0
  165. data/lib/rustici_software_cloud_v2/models/xapi_verb.rb +200 -0
  166. data/lib/rustici_software_cloud_v2/version.rb +15 -0
  167. data/rustici_software_cloud_v2.gemspec +45 -0
  168. data/spec/api_client_spec.rb +237 -0
  169. data/spec/configuration_spec.rb +42 -0
  170. data/spec/models/activity_result_schema_spec.rb +133 -0
  171. data/spec/models/application_list_schema_spec.rb +53 -0
  172. data/spec/models/application_schema_spec.rb +59 -0
  173. data/spec/models/application_token_spec.rb +65 -0
  174. data/spec/models/comment_schema_spec.rb +65 -0
  175. data/spec/models/completion_amount_schema_spec.rb +53 -0
  176. data/spec/models/course_activity_schema_spec.rb +99 -0
  177. data/spec/models/course_list_non_paged_schema_spec.rb +53 -0
  178. data/spec/models/course_list_schema_spec.rb +59 -0
  179. data/spec/models/course_reference_schema_spec.rb +65 -0
  180. data/spec/models/course_schema_spec.rb +129 -0
  181. data/spec/models/create_registration_schema_spec.rb +107 -0
  182. data/spec/models/credential_created_schema_spec.rb +77 -0
  183. data/spec/models/credential_list_schema_spec.rb +53 -0
  184. data/spec/models/credential_request_schema_spec.rb +59 -0
  185. data/spec/models/credential_schema_spec.rb +77 -0
  186. data/spec/models/import_fetch_request_schema_spec.rb +53 -0
  187. data/spec/models/import_job_result_schema_spec.rb +75 -0
  188. data/spec/models/import_result_schema_spec.rb +71 -0
  189. data/spec/models/integer_result_schema_spec.rb +53 -0
  190. data/spec/models/item_value_pair_schema_spec.rb +59 -0
  191. data/spec/models/launch_history_list_schema_spec.rb +53 -0
  192. data/spec/models/launch_history_schema_spec.rb +115 -0
  193. data/spec/models/launch_link_request_schema_spec.rb +107 -0
  194. data/spec/models/launch_link_schema_spec.rb +53 -0
  195. data/spec/models/learner_preference_schema_spec.rb +71 -0
  196. data/spec/models/learner_schema_spec.rb +71 -0
  197. data/spec/models/link_schema_spec.rb +53 -0
  198. data/spec/models/message_schema_spec.rb +53 -0
  199. data/spec/models/metadata_schema_spec.rb +89 -0
  200. data/spec/models/objective_schema_spec.rb +137 -0
  201. data/spec/models/permissions_schema_spec.rb +59 -0
  202. data/spec/models/ping_schema_spec.rb +53 -0
  203. data/spec/models/post_back_schema_spec.rb +85 -0
  204. data/spec/models/registration_completion_spec.rb +47 -0
  205. data/spec/models/registration_list_schema_spec.rb +59 -0
  206. data/spec/models/registration_schema_spec.rb +167 -0
  207. data/spec/models/registration_success_spec.rb +47 -0
  208. data/spec/models/response_error_spec.rb +53 -0
  209. data/spec/models/runtime_interaction_schema_spec.rb +117 -0
  210. data/spec/models/runtime_objective_schema_spec.rb +109 -0
  211. data/spec/models/runtime_schema_spec.rb +171 -0
  212. data/spec/models/score_schema_spec.rb +53 -0
  213. data/spec/models/setting_item_spec.rb +81 -0
  214. data/spec/models/setting_list_schema_spec.rb +53 -0
  215. data/spec/models/setting_metadata_spec.rb +99 -0
  216. data/spec/models/setting_metadata_valid_values_spec.rb +59 -0
  217. data/spec/models/settings_individual_schema_spec.rb +65 -0
  218. data/spec/models/settings_post_schema_spec.rb +53 -0
  219. data/spec/models/shared_data_entry_schema_spec.rb +59 -0
  220. data/spec/models/static_properties_schema_spec.rb +83 -0
  221. data/spec/models/string_result_schema_spec.rb +53 -0
  222. data/spec/models/title_schema_spec.rb +53 -0
  223. data/spec/models/token_request_schema_spec.rb +59 -0
  224. data/spec/spec_helper.rb +122 -0
  225. data/swagger-codegen.config +11 -0
  226. metadata +526 -0
@@ -0,0 +1,317 @@
1
+ =begin
2
+ #SCORM Cloud Rest API
3
+
4
+ #REST API used for SCORM Cloud integrations.
5
+
6
+ OpenAPI spec version: 2.0 beta
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module RusticiSoftwareCloudV2
16
+ class LaunchHistorySchema
17
+ attr_accessor :id
18
+
19
+ attr_accessor :instance
20
+
21
+ attr_accessor :score
22
+
23
+ attr_accessor :completion_status
24
+
25
+ attr_accessor :success_status
26
+
27
+ attr_accessor :history_log
28
+
29
+ attr_accessor :total_seconds_tracked
30
+
31
+ # The time of the launch in UTC
32
+ attr_accessor :launch_time
33
+
34
+ # The time of the exit in UTC
35
+ attr_accessor :exit_time
36
+
37
+ # The time of the last runtime update in UTC
38
+ attr_accessor :last_runtime_update
39
+
40
+ class EnumAttributeValidator
41
+ attr_reader :datatype
42
+ attr_reader :allowable_values
43
+
44
+ def initialize(datatype, allowable_values)
45
+ @allowable_values = allowable_values.map do |value|
46
+ case datatype.to_s
47
+ when /Integer/i
48
+ value.to_i
49
+ when /Float/i
50
+ value.to_f
51
+ else
52
+ value
53
+ end
54
+ end
55
+ end
56
+
57
+ def valid?(value)
58
+ !value || allowable_values.include?(value)
59
+ end
60
+ end
61
+
62
+ # Attribute mapping from ruby-style variable name to JSON key.
63
+ def self.attribute_map
64
+ {
65
+ :'id' => :'id',
66
+ :'instance' => :'instance',
67
+ :'score' => :'score',
68
+ :'completion_status' => :'completionStatus',
69
+ :'success_status' => :'successStatus',
70
+ :'history_log' => :'historyLog',
71
+ :'total_seconds_tracked' => :'totalSecondsTracked',
72
+ :'launch_time' => :'launchTime',
73
+ :'exit_time' => :'exitTime',
74
+ :'last_runtime_update' => :'lastRuntimeUpdate'
75
+ }
76
+ end
77
+
78
+ # Attribute type mapping.
79
+ def self.swagger_types
80
+ {
81
+ :'id' => :'String',
82
+ :'instance' => :'Integer',
83
+ :'score' => :'ScoreSchema',
84
+ :'completion_status' => :'String',
85
+ :'success_status' => :'String',
86
+ :'history_log' => :'String',
87
+ :'total_seconds_tracked' => :'Float',
88
+ :'launch_time' => :'DateTime',
89
+ :'exit_time' => :'DateTime',
90
+ :'last_runtime_update' => :'DateTime'
91
+ }
92
+ end
93
+
94
+ # Initializes the object
95
+ # @param [Hash] attributes Model attributes in the form of hash
96
+ def initialize(attributes = {})
97
+ return unless attributes.is_a?(Hash)
98
+
99
+ # convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
101
+
102
+ if attributes.has_key?(:'id')
103
+ self.id = attributes[:'id']
104
+ end
105
+
106
+ if attributes.has_key?(:'instance')
107
+ self.instance = attributes[:'instance']
108
+ end
109
+
110
+ if attributes.has_key?(:'score')
111
+ self.score = attributes[:'score']
112
+ end
113
+
114
+ if attributes.has_key?(:'completionStatus')
115
+ self.completion_status = attributes[:'completionStatus']
116
+ else
117
+ self.completion_status = 'UNKNOWN'
118
+ end
119
+
120
+ if attributes.has_key?(:'successStatus')
121
+ self.success_status = attributes[:'successStatus']
122
+ else
123
+ self.success_status = 'UNKNOWN'
124
+ end
125
+
126
+ if attributes.has_key?(:'historyLog')
127
+ self.history_log = attributes[:'historyLog']
128
+ end
129
+
130
+ if attributes.has_key?(:'totalSecondsTracked')
131
+ self.total_seconds_tracked = attributes[:'totalSecondsTracked']
132
+ end
133
+
134
+ if attributes.has_key?(:'launchTime')
135
+ self.launch_time = attributes[:'launchTime']
136
+ end
137
+
138
+ if attributes.has_key?(:'exitTime')
139
+ self.exit_time = attributes[:'exitTime']
140
+ end
141
+
142
+ if attributes.has_key?(:'lastRuntimeUpdate')
143
+ self.last_runtime_update = attributes[:'lastRuntimeUpdate']
144
+ end
145
+ end
146
+
147
+ # Show invalid properties with the reasons. Usually used together with valid?
148
+ # @return Array for valid properties with the reasons
149
+ def list_invalid_properties
150
+ invalid_properties = Array.new
151
+ invalid_properties
152
+ end
153
+
154
+ # Check to see if the all the properties in the model are valid
155
+ # @return true if the model is valid
156
+ def valid?
157
+ completion_status_validator = EnumAttributeValidator.new('String', ['UNKNOWN', 'COMPLETED', 'INCOMPLETE'])
158
+ return false unless completion_status_validator.valid?(@completion_status)
159
+ success_status_validator = EnumAttributeValidator.new('String', ['UNKNOWN', 'PASSED', 'FAILED'])
160
+ return false unless success_status_validator.valid?(@success_status)
161
+ true
162
+ end
163
+
164
+ # Custom attribute writer method checking allowed values (enum).
165
+ # @param [Object] completion_status Object to be assigned
166
+ def completion_status=(completion_status)
167
+ validator = EnumAttributeValidator.new('String', ['UNKNOWN', 'COMPLETED', 'INCOMPLETE'])
168
+ unless validator.valid?(completion_status)
169
+ fail ArgumentError, 'invalid value for "completion_status", must be one of #{validator.allowable_values}.'
170
+ end
171
+ @completion_status = completion_status
172
+ end
173
+
174
+ # Custom attribute writer method checking allowed values (enum).
175
+ # @param [Object] success_status Object to be assigned
176
+ def success_status=(success_status)
177
+ validator = EnumAttributeValidator.new('String', ['UNKNOWN', 'PASSED', 'FAILED'])
178
+ unless validator.valid?(success_status)
179
+ fail ArgumentError, 'invalid value for "success_status", must be one of #{validator.allowable_values}.'
180
+ end
181
+ @success_status = success_status
182
+ end
183
+
184
+ # Checks equality by comparing each attribute.
185
+ # @param [Object] Object to be compared
186
+ def ==(o)
187
+ return true if self.equal?(o)
188
+ self.class == o.class &&
189
+ id == o.id &&
190
+ instance == o.instance &&
191
+ score == o.score &&
192
+ completion_status == o.completion_status &&
193
+ success_status == o.success_status &&
194
+ history_log == o.history_log &&
195
+ total_seconds_tracked == o.total_seconds_tracked &&
196
+ launch_time == o.launch_time &&
197
+ exit_time == o.exit_time &&
198
+ last_runtime_update == o.last_runtime_update
199
+ end
200
+
201
+ # @see the `==` method
202
+ # @param [Object] Object to be compared
203
+ def eql?(o)
204
+ self == o
205
+ end
206
+
207
+ # Calculates hash code according to all attributes.
208
+ # @return [Fixnum] Hash code
209
+ def hash
210
+ [id, instance, score, completion_status, success_status, history_log, total_seconds_tracked, launch_time, exit_time, last_runtime_update].hash
211
+ end
212
+
213
+ # Builds the object from hash
214
+ # @param [Hash] attributes Model attributes in the form of hash
215
+ # @return [Object] Returns the model itself
216
+ def build_from_hash(attributes)
217
+ return nil unless attributes.is_a?(Hash)
218
+ self.class.swagger_types.each_pair do |key, type|
219
+ if type =~ /\AArray<(.*)>/i
220
+ # check to ensure the input is an array given that the the attribute
221
+ # is documented as an array but the input is not
222
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
223
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
224
+ end
225
+ elsif !attributes[self.class.attribute_map[key]].nil?
226
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
227
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
228
+ end
229
+
230
+ self
231
+ end
232
+
233
+ # Deserializes the data based on type
234
+ # @param string type Data type
235
+ # @param string value Value to be deserialized
236
+ # @return [Object] Deserialized data
237
+ def _deserialize(type, value)
238
+ case type.to_sym
239
+ when :DateTime
240
+ DateTime.parse(value)
241
+ when :Date
242
+ Date.parse(value)
243
+ when :String
244
+ value.to_s
245
+ when :Integer
246
+ value.to_i
247
+ when :Float
248
+ value.to_f
249
+ when :BOOLEAN
250
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
251
+ true
252
+ else
253
+ false
254
+ end
255
+ when :Object
256
+ # generic object (usually a Hash), return directly
257
+ value
258
+ when /\AArray<(?<inner_type>.+)>\z/
259
+ inner_type = Regexp.last_match[:inner_type]
260
+ value.map { |v| _deserialize(inner_type, v) }
261
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
262
+ k_type = Regexp.last_match[:k_type]
263
+ v_type = Regexp.last_match[:v_type]
264
+ {}.tap do |hash|
265
+ value.each do |k, v|
266
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
267
+ end
268
+ end
269
+ else # model
270
+ temp_model = RusticiSoftwareCloudV2.const_get(type).new
271
+ temp_model.build_from_hash(value)
272
+ end
273
+ end
274
+
275
+ # Returns the string representation of the object
276
+ # @return [String] String presentation of the object
277
+ def to_s
278
+ to_hash.to_s
279
+ end
280
+
281
+ # to_body is an alias to to_hash (backward compatibility)
282
+ # @return [Hash] Returns the object in the form of hash
283
+ def to_body
284
+ to_hash
285
+ end
286
+
287
+ # Returns the object in the form of hash
288
+ # @return [Hash] Returns the object in the form of hash
289
+ def to_hash
290
+ hash = {}
291
+ self.class.attribute_map.each_pair do |attr, param|
292
+ value = self.send(attr)
293
+ next if value.nil?
294
+ hash[param] = _to_hash(value)
295
+ end
296
+ hash
297
+ end
298
+
299
+ # Outputs non-array value in the form of hash
300
+ # For object, use to_hash. Otherwise, just return the value
301
+ # @param [Object] value Any valid value
302
+ # @return [Hash] Returns the value in the form of hash
303
+ def _to_hash(value)
304
+ if value.is_a?(Array)
305
+ value.compact.map { |v| _to_hash(v) }
306
+ elsif value.is_a?(Hash)
307
+ {}.tap do |hash|
308
+ value.each { |k, v| hash[k] = _to_hash(v) }
309
+ end
310
+ elsif value.respond_to? :to_hash
311
+ value.to_hash
312
+ else
313
+ value
314
+ end
315
+ end
316
+ end
317
+ end
@@ -0,0 +1,282 @@
1
+ =begin
2
+ #SCORM Cloud Rest API
3
+
4
+ #REST API used for SCORM Cloud integrations.
5
+
6
+ OpenAPI spec version: 2.0 beta
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+ Swagger Codegen version: 2.4.3
10
+
11
+ =end
12
+
13
+ require 'date'
14
+
15
+ module RusticiSoftwareCloudV2
16
+ class LaunchLinkRequestSchema
17
+ # Number of seconds from now this link will expire in. Defaults to 120s. Range 10s:300s
18
+ attr_accessor :expiry
19
+
20
+ # The URL the application should redirect to when the learner exits a course. If not specified, configured value will be used.
21
+ attr_accessor :redirect_on_exit_url
22
+
23
+ # Should this launch be tracked? If false, Engine will avoid tracking to the extent possible for the standard being used.
24
+ attr_accessor :tracking
25
+
26
+ # For SCORM, SCO identifier to override launch, overriding the normal sequencing.
27
+ attr_accessor :start_sco
28
+
29
+ # This parameter should specify a culture code. If specified, and supported, the navigation and alerts in the player will be displayed in the associated language. If not specified, the locale of the user’s browser will be used.
30
+ attr_accessor :culture
31
+
32
+ # A Url pointing to custom css for the player to use.
33
+ attr_accessor :css_url
34
+
35
+ attr_accessor :learner_tags
36
+
37
+ attr_accessor :course_tags
38
+
39
+ attr_accessor :registration_tags
40
+
41
+ attr_accessor :additionalvalues
42
+
43
+ # Attribute mapping from ruby-style variable name to JSON key.
44
+ def self.attribute_map
45
+ {
46
+ :'expiry' => :'expiry',
47
+ :'redirect_on_exit_url' => :'redirectOnExitUrl',
48
+ :'tracking' => :'tracking',
49
+ :'start_sco' => :'startSco',
50
+ :'culture' => :'culture',
51
+ :'css_url' => :'cssUrl',
52
+ :'learner_tags' => :'learnerTags',
53
+ :'course_tags' => :'courseTags',
54
+ :'registration_tags' => :'registrationTags',
55
+ :'additionalvalues' => :'additionalvalues'
56
+ }
57
+ end
58
+
59
+ # Attribute type mapping.
60
+ def self.swagger_types
61
+ {
62
+ :'expiry' => :'Integer',
63
+ :'redirect_on_exit_url' => :'String',
64
+ :'tracking' => :'BOOLEAN',
65
+ :'start_sco' => :'String',
66
+ :'culture' => :'String',
67
+ :'css_url' => :'String',
68
+ :'learner_tags' => :'Array<String>',
69
+ :'course_tags' => :'Array<String>',
70
+ :'registration_tags' => :'Array<String>',
71
+ :'additionalvalues' => :'Array<ItemValuePairSchema>'
72
+ }
73
+ end
74
+
75
+ # Initializes the object
76
+ # @param [Hash] attributes Model attributes in the form of hash
77
+ def initialize(attributes = {})
78
+ return unless attributes.is_a?(Hash)
79
+
80
+ # convert string to symbol for hash key
81
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
82
+
83
+ if attributes.has_key?(:'expiry')
84
+ self.expiry = attributes[:'expiry']
85
+ else
86
+ self.expiry = 120
87
+ end
88
+
89
+ if attributes.has_key?(:'redirectOnExitUrl')
90
+ self.redirect_on_exit_url = attributes[:'redirectOnExitUrl']
91
+ end
92
+
93
+ if attributes.has_key?(:'tracking')
94
+ self.tracking = attributes[:'tracking']
95
+ else
96
+ self.tracking = true
97
+ end
98
+
99
+ if attributes.has_key?(:'startSco')
100
+ self.start_sco = attributes[:'startSco']
101
+ end
102
+
103
+ if attributes.has_key?(:'culture')
104
+ self.culture = attributes[:'culture']
105
+ end
106
+
107
+ if attributes.has_key?(:'cssUrl')
108
+ self.css_url = attributes[:'cssUrl']
109
+ end
110
+
111
+ if attributes.has_key?(:'learnerTags')
112
+ if (value = attributes[:'learnerTags']).is_a?(Array)
113
+ self.learner_tags = value
114
+ end
115
+ end
116
+
117
+ if attributes.has_key?(:'courseTags')
118
+ if (value = attributes[:'courseTags']).is_a?(Array)
119
+ self.course_tags = value
120
+ end
121
+ end
122
+
123
+ if attributes.has_key?(:'registrationTags')
124
+ if (value = attributes[:'registrationTags']).is_a?(Array)
125
+ self.registration_tags = value
126
+ end
127
+ end
128
+
129
+ if attributes.has_key?(:'additionalvalues')
130
+ if (value = attributes[:'additionalvalues']).is_a?(Array)
131
+ self.additionalvalues = value
132
+ end
133
+ end
134
+ end
135
+
136
+ # Show invalid properties with the reasons. Usually used together with valid?
137
+ # @return Array for valid properties with the reasons
138
+ def list_invalid_properties
139
+ invalid_properties = Array.new
140
+ invalid_properties
141
+ end
142
+
143
+ # Check to see if the all the properties in the model are valid
144
+ # @return true if the model is valid
145
+ def valid?
146
+ true
147
+ end
148
+
149
+ # Checks equality by comparing each attribute.
150
+ # @param [Object] Object to be compared
151
+ def ==(o)
152
+ return true if self.equal?(o)
153
+ self.class == o.class &&
154
+ expiry == o.expiry &&
155
+ redirect_on_exit_url == o.redirect_on_exit_url &&
156
+ tracking == o.tracking &&
157
+ start_sco == o.start_sco &&
158
+ culture == o.culture &&
159
+ css_url == o.css_url &&
160
+ learner_tags == o.learner_tags &&
161
+ course_tags == o.course_tags &&
162
+ registration_tags == o.registration_tags &&
163
+ additionalvalues == o.additionalvalues
164
+ end
165
+
166
+ # @see the `==` method
167
+ # @param [Object] Object to be compared
168
+ def eql?(o)
169
+ self == o
170
+ end
171
+
172
+ # Calculates hash code according to all attributes.
173
+ # @return [Fixnum] Hash code
174
+ def hash
175
+ [expiry, redirect_on_exit_url, tracking, start_sco, culture, css_url, learner_tags, course_tags, registration_tags, additionalvalues].hash
176
+ end
177
+
178
+ # Builds the object from hash
179
+ # @param [Hash] attributes Model attributes in the form of hash
180
+ # @return [Object] Returns the model itself
181
+ def build_from_hash(attributes)
182
+ return nil unless attributes.is_a?(Hash)
183
+ self.class.swagger_types.each_pair do |key, type|
184
+ if type =~ /\AArray<(.*)>/i
185
+ # check to ensure the input is an array given that the the attribute
186
+ # is documented as an array but the input is not
187
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
188
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
189
+ end
190
+ elsif !attributes[self.class.attribute_map[key]].nil?
191
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
192
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
193
+ end
194
+
195
+ self
196
+ end
197
+
198
+ # Deserializes the data based on type
199
+ # @param string type Data type
200
+ # @param string value Value to be deserialized
201
+ # @return [Object] Deserialized data
202
+ def _deserialize(type, value)
203
+ case type.to_sym
204
+ when :DateTime
205
+ DateTime.parse(value)
206
+ when :Date
207
+ Date.parse(value)
208
+ when :String
209
+ value.to_s
210
+ when :Integer
211
+ value.to_i
212
+ when :Float
213
+ value.to_f
214
+ when :BOOLEAN
215
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
216
+ true
217
+ else
218
+ false
219
+ end
220
+ when :Object
221
+ # generic object (usually a Hash), return directly
222
+ value
223
+ when /\AArray<(?<inner_type>.+)>\z/
224
+ inner_type = Regexp.last_match[:inner_type]
225
+ value.map { |v| _deserialize(inner_type, v) }
226
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
227
+ k_type = Regexp.last_match[:k_type]
228
+ v_type = Regexp.last_match[:v_type]
229
+ {}.tap do |hash|
230
+ value.each do |k, v|
231
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
232
+ end
233
+ end
234
+ else # model
235
+ temp_model = RusticiSoftwareCloudV2.const_get(type).new
236
+ temp_model.build_from_hash(value)
237
+ end
238
+ end
239
+
240
+ # Returns the string representation of the object
241
+ # @return [String] String presentation of the object
242
+ def to_s
243
+ to_hash.to_s
244
+ end
245
+
246
+ # to_body is an alias to to_hash (backward compatibility)
247
+ # @return [Hash] Returns the object in the form of hash
248
+ def to_body
249
+ to_hash
250
+ end
251
+
252
+ # Returns the object in the form of hash
253
+ # @return [Hash] Returns the object in the form of hash
254
+ def to_hash
255
+ hash = {}
256
+ self.class.attribute_map.each_pair do |attr, param|
257
+ value = self.send(attr)
258
+ next if value.nil?
259
+ hash[param] = _to_hash(value)
260
+ end
261
+ hash
262
+ end
263
+
264
+ # Outputs non-array value in the form of hash
265
+ # For object, use to_hash. Otherwise, just return the value
266
+ # @param [Object] value Any valid value
267
+ # @return [Hash] Returns the value in the form of hash
268
+ def _to_hash(value)
269
+ if value.is_a?(Array)
270
+ value.compact.map { |v| _to_hash(v) }
271
+ elsif value.is_a?(Hash)
272
+ {}.tap do |hash|
273
+ value.each { |k, v| hash[k] = _to_hash(v) }
274
+ end
275
+ elsif value.respond_to? :to_hash
276
+ value.to_hash
277
+ else
278
+ value
279
+ end
280
+ end
281
+ end
282
+ end