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,205 @@
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
+ # https://github.com/adlnet/xAPI-Spec/blob/1.0.2/xAPI.md#statement-references
17
+ class XapiStatementReference
18
+ attr_accessor :object_type
19
+
20
+ attr_accessor :id
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'object_type' => :'objectType',
26
+ :'id' => :'id'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'object_type' => :'String',
34
+ :'id' => :'String'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'objectType')
47
+ self.object_type = attributes[:'objectType']
48
+ else
49
+ self.object_type = 'StatementRef'
50
+ end
51
+
52
+ if attributes.has_key?(:'id')
53
+ self.id = attributes[:'id']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ if @object_type.nil?
62
+ invalid_properties.push('invalid value for "object_type", object_type cannot be nil.')
63
+ end
64
+
65
+ if @id.nil?
66
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
67
+ end
68
+
69
+ invalid_properties
70
+ end
71
+
72
+ # Check to see if the all the properties in the model are valid
73
+ # @return true if the model is valid
74
+ def valid?
75
+ return false if @object_type.nil?
76
+ return false if @id.nil?
77
+ true
78
+ end
79
+
80
+ # Checks equality by comparing each attribute.
81
+ # @param [Object] Object to be compared
82
+ def ==(o)
83
+ return true if self.equal?(o)
84
+ self.class == o.class &&
85
+ object_type == o.object_type &&
86
+ id == o.id
87
+ end
88
+
89
+ # @see the `==` method
90
+ # @param [Object] Object to be compared
91
+ def eql?(o)
92
+ self == o
93
+ end
94
+
95
+ # Calculates hash code according to all attributes.
96
+ # @return [Fixnum] Hash code
97
+ def hash
98
+ [object_type, id].hash
99
+ end
100
+
101
+ # Builds the object from hash
102
+ # @param [Hash] attributes Model attributes in the form of hash
103
+ # @return [Object] Returns the model itself
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /\AArray<(.*)>/i
108
+ # check to ensure the input is an array given that the the attribute
109
+ # is documented as an array but the input is not
110
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
111
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
116
+ end
117
+
118
+ self
119
+ end
120
+
121
+ # Deserializes the data based on type
122
+ # @param string type Data type
123
+ # @param string value Value to be deserialized
124
+ # @return [Object] Deserialized data
125
+ def _deserialize(type, value)
126
+ case type.to_sym
127
+ when :DateTime
128
+ DateTime.parse(value)
129
+ when :Date
130
+ Date.parse(value)
131
+ when :String
132
+ value.to_s
133
+ when :Integer
134
+ value.to_i
135
+ when :Float
136
+ value.to_f
137
+ when :BOOLEAN
138
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
139
+ true
140
+ else
141
+ false
142
+ end
143
+ when :Object
144
+ # generic object (usually a Hash), return directly
145
+ value
146
+ when /\AArray<(?<inner_type>.+)>\z/
147
+ inner_type = Regexp.last_match[:inner_type]
148
+ value.map { |v| _deserialize(inner_type, v) }
149
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
150
+ k_type = Regexp.last_match[:k_type]
151
+ v_type = Regexp.last_match[:v_type]
152
+ {}.tap do |hash|
153
+ value.each do |k, v|
154
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
155
+ end
156
+ end
157
+ else # model
158
+ temp_model = RusticiSoftwareCloudV2.const_get(type).new
159
+ temp_model.build_from_hash(value)
160
+ end
161
+ end
162
+
163
+ # Returns the string representation of the object
164
+ # @return [String] String presentation of the object
165
+ def to_s
166
+ to_hash.to_s
167
+ end
168
+
169
+ # to_body is an alias to to_hash (backward compatibility)
170
+ # @return [Hash] Returns the object in the form of hash
171
+ def to_body
172
+ to_hash
173
+ end
174
+
175
+ # Returns the object in the form of hash
176
+ # @return [Hash] Returns the object in the form of hash
177
+ def to_hash
178
+ hash = {}
179
+ self.class.attribute_map.each_pair do |attr, param|
180
+ value = self.send(attr)
181
+ next if value.nil?
182
+ hash[param] = _to_hash(value)
183
+ end
184
+ hash
185
+ end
186
+
187
+ # Outputs non-array value in the form of hash
188
+ # For object, use to_hash. Otherwise, just return the value
189
+ # @param [Object] value Any valid value
190
+ # @return [Hash] Returns the value in the form of hash
191
+ def _to_hash(value)
192
+ if value.is_a?(Array)
193
+ value.compact.map { |v| _to_hash(v) }
194
+ elsif value.is_a?(Hash)
195
+ {}.tap do |hash|
196
+ value.each { |k, v| hash[k] = _to_hash(v) }
197
+ end
198
+ elsif value.respond_to? :to_hash
199
+ value.to_hash
200
+ else
201
+ value
202
+ end
203
+ end
204
+ end
205
+ end
@@ -0,0 +1,200 @@
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
+ # https://github.com/adlnet/xAPI-Spec/blob/1.0.2/xAPI.md#42-retrieval-of-statements
17
+ class XapiStatementResult
18
+ attr_accessor :statements
19
+
20
+ attr_accessor :more
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'statements' => :'statements',
26
+ :'more' => :'more'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'statements' => :'Array<XapiStatement>',
34
+ :'more' => :'String'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'statements')
47
+ if (value = attributes[:'statements']).is_a?(Array)
48
+ self.statements = value
49
+ end
50
+ end
51
+
52
+ if attributes.has_key?(:'more')
53
+ self.more = attributes[:'more']
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ if @statements.nil?
62
+ invalid_properties.push('invalid value for "statements", statements cannot be nil.')
63
+ end
64
+
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return false if @statements.nil?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ statements == o.statements &&
81
+ more == o.more
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Fixnum] Hash code
92
+ def hash
93
+ [statements, more].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+ self.class.swagger_types.each_pair do |key, type|
102
+ if type =~ /\AArray<(.*)>/i
103
+ # check to ensure the input is an array given that the the attribute
104
+ # is documented as an array but the input is not
105
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
106
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
107
+ end
108
+ elsif !attributes[self.class.attribute_map[key]].nil?
109
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
110
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
111
+ end
112
+
113
+ self
114
+ end
115
+
116
+ # Deserializes the data based on type
117
+ # @param string type Data type
118
+ # @param string value Value to be deserialized
119
+ # @return [Object] Deserialized data
120
+ def _deserialize(type, value)
121
+ case type.to_sym
122
+ when :DateTime
123
+ DateTime.parse(value)
124
+ when :Date
125
+ Date.parse(value)
126
+ when :String
127
+ value.to_s
128
+ when :Integer
129
+ value.to_i
130
+ when :Float
131
+ value.to_f
132
+ when :BOOLEAN
133
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
134
+ true
135
+ else
136
+ false
137
+ end
138
+ when :Object
139
+ # generic object (usually a Hash), return directly
140
+ value
141
+ when /\AArray<(?<inner_type>.+)>\z/
142
+ inner_type = Regexp.last_match[:inner_type]
143
+ value.map { |v| _deserialize(inner_type, v) }
144
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
145
+ k_type = Regexp.last_match[:k_type]
146
+ v_type = Regexp.last_match[:v_type]
147
+ {}.tap do |hash|
148
+ value.each do |k, v|
149
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
150
+ end
151
+ end
152
+ else # model
153
+ temp_model = RusticiSoftwareCloudV2.const_get(type).new
154
+ temp_model.build_from_hash(value)
155
+ end
156
+ end
157
+
158
+ # Returns the string representation of the object
159
+ # @return [String] String presentation of the object
160
+ def to_s
161
+ to_hash.to_s
162
+ end
163
+
164
+ # to_body is an alias to to_hash (backward compatibility)
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_body
167
+ to_hash
168
+ end
169
+
170
+ # Returns the object in the form of hash
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_hash
173
+ hash = {}
174
+ self.class.attribute_map.each_pair do |attr, param|
175
+ value = self.send(attr)
176
+ next if value.nil?
177
+ hash[param] = _to_hash(value)
178
+ end
179
+ hash
180
+ end
181
+
182
+ # Outputs non-array value in the form of hash
183
+ # For object, use to_hash. Otherwise, just return the value
184
+ # @param [Object] value Any valid value
185
+ # @return [Hash] Returns the value in the form of hash
186
+ def _to_hash(value)
187
+ if value.is_a?(Array)
188
+ value.compact.map { |v| _to_hash(v) }
189
+ elsif value.is_a?(Hash)
190
+ {}.tap do |hash|
191
+ value.each { |k, v| hash[k] = _to_hash(v) }
192
+ end
193
+ elsif value.respond_to? :to_hash
194
+ value.to_hash
195
+ else
196
+ value
197
+ end
198
+ end
199
+ end
200
+ end
@@ -0,0 +1,200 @@
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
+ # https://github.com/adlnet/xAPI-Spec/blob/1.0.2/xAPI.md#413-verb
17
+ class XapiVerb
18
+ attr_accessor :id
19
+
20
+ attr_accessor :display
21
+
22
+ # Attribute mapping from ruby-style variable name to JSON key.
23
+ def self.attribute_map
24
+ {
25
+ :'id' => :'id',
26
+ :'display' => :'display'
27
+ }
28
+ end
29
+
30
+ # Attribute type mapping.
31
+ def self.swagger_types
32
+ {
33
+ :'id' => :'String',
34
+ :'display' => :'Hash<String, String>'
35
+ }
36
+ end
37
+
38
+ # Initializes the object
39
+ # @param [Hash] attributes Model attributes in the form of hash
40
+ def initialize(attributes = {})
41
+ return unless attributes.is_a?(Hash)
42
+
43
+ # convert string to symbol for hash key
44
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
45
+
46
+ if attributes.has_key?(:'id')
47
+ self.id = attributes[:'id']
48
+ end
49
+
50
+ if attributes.has_key?(:'display')
51
+ if (value = attributes[:'display']).is_a?(Hash)
52
+ self.display = value
53
+ end
54
+ end
55
+ end
56
+
57
+ # Show invalid properties with the reasons. Usually used together with valid?
58
+ # @return Array for valid properties with the reasons
59
+ def list_invalid_properties
60
+ invalid_properties = Array.new
61
+ if @id.nil?
62
+ invalid_properties.push('invalid value for "id", id cannot be nil.')
63
+ end
64
+
65
+ invalid_properties
66
+ end
67
+
68
+ # Check to see if the all the properties in the model are valid
69
+ # @return true if the model is valid
70
+ def valid?
71
+ return false if @id.nil?
72
+ true
73
+ end
74
+
75
+ # Checks equality by comparing each attribute.
76
+ # @param [Object] Object to be compared
77
+ def ==(o)
78
+ return true if self.equal?(o)
79
+ self.class == o.class &&
80
+ id == o.id &&
81
+ display == o.display
82
+ end
83
+
84
+ # @see the `==` method
85
+ # @param [Object] Object to be compared
86
+ def eql?(o)
87
+ self == o
88
+ end
89
+
90
+ # Calculates hash code according to all attributes.
91
+ # @return [Fixnum] Hash code
92
+ def hash
93
+ [id, display].hash
94
+ end
95
+
96
+ # Builds the object from hash
97
+ # @param [Hash] attributes Model attributes in the form of hash
98
+ # @return [Object] Returns the model itself
99
+ def build_from_hash(attributes)
100
+ return nil unless attributes.is_a?(Hash)
101
+ self.class.swagger_types.each_pair do |key, type|
102
+ if type =~ /\AArray<(.*)>/i
103
+ # check to ensure the input is an array given that the the attribute
104
+ # is documented as an array but the input is not
105
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
106
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
107
+ end
108
+ elsif !attributes[self.class.attribute_map[key]].nil?
109
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
110
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
111
+ end
112
+
113
+ self
114
+ end
115
+
116
+ # Deserializes the data based on type
117
+ # @param string type Data type
118
+ # @param string value Value to be deserialized
119
+ # @return [Object] Deserialized data
120
+ def _deserialize(type, value)
121
+ case type.to_sym
122
+ when :DateTime
123
+ DateTime.parse(value)
124
+ when :Date
125
+ Date.parse(value)
126
+ when :String
127
+ value.to_s
128
+ when :Integer
129
+ value.to_i
130
+ when :Float
131
+ value.to_f
132
+ when :BOOLEAN
133
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
134
+ true
135
+ else
136
+ false
137
+ end
138
+ when :Object
139
+ # generic object (usually a Hash), return directly
140
+ value
141
+ when /\AArray<(?<inner_type>.+)>\z/
142
+ inner_type = Regexp.last_match[:inner_type]
143
+ value.map { |v| _deserialize(inner_type, v) }
144
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
145
+ k_type = Regexp.last_match[:k_type]
146
+ v_type = Regexp.last_match[:v_type]
147
+ {}.tap do |hash|
148
+ value.each do |k, v|
149
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
150
+ end
151
+ end
152
+ else # model
153
+ temp_model = RusticiSoftwareCloudV2.const_get(type).new
154
+ temp_model.build_from_hash(value)
155
+ end
156
+ end
157
+
158
+ # Returns the string representation of the object
159
+ # @return [String] String presentation of the object
160
+ def to_s
161
+ to_hash.to_s
162
+ end
163
+
164
+ # to_body is an alias to to_hash (backward compatibility)
165
+ # @return [Hash] Returns the object in the form of hash
166
+ def to_body
167
+ to_hash
168
+ end
169
+
170
+ # Returns the object in the form of hash
171
+ # @return [Hash] Returns the object in the form of hash
172
+ def to_hash
173
+ hash = {}
174
+ self.class.attribute_map.each_pair do |attr, param|
175
+ value = self.send(attr)
176
+ next if value.nil?
177
+ hash[param] = _to_hash(value)
178
+ end
179
+ hash
180
+ end
181
+
182
+ # Outputs non-array value in the form of hash
183
+ # For object, use to_hash. Otherwise, just return the value
184
+ # @param [Object] value Any valid value
185
+ # @return [Hash] Returns the value in the form of hash
186
+ def _to_hash(value)
187
+ if value.is_a?(Array)
188
+ value.compact.map { |v| _to_hash(v) }
189
+ elsif value.is_a?(Hash)
190
+ {}.tap do |hash|
191
+ value.each { |k, v| hash[k] = _to_hash(v) }
192
+ end
193
+ elsif value.respond_to? :to_hash
194
+ value.to_hash
195
+ else
196
+ value
197
+ end
198
+ end
199
+ end
200
+ end