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,184 @@
|
|
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 ScoreSchema
|
17
|
+
# Scaled score between 0 and 100
|
18
|
+
attr_accessor :scaled
|
19
|
+
|
20
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
21
|
+
def self.attribute_map
|
22
|
+
{
|
23
|
+
:'scaled' => :'scaled'
|
24
|
+
}
|
25
|
+
end
|
26
|
+
|
27
|
+
# Attribute type mapping.
|
28
|
+
def self.swagger_types
|
29
|
+
{
|
30
|
+
:'scaled' => :'Float'
|
31
|
+
}
|
32
|
+
end
|
33
|
+
|
34
|
+
# Initializes the object
|
35
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
36
|
+
def initialize(attributes = {})
|
37
|
+
return unless attributes.is_a?(Hash)
|
38
|
+
|
39
|
+
# convert string to symbol for hash key
|
40
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
41
|
+
|
42
|
+
if attributes.has_key?(:'scaled')
|
43
|
+
self.scaled = attributes[:'scaled']
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
48
|
+
# @return Array for valid properties with the reasons
|
49
|
+
def list_invalid_properties
|
50
|
+
invalid_properties = Array.new
|
51
|
+
invalid_properties
|
52
|
+
end
|
53
|
+
|
54
|
+
# Check to see if the all the properties in the model are valid
|
55
|
+
# @return true if the model is valid
|
56
|
+
def valid?
|
57
|
+
true
|
58
|
+
end
|
59
|
+
|
60
|
+
# Checks equality by comparing each attribute.
|
61
|
+
# @param [Object] Object to be compared
|
62
|
+
def ==(o)
|
63
|
+
return true if self.equal?(o)
|
64
|
+
self.class == o.class &&
|
65
|
+
scaled == o.scaled
|
66
|
+
end
|
67
|
+
|
68
|
+
# @see the `==` method
|
69
|
+
# @param [Object] Object to be compared
|
70
|
+
def eql?(o)
|
71
|
+
self == o
|
72
|
+
end
|
73
|
+
|
74
|
+
# Calculates hash code according to all attributes.
|
75
|
+
# @return [Fixnum] Hash code
|
76
|
+
def hash
|
77
|
+
[scaled].hash
|
78
|
+
end
|
79
|
+
|
80
|
+
# Builds the object from hash
|
81
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
82
|
+
# @return [Object] Returns the model itself
|
83
|
+
def build_from_hash(attributes)
|
84
|
+
return nil unless attributes.is_a?(Hash)
|
85
|
+
self.class.swagger_types.each_pair do |key, type|
|
86
|
+
if type =~ /\AArray<(.*)>/i
|
87
|
+
# check to ensure the input is an array given that the the attribute
|
88
|
+
# is documented as an array but the input is not
|
89
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
90
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
91
|
+
end
|
92
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
93
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
94
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
95
|
+
end
|
96
|
+
|
97
|
+
self
|
98
|
+
end
|
99
|
+
|
100
|
+
# Deserializes the data based on type
|
101
|
+
# @param string type Data type
|
102
|
+
# @param string value Value to be deserialized
|
103
|
+
# @return [Object] Deserialized data
|
104
|
+
def _deserialize(type, value)
|
105
|
+
case type.to_sym
|
106
|
+
when :DateTime
|
107
|
+
DateTime.parse(value)
|
108
|
+
when :Date
|
109
|
+
Date.parse(value)
|
110
|
+
when :String
|
111
|
+
value.to_s
|
112
|
+
when :Integer
|
113
|
+
value.to_i
|
114
|
+
when :Float
|
115
|
+
value.to_f
|
116
|
+
when :BOOLEAN
|
117
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
118
|
+
true
|
119
|
+
else
|
120
|
+
false
|
121
|
+
end
|
122
|
+
when :Object
|
123
|
+
# generic object (usually a Hash), return directly
|
124
|
+
value
|
125
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
126
|
+
inner_type = Regexp.last_match[:inner_type]
|
127
|
+
value.map { |v| _deserialize(inner_type, v) }
|
128
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
129
|
+
k_type = Regexp.last_match[:k_type]
|
130
|
+
v_type = Regexp.last_match[:v_type]
|
131
|
+
{}.tap do |hash|
|
132
|
+
value.each do |k, v|
|
133
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
134
|
+
end
|
135
|
+
end
|
136
|
+
else # model
|
137
|
+
temp_model = RusticiSoftwareCloudV2.const_get(type).new
|
138
|
+
temp_model.build_from_hash(value)
|
139
|
+
end
|
140
|
+
end
|
141
|
+
|
142
|
+
# Returns the string representation of the object
|
143
|
+
# @return [String] String presentation of the object
|
144
|
+
def to_s
|
145
|
+
to_hash.to_s
|
146
|
+
end
|
147
|
+
|
148
|
+
# to_body is an alias to to_hash (backward compatibility)
|
149
|
+
# @return [Hash] Returns the object in the form of hash
|
150
|
+
def to_body
|
151
|
+
to_hash
|
152
|
+
end
|
153
|
+
|
154
|
+
# Returns the object in the form of hash
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
156
|
+
def to_hash
|
157
|
+
hash = {}
|
158
|
+
self.class.attribute_map.each_pair do |attr, param|
|
159
|
+
value = self.send(attr)
|
160
|
+
next if value.nil?
|
161
|
+
hash[param] = _to_hash(value)
|
162
|
+
end
|
163
|
+
hash
|
164
|
+
end
|
165
|
+
|
166
|
+
# Outputs non-array value in the form of hash
|
167
|
+
# For object, use to_hash. Otherwise, just return the value
|
168
|
+
# @param [Object] value Any valid value
|
169
|
+
# @return [Hash] Returns the value in the form of hash
|
170
|
+
def _to_hash(value)
|
171
|
+
if value.is_a?(Array)
|
172
|
+
value.compact.map { |v| _to_hash(v) }
|
173
|
+
elsif value.is_a?(Hash)
|
174
|
+
{}.tap do |hash|
|
175
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
176
|
+
end
|
177
|
+
elsif value.respond_to? :to_hash
|
178
|
+
value.to_hash
|
179
|
+
else
|
180
|
+
value
|
181
|
+
end
|
182
|
+
end
|
183
|
+
end
|
184
|
+
end
|
@@ -0,0 +1,256 @@
|
|
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 SettingItem
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
# The value of this setting that would be used if read at this level, including defaults, fallback, and values set at less specific levels.
|
20
|
+
attr_accessor :effective_value
|
21
|
+
|
22
|
+
# The source of this effective value, default, fallback, or the level the value was set at.
|
23
|
+
attr_accessor :effective_value_source
|
24
|
+
|
25
|
+
# The value of this setting that is explicitly set at this level. If not present, the setting is not specified at this level.
|
26
|
+
attr_accessor :explicit_value
|
27
|
+
|
28
|
+
attr_accessor :metadata
|
29
|
+
|
30
|
+
class EnumAttributeValidator
|
31
|
+
attr_reader :datatype
|
32
|
+
attr_reader :allowable_values
|
33
|
+
|
34
|
+
def initialize(datatype, allowable_values)
|
35
|
+
@allowable_values = allowable_values.map do |value|
|
36
|
+
case datatype.to_s
|
37
|
+
when /Integer/i
|
38
|
+
value.to_i
|
39
|
+
when /Float/i
|
40
|
+
value.to_f
|
41
|
+
else
|
42
|
+
value
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
def valid?(value)
|
48
|
+
!value || allowable_values.include?(value)
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
53
|
+
def self.attribute_map
|
54
|
+
{
|
55
|
+
:'id' => :'id',
|
56
|
+
:'effective_value' => :'effectiveValue',
|
57
|
+
:'effective_value_source' => :'effectiveValueSource',
|
58
|
+
:'explicit_value' => :'explicitValue',
|
59
|
+
:'metadata' => :'metadata'
|
60
|
+
}
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute type mapping.
|
64
|
+
def self.swagger_types
|
65
|
+
{
|
66
|
+
:'id' => :'String',
|
67
|
+
:'effective_value' => :'String',
|
68
|
+
:'effective_value_source' => :'String',
|
69
|
+
:'explicit_value' => :'String',
|
70
|
+
:'metadata' => :'SettingMetadata'
|
71
|
+
}
|
72
|
+
end
|
73
|
+
|
74
|
+
# Initializes the object
|
75
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
76
|
+
def initialize(attributes = {})
|
77
|
+
return unless attributes.is_a?(Hash)
|
78
|
+
|
79
|
+
# convert string to symbol for hash key
|
80
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
81
|
+
|
82
|
+
if attributes.has_key?(:'id')
|
83
|
+
self.id = attributes[:'id']
|
84
|
+
end
|
85
|
+
|
86
|
+
if attributes.has_key?(:'effectiveValue')
|
87
|
+
self.effective_value = attributes[:'effectiveValue']
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.has_key?(:'effectiveValueSource')
|
91
|
+
self.effective_value_source = attributes[:'effectiveValueSource']
|
92
|
+
end
|
93
|
+
|
94
|
+
if attributes.has_key?(:'explicitValue')
|
95
|
+
self.explicit_value = attributes[:'explicitValue']
|
96
|
+
end
|
97
|
+
|
98
|
+
if attributes.has_key?(:'metadata')
|
99
|
+
self.metadata = attributes[:'metadata']
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
104
|
+
# @return Array for valid properties with the reasons
|
105
|
+
def list_invalid_properties
|
106
|
+
invalid_properties = Array.new
|
107
|
+
invalid_properties
|
108
|
+
end
|
109
|
+
|
110
|
+
# Check to see if the all the properties in the model are valid
|
111
|
+
# @return true if the model is valid
|
112
|
+
def valid?
|
113
|
+
effective_value_source_validator = EnumAttributeValidator.new('String', ['default', 'fallback', 'base', 'system', 'learningStandard', 'application', 'learningStandardForApplication', 'dispatchDestination', 'course', 'dispatchDestinationForCourse', 'registration'])
|
114
|
+
return false unless effective_value_source_validator.valid?(@effective_value_source)
|
115
|
+
true
|
116
|
+
end
|
117
|
+
|
118
|
+
# Custom attribute writer method checking allowed values (enum).
|
119
|
+
# @param [Object] effective_value_source Object to be assigned
|
120
|
+
def effective_value_source=(effective_value_source)
|
121
|
+
validator = EnumAttributeValidator.new('String', ['default', 'fallback', 'base', 'system', 'learningStandard', 'application', 'learningStandardForApplication', 'dispatchDestination', 'course', 'dispatchDestinationForCourse', 'registration'])
|
122
|
+
unless validator.valid?(effective_value_source)
|
123
|
+
fail ArgumentError, 'invalid value for "effective_value_source", must be one of #{validator.allowable_values}.'
|
124
|
+
end
|
125
|
+
@effective_value_source = effective_value_source
|
126
|
+
end
|
127
|
+
|
128
|
+
# Checks equality by comparing each attribute.
|
129
|
+
# @param [Object] Object to be compared
|
130
|
+
def ==(o)
|
131
|
+
return true if self.equal?(o)
|
132
|
+
self.class == o.class &&
|
133
|
+
id == o.id &&
|
134
|
+
effective_value == o.effective_value &&
|
135
|
+
effective_value_source == o.effective_value_source &&
|
136
|
+
explicit_value == o.explicit_value &&
|
137
|
+
metadata == o.metadata
|
138
|
+
end
|
139
|
+
|
140
|
+
# @see the `==` method
|
141
|
+
# @param [Object] Object to be compared
|
142
|
+
def eql?(o)
|
143
|
+
self == o
|
144
|
+
end
|
145
|
+
|
146
|
+
# Calculates hash code according to all attributes.
|
147
|
+
# @return [Fixnum] Hash code
|
148
|
+
def hash
|
149
|
+
[id, effective_value, effective_value_source, explicit_value, metadata].hash
|
150
|
+
end
|
151
|
+
|
152
|
+
# Builds the object from hash
|
153
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
154
|
+
# @return [Object] Returns the model itself
|
155
|
+
def build_from_hash(attributes)
|
156
|
+
return nil unless attributes.is_a?(Hash)
|
157
|
+
self.class.swagger_types.each_pair do |key, type|
|
158
|
+
if type =~ /\AArray<(.*)>/i
|
159
|
+
# check to ensure the input is an array given that the the attribute
|
160
|
+
# is documented as an array but the input is not
|
161
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
162
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
163
|
+
end
|
164
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
165
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
166
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
167
|
+
end
|
168
|
+
|
169
|
+
self
|
170
|
+
end
|
171
|
+
|
172
|
+
# Deserializes the data based on type
|
173
|
+
# @param string type Data type
|
174
|
+
# @param string value Value to be deserialized
|
175
|
+
# @return [Object] Deserialized data
|
176
|
+
def _deserialize(type, value)
|
177
|
+
case type.to_sym
|
178
|
+
when :DateTime
|
179
|
+
DateTime.parse(value)
|
180
|
+
when :Date
|
181
|
+
Date.parse(value)
|
182
|
+
when :String
|
183
|
+
value.to_s
|
184
|
+
when :Integer
|
185
|
+
value.to_i
|
186
|
+
when :Float
|
187
|
+
value.to_f
|
188
|
+
when :BOOLEAN
|
189
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
190
|
+
true
|
191
|
+
else
|
192
|
+
false
|
193
|
+
end
|
194
|
+
when :Object
|
195
|
+
# generic object (usually a Hash), return directly
|
196
|
+
value
|
197
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
198
|
+
inner_type = Regexp.last_match[:inner_type]
|
199
|
+
value.map { |v| _deserialize(inner_type, v) }
|
200
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
201
|
+
k_type = Regexp.last_match[:k_type]
|
202
|
+
v_type = Regexp.last_match[:v_type]
|
203
|
+
{}.tap do |hash|
|
204
|
+
value.each do |k, v|
|
205
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
206
|
+
end
|
207
|
+
end
|
208
|
+
else # model
|
209
|
+
temp_model = RusticiSoftwareCloudV2.const_get(type).new
|
210
|
+
temp_model.build_from_hash(value)
|
211
|
+
end
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns the string representation of the object
|
215
|
+
# @return [String] String presentation of the object
|
216
|
+
def to_s
|
217
|
+
to_hash.to_s
|
218
|
+
end
|
219
|
+
|
220
|
+
# to_body is an alias to to_hash (backward compatibility)
|
221
|
+
# @return [Hash] Returns the object in the form of hash
|
222
|
+
def to_body
|
223
|
+
to_hash
|
224
|
+
end
|
225
|
+
|
226
|
+
# Returns the object in the form of hash
|
227
|
+
# @return [Hash] Returns the object in the form of hash
|
228
|
+
def to_hash
|
229
|
+
hash = {}
|
230
|
+
self.class.attribute_map.each_pair do |attr, param|
|
231
|
+
value = self.send(attr)
|
232
|
+
next if value.nil?
|
233
|
+
hash[param] = _to_hash(value)
|
234
|
+
end
|
235
|
+
hash
|
236
|
+
end
|
237
|
+
|
238
|
+
# Outputs non-array value in the form of hash
|
239
|
+
# For object, use to_hash. Otherwise, just return the value
|
240
|
+
# @param [Object] value Any valid value
|
241
|
+
# @return [Hash] Returns the value in the form of hash
|
242
|
+
def _to_hash(value)
|
243
|
+
if value.is_a?(Array)
|
244
|
+
value.compact.map { |v| _to_hash(v) }
|
245
|
+
elsif value.is_a?(Hash)
|
246
|
+
{}.tap do |hash|
|
247
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
248
|
+
end
|
249
|
+
elsif value.respond_to? :to_hash
|
250
|
+
value.to_hash
|
251
|
+
else
|
252
|
+
value
|
253
|
+
end
|
254
|
+
end
|
255
|
+
end
|
256
|
+
end
|
@@ -0,0 +1,190 @@
|
|
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 SettingListSchema
|
17
|
+
attr_accessor :setting_items
|
18
|
+
|
19
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
20
|
+
def self.attribute_map
|
21
|
+
{
|
22
|
+
:'setting_items' => :'settingItems'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
# Attribute type mapping.
|
27
|
+
def self.swagger_types
|
28
|
+
{
|
29
|
+
:'setting_items' => :'Array<SettingItem>'
|
30
|
+
}
|
31
|
+
end
|
32
|
+
|
33
|
+
# Initializes the object
|
34
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
35
|
+
def initialize(attributes = {})
|
36
|
+
return unless attributes.is_a?(Hash)
|
37
|
+
|
38
|
+
# convert string to symbol for hash key
|
39
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
40
|
+
|
41
|
+
if attributes.has_key?(:'settingItems')
|
42
|
+
if (value = attributes[:'settingItems']).is_a?(Array)
|
43
|
+
self.setting_items = value
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
49
|
+
# @return Array for valid properties with the reasons
|
50
|
+
def list_invalid_properties
|
51
|
+
invalid_properties = Array.new
|
52
|
+
if @setting_items.nil?
|
53
|
+
invalid_properties.push('invalid value for "setting_items", setting_items cannot be nil.')
|
54
|
+
end
|
55
|
+
|
56
|
+
invalid_properties
|
57
|
+
end
|
58
|
+
|
59
|
+
# Check to see if the all the properties in the model are valid
|
60
|
+
# @return true if the model is valid
|
61
|
+
def valid?
|
62
|
+
return false if @setting_items.nil?
|
63
|
+
true
|
64
|
+
end
|
65
|
+
|
66
|
+
# Checks equality by comparing each attribute.
|
67
|
+
# @param [Object] Object to be compared
|
68
|
+
def ==(o)
|
69
|
+
return true if self.equal?(o)
|
70
|
+
self.class == o.class &&
|
71
|
+
setting_items == o.setting_items
|
72
|
+
end
|
73
|
+
|
74
|
+
# @see the `==` method
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def eql?(o)
|
77
|
+
self == o
|
78
|
+
end
|
79
|
+
|
80
|
+
# Calculates hash code according to all attributes.
|
81
|
+
# @return [Fixnum] Hash code
|
82
|
+
def hash
|
83
|
+
[setting_items].hash
|
84
|
+
end
|
85
|
+
|
86
|
+
# Builds the object from hash
|
87
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
88
|
+
# @return [Object] Returns the model itself
|
89
|
+
def build_from_hash(attributes)
|
90
|
+
return nil unless attributes.is_a?(Hash)
|
91
|
+
self.class.swagger_types.each_pair do |key, type|
|
92
|
+
if type =~ /\AArray<(.*)>/i
|
93
|
+
# check to ensure the input is an array given that the the attribute
|
94
|
+
# is documented as an array but the input is not
|
95
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
96
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
97
|
+
end
|
98
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
99
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
100
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
101
|
+
end
|
102
|
+
|
103
|
+
self
|
104
|
+
end
|
105
|
+
|
106
|
+
# Deserializes the data based on type
|
107
|
+
# @param string type Data type
|
108
|
+
# @param string value Value to be deserialized
|
109
|
+
# @return [Object] Deserialized data
|
110
|
+
def _deserialize(type, value)
|
111
|
+
case type.to_sym
|
112
|
+
when :DateTime
|
113
|
+
DateTime.parse(value)
|
114
|
+
when :Date
|
115
|
+
Date.parse(value)
|
116
|
+
when :String
|
117
|
+
value.to_s
|
118
|
+
when :Integer
|
119
|
+
value.to_i
|
120
|
+
when :Float
|
121
|
+
value.to_f
|
122
|
+
when :BOOLEAN
|
123
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
124
|
+
true
|
125
|
+
else
|
126
|
+
false
|
127
|
+
end
|
128
|
+
when :Object
|
129
|
+
# generic object (usually a Hash), return directly
|
130
|
+
value
|
131
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
132
|
+
inner_type = Regexp.last_match[:inner_type]
|
133
|
+
value.map { |v| _deserialize(inner_type, v) }
|
134
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
135
|
+
k_type = Regexp.last_match[:k_type]
|
136
|
+
v_type = Regexp.last_match[:v_type]
|
137
|
+
{}.tap do |hash|
|
138
|
+
value.each do |k, v|
|
139
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
140
|
+
end
|
141
|
+
end
|
142
|
+
else # model
|
143
|
+
temp_model = RusticiSoftwareCloudV2.const_get(type).new
|
144
|
+
temp_model.build_from_hash(value)
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
# Returns the string representation of the object
|
149
|
+
# @return [String] String presentation of the object
|
150
|
+
def to_s
|
151
|
+
to_hash.to_s
|
152
|
+
end
|
153
|
+
|
154
|
+
# to_body is an alias to to_hash (backward compatibility)
|
155
|
+
# @return [Hash] Returns the object in the form of hash
|
156
|
+
def to_body
|
157
|
+
to_hash
|
158
|
+
end
|
159
|
+
|
160
|
+
# Returns the object in the form of hash
|
161
|
+
# @return [Hash] Returns the object in the form of hash
|
162
|
+
def to_hash
|
163
|
+
hash = {}
|
164
|
+
self.class.attribute_map.each_pair do |attr, param|
|
165
|
+
value = self.send(attr)
|
166
|
+
next if value.nil?
|
167
|
+
hash[param] = _to_hash(value)
|
168
|
+
end
|
169
|
+
hash
|
170
|
+
end
|
171
|
+
|
172
|
+
# Outputs non-array value in the form of hash
|
173
|
+
# For object, use to_hash. Otherwise, just return the value
|
174
|
+
# @param [Object] value Any valid value
|
175
|
+
# @return [Hash] Returns the value in the form of hash
|
176
|
+
def _to_hash(value)
|
177
|
+
if value.is_a?(Array)
|
178
|
+
value.compact.map { |v| _to_hash(v) }
|
179
|
+
elsif value.is_a?(Hash)
|
180
|
+
{}.tap do |hash|
|
181
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
182
|
+
end
|
183
|
+
elsif value.respond_to? :to_hash
|
184
|
+
value.to_hash
|
185
|
+
else
|
186
|
+
value
|
187
|
+
end
|
188
|
+
end
|
189
|
+
end
|
190
|
+
end
|