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,294 @@
|
|
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 SettingMetadata
|
17
|
+
# Default value of this setting
|
18
|
+
attr_accessor :default
|
19
|
+
|
20
|
+
# The data type of this setting
|
21
|
+
attr_accessor :data_type
|
22
|
+
|
23
|
+
# description of this setting
|
24
|
+
attr_accessor :setting_description
|
25
|
+
|
26
|
+
# The level this setting will be applied at, which limits where it can be set. For example, WebPathToContentRoot is applied at the application level, so it's not valid to set it for a registration.
|
27
|
+
attr_accessor :level
|
28
|
+
|
29
|
+
# The list of learning standards this setting applies to. If not present, this setting is not limited to certain learning standards.
|
30
|
+
attr_accessor :learning_standards
|
31
|
+
|
32
|
+
# Does this setting apply to only single-SCO packages, only multi-SCO, or either?
|
33
|
+
attr_accessor :learning_standard_variant
|
34
|
+
|
35
|
+
# A setting that will be used instead of this setting if no value is provided for this setting (This is similar to a default, except that the the value of another setting is being used instead of a fixed default value).
|
36
|
+
attr_accessor :fallback
|
37
|
+
|
38
|
+
# For settings with a fixed list of valid values, the list of those values
|
39
|
+
attr_accessor :valid_values
|
40
|
+
|
41
|
+
class EnumAttributeValidator
|
42
|
+
attr_reader :datatype
|
43
|
+
attr_reader :allowable_values
|
44
|
+
|
45
|
+
def initialize(datatype, allowable_values)
|
46
|
+
@allowable_values = allowable_values.map do |value|
|
47
|
+
case datatype.to_s
|
48
|
+
when /Integer/i
|
49
|
+
value.to_i
|
50
|
+
when /Float/i
|
51
|
+
value.to_f
|
52
|
+
else
|
53
|
+
value
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
58
|
+
def valid?(value)
|
59
|
+
!value || allowable_values.include?(value)
|
60
|
+
end
|
61
|
+
end
|
62
|
+
|
63
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
64
|
+
def self.attribute_map
|
65
|
+
{
|
66
|
+
:'default' => :'default',
|
67
|
+
:'data_type' => :'dataType',
|
68
|
+
:'setting_description' => :'settingDescription',
|
69
|
+
:'level' => :'level',
|
70
|
+
:'learning_standards' => :'learningStandards',
|
71
|
+
:'learning_standard_variant' => :'learningStandardVariant',
|
72
|
+
:'fallback' => :'fallback',
|
73
|
+
:'valid_values' => :'validValues'
|
74
|
+
}
|
75
|
+
end
|
76
|
+
|
77
|
+
# Attribute type mapping.
|
78
|
+
def self.swagger_types
|
79
|
+
{
|
80
|
+
:'default' => :'String',
|
81
|
+
:'data_type' => :'String',
|
82
|
+
:'setting_description' => :'String',
|
83
|
+
:'level' => :'String',
|
84
|
+
:'learning_standards' => :'Array<String>',
|
85
|
+
:'learning_standard_variant' => :'String',
|
86
|
+
:'fallback' => :'String',
|
87
|
+
:'valid_values' => :'Array<SettingValidValue>'
|
88
|
+
}
|
89
|
+
end
|
90
|
+
|
91
|
+
# Initializes the object
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
93
|
+
def initialize(attributes = {})
|
94
|
+
return unless attributes.is_a?(Hash)
|
95
|
+
|
96
|
+
# convert string to symbol for hash key
|
97
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
98
|
+
|
99
|
+
if attributes.has_key?(:'default')
|
100
|
+
self.default = attributes[:'default']
|
101
|
+
end
|
102
|
+
|
103
|
+
if attributes.has_key?(:'dataType')
|
104
|
+
self.data_type = attributes[:'dataType']
|
105
|
+
end
|
106
|
+
|
107
|
+
if attributes.has_key?(:'settingDescription')
|
108
|
+
self.setting_description = attributes[:'settingDescription']
|
109
|
+
end
|
110
|
+
|
111
|
+
if attributes.has_key?(:'level')
|
112
|
+
self.level = attributes[:'level']
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.has_key?(:'learningStandards')
|
116
|
+
if (value = attributes[:'learningStandards']).is_a?(Array)
|
117
|
+
self.learning_standards = value
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.has_key?(:'learningStandardVariant')
|
122
|
+
self.learning_standard_variant = attributes[:'learningStandardVariant']
|
123
|
+
else
|
124
|
+
self.learning_standard_variant = 'either'
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'fallback')
|
128
|
+
self.fallback = attributes[:'fallback']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.has_key?(:'validValues')
|
132
|
+
if (value = attributes[:'validValues']).is_a?(Array)
|
133
|
+
self.valid_values = value
|
134
|
+
end
|
135
|
+
end
|
136
|
+
end
|
137
|
+
|
138
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
139
|
+
# @return Array for valid properties with the reasons
|
140
|
+
def list_invalid_properties
|
141
|
+
invalid_properties = Array.new
|
142
|
+
invalid_properties
|
143
|
+
end
|
144
|
+
|
145
|
+
# Check to see if the all the properties in the model are valid
|
146
|
+
# @return true if the model is valid
|
147
|
+
def valid?
|
148
|
+
learning_standard_variant_validator = EnumAttributeValidator.new('String', ['singleScoOnly', 'multiScoOnly', 'either'])
|
149
|
+
return false unless learning_standard_variant_validator.valid?(@learning_standard_variant)
|
150
|
+
true
|
151
|
+
end
|
152
|
+
|
153
|
+
# Custom attribute writer method checking allowed values (enum).
|
154
|
+
# @param [Object] learning_standard_variant Object to be assigned
|
155
|
+
def learning_standard_variant=(learning_standard_variant)
|
156
|
+
validator = EnumAttributeValidator.new('String', ['singleScoOnly', 'multiScoOnly', 'either'])
|
157
|
+
unless validator.valid?(learning_standard_variant)
|
158
|
+
fail ArgumentError, 'invalid value for "learning_standard_variant", must be one of #{validator.allowable_values}.'
|
159
|
+
end
|
160
|
+
@learning_standard_variant = learning_standard_variant
|
161
|
+
end
|
162
|
+
|
163
|
+
# Checks equality by comparing each attribute.
|
164
|
+
# @param [Object] Object to be compared
|
165
|
+
def ==(o)
|
166
|
+
return true if self.equal?(o)
|
167
|
+
self.class == o.class &&
|
168
|
+
default == o.default &&
|
169
|
+
data_type == o.data_type &&
|
170
|
+
setting_description == o.setting_description &&
|
171
|
+
level == o.level &&
|
172
|
+
learning_standards == o.learning_standards &&
|
173
|
+
learning_standard_variant == o.learning_standard_variant &&
|
174
|
+
fallback == o.fallback &&
|
175
|
+
valid_values == o.valid_values
|
176
|
+
end
|
177
|
+
|
178
|
+
# @see the `==` method
|
179
|
+
# @param [Object] Object to be compared
|
180
|
+
def eql?(o)
|
181
|
+
self == o
|
182
|
+
end
|
183
|
+
|
184
|
+
# Calculates hash code according to all attributes.
|
185
|
+
# @return [Fixnum] Hash code
|
186
|
+
def hash
|
187
|
+
[default, data_type, setting_description, level, learning_standards, learning_standard_variant, fallback, valid_values].hash
|
188
|
+
end
|
189
|
+
|
190
|
+
# Builds the object from hash
|
191
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
192
|
+
# @return [Object] Returns the model itself
|
193
|
+
def build_from_hash(attributes)
|
194
|
+
return nil unless attributes.is_a?(Hash)
|
195
|
+
self.class.swagger_types.each_pair do |key, type|
|
196
|
+
if type =~ /\AArray<(.*)>/i
|
197
|
+
# check to ensure the input is an array given that the the attribute
|
198
|
+
# is documented as an array but the input is not
|
199
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
200
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
201
|
+
end
|
202
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
203
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
204
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
205
|
+
end
|
206
|
+
|
207
|
+
self
|
208
|
+
end
|
209
|
+
|
210
|
+
# Deserializes the data based on type
|
211
|
+
# @param string type Data type
|
212
|
+
# @param string value Value to be deserialized
|
213
|
+
# @return [Object] Deserialized data
|
214
|
+
def _deserialize(type, value)
|
215
|
+
case type.to_sym
|
216
|
+
when :DateTime
|
217
|
+
DateTime.parse(value)
|
218
|
+
when :Date
|
219
|
+
Date.parse(value)
|
220
|
+
when :String
|
221
|
+
value.to_s
|
222
|
+
when :Integer
|
223
|
+
value.to_i
|
224
|
+
when :Float
|
225
|
+
value.to_f
|
226
|
+
when :BOOLEAN
|
227
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
228
|
+
true
|
229
|
+
else
|
230
|
+
false
|
231
|
+
end
|
232
|
+
when :Object
|
233
|
+
# generic object (usually a Hash), return directly
|
234
|
+
value
|
235
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
236
|
+
inner_type = Regexp.last_match[:inner_type]
|
237
|
+
value.map { |v| _deserialize(inner_type, v) }
|
238
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
239
|
+
k_type = Regexp.last_match[:k_type]
|
240
|
+
v_type = Regexp.last_match[:v_type]
|
241
|
+
{}.tap do |hash|
|
242
|
+
value.each do |k, v|
|
243
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
244
|
+
end
|
245
|
+
end
|
246
|
+
else # model
|
247
|
+
temp_model = RusticiSoftwareCloudV2.const_get(type).new
|
248
|
+
temp_model.build_from_hash(value)
|
249
|
+
end
|
250
|
+
end
|
251
|
+
|
252
|
+
# Returns the string representation of the object
|
253
|
+
# @return [String] String presentation of the object
|
254
|
+
def to_s
|
255
|
+
to_hash.to_s
|
256
|
+
end
|
257
|
+
|
258
|
+
# to_body is an alias to to_hash (backward compatibility)
|
259
|
+
# @return [Hash] Returns the object in the form of hash
|
260
|
+
def to_body
|
261
|
+
to_hash
|
262
|
+
end
|
263
|
+
|
264
|
+
# Returns the object in the form of hash
|
265
|
+
# @return [Hash] Returns the object in the form of hash
|
266
|
+
def to_hash
|
267
|
+
hash = {}
|
268
|
+
self.class.attribute_map.each_pair do |attr, param|
|
269
|
+
value = self.send(attr)
|
270
|
+
next if value.nil?
|
271
|
+
hash[param] = _to_hash(value)
|
272
|
+
end
|
273
|
+
hash
|
274
|
+
end
|
275
|
+
|
276
|
+
# Outputs non-array value in the form of hash
|
277
|
+
# For object, use to_hash. Otherwise, just return the value
|
278
|
+
# @param [Object] value Any valid value
|
279
|
+
# @return [Hash] Returns the value in the form of hash
|
280
|
+
def _to_hash(value)
|
281
|
+
if value.is_a?(Array)
|
282
|
+
value.compact.map { |v| _to_hash(v) }
|
283
|
+
elsif value.is_a?(Hash)
|
284
|
+
{}.tap do |hash|
|
285
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
286
|
+
end
|
287
|
+
elsif value.respond_to? :to_hash
|
288
|
+
value.to_hash
|
289
|
+
else
|
290
|
+
value
|
291
|
+
end
|
292
|
+
end
|
293
|
+
end
|
294
|
+
end
|
@@ -0,0 +1,209 @@
|
|
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
|
+
|
10
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
11
|
+
you may not use this file except in compliance with the License.
|
12
|
+
You may obtain a copy of the License at
|
13
|
+
|
14
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
15
|
+
|
16
|
+
Unless required by applicable law or agreed to in writing, software
|
17
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
18
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
19
|
+
See the License for the specific language governing permissions and
|
20
|
+
limitations under the License.
|
21
|
+
|
22
|
+
=end
|
23
|
+
|
24
|
+
require 'date'
|
25
|
+
|
26
|
+
module RusticiSoftwareCloudV2
|
27
|
+
|
28
|
+
class SettingMetadataValidValues
|
29
|
+
attr_accessor :value
|
30
|
+
|
31
|
+
# Description of what this valid value means, how it will be applied if used in a setting
|
32
|
+
attr_accessor :value_description
|
33
|
+
|
34
|
+
|
35
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
36
|
+
def self.attribute_map
|
37
|
+
{
|
38
|
+
:'value' => :'value',
|
39
|
+
:'value_description' => :'valueDescription'
|
40
|
+
}
|
41
|
+
end
|
42
|
+
|
43
|
+
# Attribute type mapping.
|
44
|
+
def self.swagger_types
|
45
|
+
{
|
46
|
+
:'value' => :'String',
|
47
|
+
:'value_description' => :'String'
|
48
|
+
}
|
49
|
+
end
|
50
|
+
|
51
|
+
# Initializes the object
|
52
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
53
|
+
def initialize(attributes = {})
|
54
|
+
return unless attributes.is_a?(Hash)
|
55
|
+
|
56
|
+
# convert string to symbol for hash key
|
57
|
+
attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
|
58
|
+
|
59
|
+
if attributes.has_key?(:'value')
|
60
|
+
self.value = attributes[:'value']
|
61
|
+
end
|
62
|
+
|
63
|
+
if attributes.has_key?(:'valueDescription')
|
64
|
+
self.value_description = attributes[:'valueDescription']
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
68
|
+
|
69
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
70
|
+
# @return Array for valid properies with the reasons
|
71
|
+
def list_invalid_properties
|
72
|
+
invalid_properties = Array.new
|
73
|
+
return invalid_properties
|
74
|
+
end
|
75
|
+
|
76
|
+
# Check to see if the all the properties in the model are valid
|
77
|
+
# @return true if the model is valid
|
78
|
+
def valid?
|
79
|
+
return true
|
80
|
+
end
|
81
|
+
|
82
|
+
# Checks equality by comparing each attribute.
|
83
|
+
# @param [Object] Object to be compared
|
84
|
+
def ==(o)
|
85
|
+
return true if self.equal?(o)
|
86
|
+
self.class == o.class &&
|
87
|
+
value == o.value &&
|
88
|
+
value_description == o.value_description
|
89
|
+
end
|
90
|
+
|
91
|
+
# @see the `==` method
|
92
|
+
# @param [Object] Object to be compared
|
93
|
+
def eql?(o)
|
94
|
+
self == o
|
95
|
+
end
|
96
|
+
|
97
|
+
# Calculates hash code according to all attributes.
|
98
|
+
# @return [Fixnum] Hash code
|
99
|
+
def hash
|
100
|
+
[value, value_description].hash
|
101
|
+
end
|
102
|
+
|
103
|
+
# Builds the object from hash
|
104
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
105
|
+
# @return [Object] Returns the model itself
|
106
|
+
def build_from_hash(attributes)
|
107
|
+
return nil unless attributes.is_a?(Hash)
|
108
|
+
self.class.swagger_types.each_pair do |key, type|
|
109
|
+
if type =~ /^Array<(.*)>/i
|
110
|
+
# check to ensure the input is an array given that the the attribute
|
111
|
+
# is documented as an array but the input is not
|
112
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
113
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
|
114
|
+
end
|
115
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
116
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
117
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
118
|
+
end
|
119
|
+
|
120
|
+
self
|
121
|
+
end
|
122
|
+
|
123
|
+
# Deserializes the data based on type
|
124
|
+
# @param string type Data type
|
125
|
+
# @param string value Value to be deserialized
|
126
|
+
# @return [Object] Deserialized data
|
127
|
+
def _deserialize(type, value)
|
128
|
+
case type.to_sym
|
129
|
+
when :DateTime
|
130
|
+
DateTime.parse(value)
|
131
|
+
when :Date
|
132
|
+
Date.parse(value)
|
133
|
+
when :String
|
134
|
+
value.to_s
|
135
|
+
when :Integer
|
136
|
+
value.to_i
|
137
|
+
when :Float
|
138
|
+
value.to_f
|
139
|
+
when :BOOLEAN
|
140
|
+
if value.to_s =~ /^(true|t|yes|y|1)$/i
|
141
|
+
true
|
142
|
+
else
|
143
|
+
false
|
144
|
+
end
|
145
|
+
when :Object
|
146
|
+
# generic object (usually a Hash), return directly
|
147
|
+
value
|
148
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
149
|
+
inner_type = Regexp.last_match[:inner_type]
|
150
|
+
value.map { |v| _deserialize(inner_type, v) }
|
151
|
+
when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
|
152
|
+
k_type = Regexp.last_match[:k_type]
|
153
|
+
v_type = Regexp.last_match[:v_type]
|
154
|
+
{}.tap do |hash|
|
155
|
+
value.each do |k, v|
|
156
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
else # model
|
160
|
+
temp_model = RusticiSoftwareCloudV2.const_get(type).new
|
161
|
+
temp_model.build_from_hash(value)
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
# Returns the string representation of the object
|
166
|
+
# @return [String] String presentation of the object
|
167
|
+
def to_s
|
168
|
+
to_hash.to_s
|
169
|
+
end
|
170
|
+
|
171
|
+
# to_body is an alias to to_hash (backward compatibility)
|
172
|
+
# @return [Hash] Returns the object in the form of hash
|
173
|
+
def to_body
|
174
|
+
to_hash
|
175
|
+
end
|
176
|
+
|
177
|
+
# Returns the object in the form of hash
|
178
|
+
# @return [Hash] Returns the object in the form of hash
|
179
|
+
def to_hash
|
180
|
+
hash = {}
|
181
|
+
self.class.attribute_map.each_pair do |attr, param|
|
182
|
+
value = self.send(attr)
|
183
|
+
next if value.nil?
|
184
|
+
hash[param] = _to_hash(value)
|
185
|
+
end
|
186
|
+
hash
|
187
|
+
end
|
188
|
+
|
189
|
+
# Outputs non-array value in the form of hash
|
190
|
+
# For object, use to_hash. Otherwise, just return the value
|
191
|
+
# @param [Object] value Any valid value
|
192
|
+
# @return [Hash] Returns the value in the form of hash
|
193
|
+
def _to_hash(value)
|
194
|
+
if value.is_a?(Array)
|
195
|
+
value.compact.map{ |v| _to_hash(v) }
|
196
|
+
elsif value.is_a?(Hash)
|
197
|
+
{}.tap do |hash|
|
198
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
199
|
+
end
|
200
|
+
elsif value.respond_to? :to_hash
|
201
|
+
value.to_hash
|
202
|
+
else
|
203
|
+
value
|
204
|
+
end
|
205
|
+
end
|
206
|
+
|
207
|
+
end
|
208
|
+
|
209
|
+
end
|