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,328 @@
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 CourseSchema
17
+ attr_accessor :id
18
+
19
+ attr_accessor :title
20
+
21
+ # xAPI activity id associated with this course
22
+ attr_accessor :xapi_activity_id
23
+
24
+ attr_accessor :created
25
+
26
+ attr_accessor :updated
27
+
28
+ attr_accessor :version
29
+
30
+ attr_accessor :registration_count
31
+
32
+ attr_accessor :activity_id
33
+
34
+ attr_accessor :course_learning_standard
35
+
36
+ attr_accessor :tags
37
+
38
+ attr_accessor :dispatched
39
+
40
+ attr_accessor :metadata
41
+
42
+ attr_accessor :root_activity
43
+
44
+ class EnumAttributeValidator
45
+ attr_reader :datatype
46
+ attr_reader :allowable_values
47
+
48
+ def initialize(datatype, allowable_values)
49
+ @allowable_values = allowable_values.map do |value|
50
+ case datatype.to_s
51
+ when /Integer/i
52
+ value.to_i
53
+ when /Float/i
54
+ value.to_f
55
+ else
56
+ value
57
+ end
58
+ end
59
+ end
60
+
61
+ def valid?(value)
62
+ !value || allowable_values.include?(value)
63
+ end
64
+ end
65
+
66
+ # Attribute mapping from ruby-style variable name to JSON key.
67
+ def self.attribute_map
68
+ {
69
+ :'id' => :'id',
70
+ :'title' => :'title',
71
+ :'xapi_activity_id' => :'xapiActivityId',
72
+ :'created' => :'created',
73
+ :'updated' => :'updated',
74
+ :'version' => :'version',
75
+ :'registration_count' => :'registrationCount',
76
+ :'activity_id' => :'activityId',
77
+ :'course_learning_standard' => :'courseLearningStandard',
78
+ :'tags' => :'tags',
79
+ :'dispatched' => :'dispatched',
80
+ :'metadata' => :'metadata',
81
+ :'root_activity' => :'rootActivity'
82
+ }
83
+ end
84
+
85
+ # Attribute type mapping.
86
+ def self.swagger_types
87
+ {
88
+ :'id' => :'String',
89
+ :'title' => :'String',
90
+ :'xapi_activity_id' => :'String',
91
+ :'created' => :'DateTime',
92
+ :'updated' => :'DateTime',
93
+ :'version' => :'Integer',
94
+ :'registration_count' => :'Integer',
95
+ :'activity_id' => :'String',
96
+ :'course_learning_standard' => :'String',
97
+ :'tags' => :'Array<String>',
98
+ :'dispatched' => :'BOOLEAN',
99
+ :'metadata' => :'MetadataSchema',
100
+ :'root_activity' => :'CourseActivitySchema'
101
+ }
102
+ end
103
+
104
+ # Initializes the object
105
+ # @param [Hash] attributes Model attributes in the form of hash
106
+ def initialize(attributes = {})
107
+ return unless attributes.is_a?(Hash)
108
+
109
+ # convert string to symbol for hash key
110
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
111
+
112
+ if attributes.has_key?(:'id')
113
+ self.id = attributes[:'id']
114
+ end
115
+
116
+ if attributes.has_key?(:'title')
117
+ self.title = attributes[:'title']
118
+ end
119
+
120
+ if attributes.has_key?(:'xapiActivityId')
121
+ self.xapi_activity_id = attributes[:'xapiActivityId']
122
+ end
123
+
124
+ if attributes.has_key?(:'created')
125
+ self.created = attributes[:'created']
126
+ end
127
+
128
+ if attributes.has_key?(:'updated')
129
+ self.updated = attributes[:'updated']
130
+ end
131
+
132
+ if attributes.has_key?(:'version')
133
+ self.version = attributes[:'version']
134
+ end
135
+
136
+ if attributes.has_key?(:'registrationCount')
137
+ self.registration_count = attributes[:'registrationCount']
138
+ end
139
+
140
+ if attributes.has_key?(:'activityId')
141
+ self.activity_id = attributes[:'activityId']
142
+ end
143
+
144
+ if attributes.has_key?(:'courseLearningStandard')
145
+ self.course_learning_standard = attributes[:'courseLearningStandard']
146
+ end
147
+
148
+ if attributes.has_key?(:'tags')
149
+ if (value = attributes[:'tags']).is_a?(Array)
150
+ self.tags = value
151
+ end
152
+ end
153
+
154
+ if attributes.has_key?(:'dispatched')
155
+ self.dispatched = attributes[:'dispatched']
156
+ end
157
+
158
+ if attributes.has_key?(:'metadata')
159
+ self.metadata = attributes[:'metadata']
160
+ end
161
+
162
+ if attributes.has_key?(:'rootActivity')
163
+ self.root_activity = attributes[:'rootActivity']
164
+ end
165
+ end
166
+
167
+ # Show invalid properties with the reasons. Usually used together with valid?
168
+ # @return Array for valid properties with the reasons
169
+ def list_invalid_properties
170
+ invalid_properties = Array.new
171
+ invalid_properties
172
+ end
173
+
174
+ # Check to see if the all the properties in the model are valid
175
+ # @return true if the model is valid
176
+ def valid?
177
+ course_learning_standard_validator = EnumAttributeValidator.new('String', ['UNKNOWN', 'SCORM11', 'SCORM12', 'SCORM20042NDEDITION', 'SCORM20043RDEDITION', 'SCORM20044THEDITION', 'AICC', 'XAPI', 'CMI5'])
178
+ return false unless course_learning_standard_validator.valid?(@course_learning_standard)
179
+ true
180
+ end
181
+
182
+ # Custom attribute writer method checking allowed values (enum).
183
+ # @param [Object] course_learning_standard Object to be assigned
184
+ def course_learning_standard=(course_learning_standard)
185
+ validator = EnumAttributeValidator.new('String', ['UNKNOWN', 'SCORM11', 'SCORM12', 'SCORM20042NDEDITION', 'SCORM20043RDEDITION', 'SCORM20044THEDITION', 'AICC', 'XAPI', 'CMI5'])
186
+ unless validator.valid?(course_learning_standard)
187
+ fail ArgumentError, 'invalid value for "course_learning_standard", must be one of #{validator.allowable_values}.'
188
+ end
189
+ @course_learning_standard = course_learning_standard
190
+ end
191
+
192
+ # Checks equality by comparing each attribute.
193
+ # @param [Object] Object to be compared
194
+ def ==(o)
195
+ return true if self.equal?(o)
196
+ self.class == o.class &&
197
+ id == o.id &&
198
+ title == o.title &&
199
+ xapi_activity_id == o.xapi_activity_id &&
200
+ created == o.created &&
201
+ updated == o.updated &&
202
+ version == o.version &&
203
+ registration_count == o.registration_count &&
204
+ activity_id == o.activity_id &&
205
+ course_learning_standard == o.course_learning_standard &&
206
+ tags == o.tags &&
207
+ dispatched == o.dispatched &&
208
+ metadata == o.metadata &&
209
+ root_activity == o.root_activity
210
+ end
211
+
212
+ # @see the `==` method
213
+ # @param [Object] Object to be compared
214
+ def eql?(o)
215
+ self == o
216
+ end
217
+
218
+ # Calculates hash code according to all attributes.
219
+ # @return [Fixnum] Hash code
220
+ def hash
221
+ [id, title, xapi_activity_id, created, updated, version, registration_count, activity_id, course_learning_standard, tags, dispatched, metadata, root_activity].hash
222
+ end
223
+
224
+ # Builds the object from hash
225
+ # @param [Hash] attributes Model attributes in the form of hash
226
+ # @return [Object] Returns the model itself
227
+ def build_from_hash(attributes)
228
+ return nil unless attributes.is_a?(Hash)
229
+ self.class.swagger_types.each_pair do |key, type|
230
+ if type =~ /\AArray<(.*)>/i
231
+ # check to ensure the input is an array given that the the attribute
232
+ # is documented as an array but the input is not
233
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
234
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
235
+ end
236
+ elsif !attributes[self.class.attribute_map[key]].nil?
237
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
238
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
239
+ end
240
+
241
+ self
242
+ end
243
+
244
+ # Deserializes the data based on type
245
+ # @param string type Data type
246
+ # @param string value Value to be deserialized
247
+ # @return [Object] Deserialized data
248
+ def _deserialize(type, value)
249
+ case type.to_sym
250
+ when :DateTime
251
+ DateTime.parse(value)
252
+ when :Date
253
+ Date.parse(value)
254
+ when :String
255
+ value.to_s
256
+ when :Integer
257
+ value.to_i
258
+ when :Float
259
+ value.to_f
260
+ when :BOOLEAN
261
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
262
+ true
263
+ else
264
+ false
265
+ end
266
+ when :Object
267
+ # generic object (usually a Hash), return directly
268
+ value
269
+ when /\AArray<(?<inner_type>.+)>\z/
270
+ inner_type = Regexp.last_match[:inner_type]
271
+ value.map { |v| _deserialize(inner_type, v) }
272
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
273
+ k_type = Regexp.last_match[:k_type]
274
+ v_type = Regexp.last_match[:v_type]
275
+ {}.tap do |hash|
276
+ value.each do |k, v|
277
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
278
+ end
279
+ end
280
+ else # model
281
+ temp_model = RusticiSoftwareCloudV2.const_get(type).new
282
+ temp_model.build_from_hash(value)
283
+ end
284
+ end
285
+
286
+ # Returns the string representation of the object
287
+ # @return [String] String presentation of the object
288
+ def to_s
289
+ to_hash.to_s
290
+ end
291
+
292
+ # to_body is an alias to to_hash (backward compatibility)
293
+ # @return [Hash] Returns the object in the form of hash
294
+ def to_body
295
+ to_hash
296
+ end
297
+
298
+ # Returns the object in the form of hash
299
+ # @return [Hash] Returns the object in the form of hash
300
+ def to_hash
301
+ hash = {}
302
+ self.class.attribute_map.each_pair do |attr, param|
303
+ value = self.send(attr)
304
+ next if value.nil?
305
+ hash[param] = _to_hash(value)
306
+ end
307
+ hash
308
+ end
309
+
310
+ # Outputs non-array value in the form of hash
311
+ # For object, use to_hash. Otherwise, just return the value
312
+ # @param [Object] value Any valid value
313
+ # @return [Hash] Returns the value in the form of hash
314
+ def _to_hash(value)
315
+ if value.is_a?(Array)
316
+ value.compact.map { |v| _to_hash(v) }
317
+ elsif value.is_a?(Hash)
318
+ {}.tap do |hash|
319
+ value.each { |k, v| hash[k] = _to_hash(v) }
320
+ end
321
+ elsif value.respond_to? :to_hash
322
+ value.to_hash
323
+ else
324
+ value
325
+ end
326
+ end
327
+ end
328
+ end
@@ -0,0 +1,204 @@
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 CourseTagsBatchSchema
17
+ attr_accessor :course_ids
18
+
19
+ attr_accessor :tags
20
+
21
+ # Attribute mapping from ruby-style variable name to JSON key.
22
+ def self.attribute_map
23
+ {
24
+ :'course_ids' => :'courseIds',
25
+ :'tags' => :'tags'
26
+ }
27
+ end
28
+
29
+ # Attribute type mapping.
30
+ def self.swagger_types
31
+ {
32
+ :'course_ids' => :'Array<String>',
33
+ :'tags' => :'TagPostSchema'
34
+ }
35
+ end
36
+
37
+ # Initializes the object
38
+ # @param [Hash] attributes Model attributes in the form of hash
39
+ def initialize(attributes = {})
40
+ return unless attributes.is_a?(Hash)
41
+
42
+ # convert string to symbol for hash key
43
+ attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
44
+
45
+ if attributes.has_key?(:'courseIds')
46
+ if (value = attributes[:'courseIds']).is_a?(Array)
47
+ self.course_ids = value
48
+ end
49
+ end
50
+
51
+ if attributes.has_key?(:'tags')
52
+ self.tags = attributes[:'tags']
53
+ end
54
+ end
55
+
56
+ # Show invalid properties with the reasons. Usually used together with valid?
57
+ # @return Array for valid properties with the reasons
58
+ def list_invalid_properties
59
+ invalid_properties = Array.new
60
+ if @course_ids.nil?
61
+ invalid_properties.push('invalid value for "course_ids", course_ids cannot be nil.')
62
+ end
63
+
64
+ if @tags.nil?
65
+ invalid_properties.push('invalid value for "tags", tags cannot be nil.')
66
+ end
67
+
68
+ invalid_properties
69
+ end
70
+
71
+ # Check to see if the all the properties in the model are valid
72
+ # @return true if the model is valid
73
+ def valid?
74
+ return false if @course_ids.nil?
75
+ return false if @tags.nil?
76
+ true
77
+ end
78
+
79
+ # Checks equality by comparing each attribute.
80
+ # @param [Object] Object to be compared
81
+ def ==(o)
82
+ return true if self.equal?(o)
83
+ self.class == o.class &&
84
+ course_ids == o.course_ids &&
85
+ tags == o.tags
86
+ end
87
+
88
+ # @see the `==` method
89
+ # @param [Object] Object to be compared
90
+ def eql?(o)
91
+ self == o
92
+ end
93
+
94
+ # Calculates hash code according to all attributes.
95
+ # @return [Fixnum] Hash code
96
+ def hash
97
+ [course_ids, tags].hash
98
+ end
99
+
100
+ # Builds the object from hash
101
+ # @param [Hash] attributes Model attributes in the form of hash
102
+ # @return [Object] Returns the model itself
103
+ def build_from_hash(attributes)
104
+ return nil unless attributes.is_a?(Hash)
105
+ self.class.swagger_types.each_pair do |key, type|
106
+ if type =~ /\AArray<(.*)>/i
107
+ # check to ensure the input is an array given that the the attribute
108
+ # is documented as an array but the input is not
109
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
110
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
111
+ end
112
+ elsif !attributes[self.class.attribute_map[key]].nil?
113
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
114
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
115
+ end
116
+
117
+ self
118
+ end
119
+
120
+ # Deserializes the data based on type
121
+ # @param string type Data type
122
+ # @param string value Value to be deserialized
123
+ # @return [Object] Deserialized data
124
+ def _deserialize(type, value)
125
+ case type.to_sym
126
+ when :DateTime
127
+ DateTime.parse(value)
128
+ when :Date
129
+ Date.parse(value)
130
+ when :String
131
+ value.to_s
132
+ when :Integer
133
+ value.to_i
134
+ when :Float
135
+ value.to_f
136
+ when :BOOLEAN
137
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
138
+ true
139
+ else
140
+ false
141
+ end
142
+ when :Object
143
+ # generic object (usually a Hash), return directly
144
+ value
145
+ when /\AArray<(?<inner_type>.+)>\z/
146
+ inner_type = Regexp.last_match[:inner_type]
147
+ value.map { |v| _deserialize(inner_type, v) }
148
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
149
+ k_type = Regexp.last_match[:k_type]
150
+ v_type = Regexp.last_match[:v_type]
151
+ {}.tap do |hash|
152
+ value.each do |k, v|
153
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
154
+ end
155
+ end
156
+ else # model
157
+ temp_model = RusticiSoftwareCloudV2.const_get(type).new
158
+ temp_model.build_from_hash(value)
159
+ end
160
+ end
161
+
162
+ # Returns the string representation of the object
163
+ # @return [String] String presentation of the object
164
+ def to_s
165
+ to_hash.to_s
166
+ end
167
+
168
+ # to_body is an alias to to_hash (backward compatibility)
169
+ # @return [Hash] Returns the object in the form of hash
170
+ def to_body
171
+ to_hash
172
+ end
173
+
174
+ # Returns the object in the form of hash
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_hash
177
+ hash = {}
178
+ self.class.attribute_map.each_pair do |attr, param|
179
+ value = self.send(attr)
180
+ next if value.nil?
181
+ hash[param] = _to_hash(value)
182
+ end
183
+ hash
184
+ end
185
+
186
+ # Outputs non-array value in the form of hash
187
+ # For object, use to_hash. Otherwise, just return the value
188
+ # @param [Object] value Any valid value
189
+ # @return [Hash] Returns the value in the form of hash
190
+ def _to_hash(value)
191
+ if value.is_a?(Array)
192
+ value.compact.map { |v| _to_hash(v) }
193
+ elsif value.is_a?(Hash)
194
+ {}.tap do |hash|
195
+ value.each { |k, v| hash[k] = _to_hash(v) }
196
+ end
197
+ elsif value.respond_to? :to_hash
198
+ value.to_hash
199
+ else
200
+ value
201
+ end
202
+ end
203
+ end
204
+ end