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,31 @@
|
|
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 RegistrationCompletion
|
17
|
+
|
18
|
+
UNKNOWN = 'UNKNOWN'.freeze
|
19
|
+
COMPLETED = 'COMPLETED'.freeze
|
20
|
+
INCOMPLETE = 'INCOMPLETE'.freeze
|
21
|
+
|
22
|
+
# Builds the enum from string
|
23
|
+
# @param [String] The enum value in the form of the string
|
24
|
+
# @return [String] The enum value
|
25
|
+
def build_from_hash(value)
|
26
|
+
constantValues = RegistrationCompletion.constants.select { |c| RegistrationCompletion::const_get(c) == value }
|
27
|
+
raise "Invalid ENUM value #{value} for class #RegistrationCompletion" if constantValues.empty?
|
28
|
+
value
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,199 @@
|
|
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 RegistrationListSchema
|
17
|
+
attr_accessor :registrations
|
18
|
+
|
19
|
+
attr_accessor :more
|
20
|
+
|
21
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
22
|
+
def self.attribute_map
|
23
|
+
{
|
24
|
+
:'registrations' => :'registrations',
|
25
|
+
:'more' => :'more'
|
26
|
+
}
|
27
|
+
end
|
28
|
+
|
29
|
+
# Attribute type mapping.
|
30
|
+
def self.swagger_types
|
31
|
+
{
|
32
|
+
:'registrations' => :'Array<RegistrationSchema>',
|
33
|
+
:'more' => :'String'
|
34
|
+
}
|
35
|
+
end
|
36
|
+
|
37
|
+
# Initializes the object
|
38
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
39
|
+
def initialize(attributes = {})
|
40
|
+
return unless attributes.is_a?(Hash)
|
41
|
+
|
42
|
+
# convert string to symbol for hash key
|
43
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
44
|
+
|
45
|
+
if attributes.has_key?(:'registrations')
|
46
|
+
if (value = attributes[:'registrations']).is_a?(Array)
|
47
|
+
self.registrations = value
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
51
|
+
if attributes.has_key?(:'more')
|
52
|
+
self.more = attributes[:'more']
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
57
|
+
# @return Array for valid properties with the reasons
|
58
|
+
def list_invalid_properties
|
59
|
+
invalid_properties = Array.new
|
60
|
+
if @registrations.nil?
|
61
|
+
invalid_properties.push('invalid value for "registrations", registrations cannot be nil.')
|
62
|
+
end
|
63
|
+
|
64
|
+
invalid_properties
|
65
|
+
end
|
66
|
+
|
67
|
+
# Check to see if the all the properties in the model are valid
|
68
|
+
# @return true if the model is valid
|
69
|
+
def valid?
|
70
|
+
return false if @registrations.nil?
|
71
|
+
true
|
72
|
+
end
|
73
|
+
|
74
|
+
# Checks equality by comparing each attribute.
|
75
|
+
# @param [Object] Object to be compared
|
76
|
+
def ==(o)
|
77
|
+
return true if self.equal?(o)
|
78
|
+
self.class == o.class &&
|
79
|
+
registrations == o.registrations &&
|
80
|
+
more == o.more
|
81
|
+
end
|
82
|
+
|
83
|
+
# @see the `==` method
|
84
|
+
# @param [Object] Object to be compared
|
85
|
+
def eql?(o)
|
86
|
+
self == o
|
87
|
+
end
|
88
|
+
|
89
|
+
# Calculates hash code according to all attributes.
|
90
|
+
# @return [Fixnum] Hash code
|
91
|
+
def hash
|
92
|
+
[registrations, more].hash
|
93
|
+
end
|
94
|
+
|
95
|
+
# Builds the object from hash
|
96
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
97
|
+
# @return [Object] Returns the model itself
|
98
|
+
def build_from_hash(attributes)
|
99
|
+
return nil unless attributes.is_a?(Hash)
|
100
|
+
self.class.swagger_types.each_pair do |key, type|
|
101
|
+
if type =~ /\AArray<(.*)>/i
|
102
|
+
# check to ensure the input is an array given that the the attribute
|
103
|
+
# is documented as an array but the input is not
|
104
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
105
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
106
|
+
end
|
107
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
108
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
109
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
110
|
+
end
|
111
|
+
|
112
|
+
self
|
113
|
+
end
|
114
|
+
|
115
|
+
# Deserializes the data based on type
|
116
|
+
# @param string type Data type
|
117
|
+
# @param string value Value to be deserialized
|
118
|
+
# @return [Object] Deserialized data
|
119
|
+
def _deserialize(type, value)
|
120
|
+
case type.to_sym
|
121
|
+
when :DateTime
|
122
|
+
DateTime.parse(value)
|
123
|
+
when :Date
|
124
|
+
Date.parse(value)
|
125
|
+
when :String
|
126
|
+
value.to_s
|
127
|
+
when :Integer
|
128
|
+
value.to_i
|
129
|
+
when :Float
|
130
|
+
value.to_f
|
131
|
+
when :BOOLEAN
|
132
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
133
|
+
true
|
134
|
+
else
|
135
|
+
false
|
136
|
+
end
|
137
|
+
when :Object
|
138
|
+
# generic object (usually a Hash), return directly
|
139
|
+
value
|
140
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
141
|
+
inner_type = Regexp.last_match[:inner_type]
|
142
|
+
value.map { |v| _deserialize(inner_type, v) }
|
143
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
144
|
+
k_type = Regexp.last_match[:k_type]
|
145
|
+
v_type = Regexp.last_match[:v_type]
|
146
|
+
{}.tap do |hash|
|
147
|
+
value.each do |k, v|
|
148
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
149
|
+
end
|
150
|
+
end
|
151
|
+
else # model
|
152
|
+
temp_model = RusticiSoftwareCloudV2.const_get(type).new
|
153
|
+
temp_model.build_from_hash(value)
|
154
|
+
end
|
155
|
+
end
|
156
|
+
|
157
|
+
# Returns the string representation of the object
|
158
|
+
# @return [String] String presentation of the object
|
159
|
+
def to_s
|
160
|
+
to_hash.to_s
|
161
|
+
end
|
162
|
+
|
163
|
+
# to_body is an alias to to_hash (backward compatibility)
|
164
|
+
# @return [Hash] Returns the object in the form of hash
|
165
|
+
def to_body
|
166
|
+
to_hash
|
167
|
+
end
|
168
|
+
|
169
|
+
# Returns the object in the form of hash
|
170
|
+
# @return [Hash] Returns the object in the form of hash
|
171
|
+
def to_hash
|
172
|
+
hash = {}
|
173
|
+
self.class.attribute_map.each_pair do |attr, param|
|
174
|
+
value = self.send(attr)
|
175
|
+
next if value.nil?
|
176
|
+
hash[param] = _to_hash(value)
|
177
|
+
end
|
178
|
+
hash
|
179
|
+
end
|
180
|
+
|
181
|
+
# Outputs non-array value in the form of hash
|
182
|
+
# For object, use to_hash. Otherwise, just return the value
|
183
|
+
# @param [Object] value Any valid value
|
184
|
+
# @return [Hash] Returns the value in the form of hash
|
185
|
+
def _to_hash(value)
|
186
|
+
if value.is_a?(Array)
|
187
|
+
value.compact.map { |v| _to_hash(v) }
|
188
|
+
elsif value.is_a?(Hash)
|
189
|
+
{}.tap do |hash|
|
190
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
191
|
+
end
|
192
|
+
elsif value.respond_to? :to_hash
|
193
|
+
value.to_hash
|
194
|
+
else
|
195
|
+
value
|
196
|
+
end
|
197
|
+
end
|
198
|
+
end
|
199
|
+
end
|
@@ -0,0 +1,360 @@
|
|
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 RegistrationSchema
|
17
|
+
attr_accessor :id
|
18
|
+
|
19
|
+
attr_accessor :instance
|
20
|
+
|
21
|
+
# xAPI registration id associated with this registration
|
22
|
+
attr_accessor :xapi_registration_id
|
23
|
+
|
24
|
+
# Dispatch ID for this registration, if applicable
|
25
|
+
attr_accessor :dispatch_id
|
26
|
+
|
27
|
+
attr_accessor :updated
|
28
|
+
|
29
|
+
attr_accessor :registration_completion
|
30
|
+
|
31
|
+
attr_accessor :registration_completion_amount
|
32
|
+
|
33
|
+
attr_accessor :registration_success
|
34
|
+
|
35
|
+
attr_accessor :score
|
36
|
+
|
37
|
+
attr_accessor :total_seconds_tracked
|
38
|
+
|
39
|
+
attr_accessor :first_access_date
|
40
|
+
|
41
|
+
attr_accessor :last_access_date
|
42
|
+
|
43
|
+
attr_accessor :completed_date
|
44
|
+
|
45
|
+
attr_accessor :created_date
|
46
|
+
|
47
|
+
attr_accessor :course
|
48
|
+
|
49
|
+
attr_accessor :learner
|
50
|
+
|
51
|
+
attr_accessor :global_objectives
|
52
|
+
|
53
|
+
attr_accessor :shared_data
|
54
|
+
|
55
|
+
attr_accessor :suspended_activity_id
|
56
|
+
|
57
|
+
attr_accessor :activity_details
|
58
|
+
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
60
|
+
def self.attribute_map
|
61
|
+
{
|
62
|
+
:'id' => :'id',
|
63
|
+
:'instance' => :'instance',
|
64
|
+
:'xapi_registration_id' => :'xapiRegistrationId',
|
65
|
+
:'dispatch_id' => :'dispatchId',
|
66
|
+
:'updated' => :'updated',
|
67
|
+
:'registration_completion' => :'registrationCompletion',
|
68
|
+
:'registration_completion_amount' => :'registrationCompletionAmount',
|
69
|
+
:'registration_success' => :'registrationSuccess',
|
70
|
+
:'score' => :'score',
|
71
|
+
:'total_seconds_tracked' => :'totalSecondsTracked',
|
72
|
+
:'first_access_date' => :'firstAccessDate',
|
73
|
+
:'last_access_date' => :'lastAccessDate',
|
74
|
+
:'completed_date' => :'completedDate',
|
75
|
+
:'created_date' => :'createdDate',
|
76
|
+
:'course' => :'course',
|
77
|
+
:'learner' => :'learner',
|
78
|
+
:'global_objectives' => :'globalObjectives',
|
79
|
+
:'shared_data' => :'sharedData',
|
80
|
+
:'suspended_activity_id' => :'suspendedActivityId',
|
81
|
+
:'activity_details' => :'activityDetails'
|
82
|
+
}
|
83
|
+
end
|
84
|
+
|
85
|
+
# Attribute type mapping.
|
86
|
+
def self.swagger_types
|
87
|
+
{
|
88
|
+
:'id' => :'String',
|
89
|
+
:'instance' => :'Integer',
|
90
|
+
:'xapi_registration_id' => :'String',
|
91
|
+
:'dispatch_id' => :'String',
|
92
|
+
:'updated' => :'DateTime',
|
93
|
+
:'registration_completion' => :'RegistrationCompletion',
|
94
|
+
:'registration_completion_amount' => :'Float',
|
95
|
+
:'registration_success' => :'RegistrationSuccess',
|
96
|
+
:'score' => :'ScoreSchema',
|
97
|
+
:'total_seconds_tracked' => :'Float',
|
98
|
+
:'first_access_date' => :'DateTime',
|
99
|
+
:'last_access_date' => :'DateTime',
|
100
|
+
:'completed_date' => :'DateTime',
|
101
|
+
:'created_date' => :'DateTime',
|
102
|
+
:'course' => :'CourseReferenceSchema',
|
103
|
+
:'learner' => :'LearnerSchema',
|
104
|
+
:'global_objectives' => :'Array<ObjectiveSchema>',
|
105
|
+
:'shared_data' => :'Array<SharedDataEntrySchema>',
|
106
|
+
:'suspended_activity_id' => :'String',
|
107
|
+
:'activity_details' => :'ActivityResultSchema'
|
108
|
+
}
|
109
|
+
end
|
110
|
+
|
111
|
+
# Initializes the object
|
112
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
113
|
+
def initialize(attributes = {})
|
114
|
+
return unless attributes.is_a?(Hash)
|
115
|
+
|
116
|
+
# convert string to symbol for hash key
|
117
|
+
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
118
|
+
|
119
|
+
if attributes.has_key?(:'id')
|
120
|
+
self.id = attributes[:'id']
|
121
|
+
end
|
122
|
+
|
123
|
+
if attributes.has_key?(:'instance')
|
124
|
+
self.instance = attributes[:'instance']
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.has_key?(:'xapiRegistrationId')
|
128
|
+
self.xapi_registration_id = attributes[:'xapiRegistrationId']
|
129
|
+
end
|
130
|
+
|
131
|
+
if attributes.has_key?(:'dispatchId')
|
132
|
+
self.dispatch_id = attributes[:'dispatchId']
|
133
|
+
end
|
134
|
+
|
135
|
+
if attributes.has_key?(:'updated')
|
136
|
+
self.updated = attributes[:'updated']
|
137
|
+
end
|
138
|
+
|
139
|
+
if attributes.has_key?(:'registrationCompletion')
|
140
|
+
self.registration_completion = attributes[:'registrationCompletion']
|
141
|
+
end
|
142
|
+
|
143
|
+
if attributes.has_key?(:'registrationCompletionAmount')
|
144
|
+
self.registration_completion_amount = attributes[:'registrationCompletionAmount']
|
145
|
+
end
|
146
|
+
|
147
|
+
if attributes.has_key?(:'registrationSuccess')
|
148
|
+
self.registration_success = attributes[:'registrationSuccess']
|
149
|
+
end
|
150
|
+
|
151
|
+
if attributes.has_key?(:'score')
|
152
|
+
self.score = attributes[:'score']
|
153
|
+
end
|
154
|
+
|
155
|
+
if attributes.has_key?(:'totalSecondsTracked')
|
156
|
+
self.total_seconds_tracked = attributes[:'totalSecondsTracked']
|
157
|
+
end
|
158
|
+
|
159
|
+
if attributes.has_key?(:'firstAccessDate')
|
160
|
+
self.first_access_date = attributes[:'firstAccessDate']
|
161
|
+
end
|
162
|
+
|
163
|
+
if attributes.has_key?(:'lastAccessDate')
|
164
|
+
self.last_access_date = attributes[:'lastAccessDate']
|
165
|
+
end
|
166
|
+
|
167
|
+
if attributes.has_key?(:'completedDate')
|
168
|
+
self.completed_date = attributes[:'completedDate']
|
169
|
+
end
|
170
|
+
|
171
|
+
if attributes.has_key?(:'createdDate')
|
172
|
+
self.created_date = attributes[:'createdDate']
|
173
|
+
end
|
174
|
+
|
175
|
+
if attributes.has_key?(:'course')
|
176
|
+
self.course = attributes[:'course']
|
177
|
+
end
|
178
|
+
|
179
|
+
if attributes.has_key?(:'learner')
|
180
|
+
self.learner = attributes[:'learner']
|
181
|
+
end
|
182
|
+
|
183
|
+
if attributes.has_key?(:'globalObjectives')
|
184
|
+
if (value = attributes[:'globalObjectives']).is_a?(Array)
|
185
|
+
self.global_objectives = value
|
186
|
+
end
|
187
|
+
end
|
188
|
+
|
189
|
+
if attributes.has_key?(:'sharedData')
|
190
|
+
if (value = attributes[:'sharedData']).is_a?(Array)
|
191
|
+
self.shared_data = value
|
192
|
+
end
|
193
|
+
end
|
194
|
+
|
195
|
+
if attributes.has_key?(:'suspendedActivityId')
|
196
|
+
self.suspended_activity_id = attributes[:'suspendedActivityId']
|
197
|
+
end
|
198
|
+
|
199
|
+
if attributes.has_key?(:'activityDetails')
|
200
|
+
self.activity_details = attributes[:'activityDetails']
|
201
|
+
end
|
202
|
+
end
|
203
|
+
|
204
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
205
|
+
# @return Array for valid properties with the reasons
|
206
|
+
def list_invalid_properties
|
207
|
+
invalid_properties = Array.new
|
208
|
+
invalid_properties
|
209
|
+
end
|
210
|
+
|
211
|
+
# Check to see if the all the properties in the model are valid
|
212
|
+
# @return true if the model is valid
|
213
|
+
def valid?
|
214
|
+
true
|
215
|
+
end
|
216
|
+
|
217
|
+
# Checks equality by comparing each attribute.
|
218
|
+
# @param [Object] Object to be compared
|
219
|
+
def ==(o)
|
220
|
+
return true if self.equal?(o)
|
221
|
+
self.class == o.class &&
|
222
|
+
id == o.id &&
|
223
|
+
instance == o.instance &&
|
224
|
+
xapi_registration_id == o.xapi_registration_id &&
|
225
|
+
dispatch_id == o.dispatch_id &&
|
226
|
+
updated == o.updated &&
|
227
|
+
registration_completion == o.registration_completion &&
|
228
|
+
registration_completion_amount == o.registration_completion_amount &&
|
229
|
+
registration_success == o.registration_success &&
|
230
|
+
score == o.score &&
|
231
|
+
total_seconds_tracked == o.total_seconds_tracked &&
|
232
|
+
first_access_date == o.first_access_date &&
|
233
|
+
last_access_date == o.last_access_date &&
|
234
|
+
completed_date == o.completed_date &&
|
235
|
+
created_date == o.created_date &&
|
236
|
+
course == o.course &&
|
237
|
+
learner == o.learner &&
|
238
|
+
global_objectives == o.global_objectives &&
|
239
|
+
shared_data == o.shared_data &&
|
240
|
+
suspended_activity_id == o.suspended_activity_id &&
|
241
|
+
activity_details == o.activity_details
|
242
|
+
end
|
243
|
+
|
244
|
+
# @see the `==` method
|
245
|
+
# @param [Object] Object to be compared
|
246
|
+
def eql?(o)
|
247
|
+
self == o
|
248
|
+
end
|
249
|
+
|
250
|
+
# Calculates hash code according to all attributes.
|
251
|
+
# @return [Fixnum] Hash code
|
252
|
+
def hash
|
253
|
+
[id, instance, xapi_registration_id, dispatch_id, updated, registration_completion, registration_completion_amount, registration_success, score, total_seconds_tracked, first_access_date, last_access_date, completed_date, created_date, course, learner, global_objectives, shared_data, suspended_activity_id, activity_details].hash
|
254
|
+
end
|
255
|
+
|
256
|
+
# Builds the object from hash
|
257
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
258
|
+
# @return [Object] Returns the model itself
|
259
|
+
def build_from_hash(attributes)
|
260
|
+
return nil unless attributes.is_a?(Hash)
|
261
|
+
self.class.swagger_types.each_pair do |key, type|
|
262
|
+
if type =~ /\AArray<(.*)>/i
|
263
|
+
# check to ensure the input is an array given that the the attribute
|
264
|
+
# is documented as an array but the input is not
|
265
|
+
if attributes[self.class.attribute_map[key]].is_a?(Array)
|
266
|
+
self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) })
|
267
|
+
end
|
268
|
+
elsif !attributes[self.class.attribute_map[key]].nil?
|
269
|
+
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
270
|
+
end # or else data not found in attributes(hash), not an issue as the data can be optional
|
271
|
+
end
|
272
|
+
|
273
|
+
self
|
274
|
+
end
|
275
|
+
|
276
|
+
# Deserializes the data based on type
|
277
|
+
# @param string type Data type
|
278
|
+
# @param string value Value to be deserialized
|
279
|
+
# @return [Object] Deserialized data
|
280
|
+
def _deserialize(type, value)
|
281
|
+
case type.to_sym
|
282
|
+
when :DateTime
|
283
|
+
DateTime.parse(value)
|
284
|
+
when :Date
|
285
|
+
Date.parse(value)
|
286
|
+
when :String
|
287
|
+
value.to_s
|
288
|
+
when :Integer
|
289
|
+
value.to_i
|
290
|
+
when :Float
|
291
|
+
value.to_f
|
292
|
+
when :BOOLEAN
|
293
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
294
|
+
true
|
295
|
+
else
|
296
|
+
false
|
297
|
+
end
|
298
|
+
when :Object
|
299
|
+
# generic object (usually a Hash), return directly
|
300
|
+
value
|
301
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
302
|
+
inner_type = Regexp.last_match[:inner_type]
|
303
|
+
value.map { |v| _deserialize(inner_type, v) }
|
304
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
305
|
+
k_type = Regexp.last_match[:k_type]
|
306
|
+
v_type = Regexp.last_match[:v_type]
|
307
|
+
{}.tap do |hash|
|
308
|
+
value.each do |k, v|
|
309
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
310
|
+
end
|
311
|
+
end
|
312
|
+
else # model
|
313
|
+
temp_model = RusticiSoftwareCloudV2.const_get(type).new
|
314
|
+
temp_model.build_from_hash(value)
|
315
|
+
end
|
316
|
+
end
|
317
|
+
|
318
|
+
# Returns the string representation of the object
|
319
|
+
# @return [String] String presentation of the object
|
320
|
+
def to_s
|
321
|
+
to_hash.to_s
|
322
|
+
end
|
323
|
+
|
324
|
+
# to_body is an alias to to_hash (backward compatibility)
|
325
|
+
# @return [Hash] Returns the object in the form of hash
|
326
|
+
def to_body
|
327
|
+
to_hash
|
328
|
+
end
|
329
|
+
|
330
|
+
# Returns the object in the form of hash
|
331
|
+
# @return [Hash] Returns the object in the form of hash
|
332
|
+
def to_hash
|
333
|
+
hash = {}
|
334
|
+
self.class.attribute_map.each_pair do |attr, param|
|
335
|
+
value = self.send(attr)
|
336
|
+
next if value.nil?
|
337
|
+
hash[param] = _to_hash(value)
|
338
|
+
end
|
339
|
+
hash
|
340
|
+
end
|
341
|
+
|
342
|
+
# Outputs non-array value in the form of hash
|
343
|
+
# For object, use to_hash. Otherwise, just return the value
|
344
|
+
# @param [Object] value Any valid value
|
345
|
+
# @return [Hash] Returns the value in the form of hash
|
346
|
+
def _to_hash(value)
|
347
|
+
if value.is_a?(Array)
|
348
|
+
value.compact.map { |v| _to_hash(v) }
|
349
|
+
elsif value.is_a?(Hash)
|
350
|
+
{}.tap do |hash|
|
351
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
352
|
+
end
|
353
|
+
elsif value.respond_to? :to_hash
|
354
|
+
value.to_hash
|
355
|
+
else
|
356
|
+
value
|
357
|
+
end
|
358
|
+
end
|
359
|
+
end
|
360
|
+
end
|