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