vericite_api 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,221 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ require 'date'
6
+
7
+ module VeriCiteClient
8
+ class ReportMetaData
9
+ # Users First Name
10
+ attr_accessor :user_first_name
11
+
12
+ # Users Last Name
13
+ attr_accessor :user_last_name
14
+
15
+ # Users Email
16
+ attr_accessor :user_email
17
+
18
+ # User Role
19
+ attr_accessor :user_role
20
+
21
+ # Title of Assignment
22
+ attr_accessor :assignment_title
23
+
24
+ # Title of Context
25
+ attr_accessor :context_title
26
+
27
+ attr_accessor :external_content_data
28
+
29
+ # Attribute mapping from ruby-style variable name to JSON key.
30
+ def self.attribute_map
31
+ {
32
+
33
+ :'user_first_name' => :'userFirstName',
34
+
35
+ :'user_last_name' => :'userLastName',
36
+
37
+ :'user_email' => :'userEmail',
38
+
39
+ :'user_role' => :'userRole',
40
+
41
+ :'assignment_title' => :'assignmentTitle',
42
+
43
+ :'context_title' => :'contextTitle',
44
+
45
+ :'external_content_data' => :'externalContentData'
46
+
47
+ }
48
+ end
49
+
50
+ # Attribute type mapping.
51
+ def self.swagger_types
52
+ {
53
+ :'user_first_name' => :'String',
54
+ :'user_last_name' => :'String',
55
+ :'user_email' => :'String',
56
+ :'user_role' => :'String',
57
+ :'assignment_title' => :'String',
58
+ :'context_title' => :'String',
59
+ :'external_content_data' => :'Array<ExternalContentData>'
60
+
61
+ }
62
+ end
63
+
64
+ def initialize(attributes = {})
65
+ return unless attributes.is_a?(Hash)
66
+
67
+ # convert string to symbol for hash key
68
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
69
+
70
+
71
+ if attributes[:'userFirstName']
72
+ self.user_first_name = attributes[:'userFirstName']
73
+ end
74
+
75
+ if attributes[:'userLastName']
76
+ self.user_last_name = attributes[:'userLastName']
77
+ end
78
+
79
+ if attributes[:'userEmail']
80
+ self.user_email = attributes[:'userEmail']
81
+ end
82
+
83
+ if attributes[:'userRole']
84
+ self.user_role = attributes[:'userRole']
85
+ end
86
+
87
+ if attributes[:'assignmentTitle']
88
+ self.assignment_title = attributes[:'assignmentTitle']
89
+ end
90
+
91
+ if attributes[:'contextTitle']
92
+ self.context_title = attributes[:'contextTitle']
93
+ end
94
+
95
+ if attributes[:'externalContentData']
96
+ if (value = attributes[:'externalContentData']).is_a?(Array)
97
+ self.external_content_data = value
98
+ end
99
+ end
100
+
101
+ end
102
+
103
+ # Check equality by comparing each attribute.
104
+ def ==(o)
105
+ return true if self.equal?(o)
106
+ self.class == o.class &&
107
+ user_first_name == o.user_first_name &&
108
+ user_last_name == o.user_last_name &&
109
+ user_email == o.user_email &&
110
+ user_role == o.user_role &&
111
+ assignment_title == o.assignment_title &&
112
+ context_title == o.context_title &&
113
+ external_content_data == o.external_content_data
114
+ end
115
+
116
+ # @see the `==` method
117
+ def eql?(o)
118
+ self == o
119
+ end
120
+
121
+ # Calculate hash code according to all attributes.
122
+ def hash
123
+ [user_first_name, user_last_name, user_email, user_role, assignment_title, context_title, external_content_data].hash
124
+ end
125
+
126
+ # build the object from hash
127
+ def build_from_hash(attributes)
128
+ return nil unless attributes.is_a?(Hash)
129
+ self.class.swagger_types.each_pair do |key, type|
130
+ if type =~ /^Array<(.*)>/i
131
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
132
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
133
+ else
134
+ #TODO show warning in debug mode
135
+ end
136
+ elsif !attributes[self.class.attribute_map[key]].nil?
137
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
138
+ else
139
+ # data not found in attributes(hash), not an issue as the data can be optional
140
+ end
141
+ end
142
+
143
+ self
144
+ end
145
+
146
+ def _deserialize(type, value)
147
+ case type.to_sym
148
+ when :DateTime
149
+ DateTime.parse(value)
150
+ when :Date
151
+ Date.parse(value)
152
+ when :String
153
+ value.to_s
154
+ when :Integer
155
+ value.to_i
156
+ when :Float
157
+ value.to_f
158
+ when :BOOLEAN
159
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
160
+ true
161
+ else
162
+ false
163
+ end
164
+ when :Object
165
+ # generic object (usually a Hash), return directly
166
+ value
167
+ when /\AArray<(?<inner_type>.+)>\z/
168
+ inner_type = Regexp.last_match[:inner_type]
169
+ value.map { |v| _deserialize(inner_type, v) }
170
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
171
+ k_type = Regexp.last_match[:k_type]
172
+ v_type = Regexp.last_match[:v_type]
173
+ {}.tap do |hash|
174
+ value.each do |k, v|
175
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
176
+ end
177
+ end
178
+ else # model
179
+ _model = VeriCiteClient.const_get(type).new
180
+ _model.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ def to_s
185
+ to_hash.to_s
186
+ end
187
+
188
+ # to_body is an alias to to_body (backward compatibility))
189
+ def to_body
190
+ to_hash
191
+ end
192
+
193
+ # return the object in the form of hash
194
+ def to_hash
195
+ hash = {}
196
+ self.class.attribute_map.each_pair do |attr, param|
197
+ value = self.send(attr)
198
+ next if value.nil?
199
+ hash[param] = _to_hash(value)
200
+ end
201
+ hash
202
+ end
203
+
204
+ # Method to output non-array value in the form of hash
205
+ # For object, use to_hash. Otherwise, just return the value
206
+ def _to_hash(value)
207
+ if value.is_a?(Array)
208
+ value.compact.map{ |v| _to_hash(v) }
209
+ elsif value.is_a?(Hash)
210
+ {}.tap do |hash|
211
+ value.each { |k, v| hash[k] = _to_hash(v) }
212
+ end
213
+ elsif value.respond_to? :to_hash
214
+ value.to_hash
215
+ else
216
+ value
217
+ end
218
+ end
219
+
220
+ end
221
+ end
@@ -0,0 +1,183 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ require 'date'
6
+
7
+ module VeriCiteClient
8
+ class ReportScoreReponse
9
+ attr_accessor :user
10
+
11
+ attr_accessor :assignment
12
+
13
+ attr_accessor :external_content_id
14
+
15
+ attr_accessor :score
16
+
17
+ # Attribute mapping from ruby-style variable name to JSON key.
18
+ def self.attribute_map
19
+ {
20
+
21
+ :'user' => :'user',
22
+
23
+ :'assignment' => :'assignment',
24
+
25
+ :'external_content_id' => :'externalContentId',
26
+
27
+ :'score' => :'score'
28
+
29
+ }
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.swagger_types
34
+ {
35
+ :'user' => :'String',
36
+ :'assignment' => :'String',
37
+ :'external_content_id' => :'String',
38
+ :'score' => :'Integer'
39
+
40
+ }
41
+ end
42
+
43
+ def initialize(attributes = {})
44
+ return unless attributes.is_a?(Hash)
45
+
46
+ # convert string to symbol for hash key
47
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
48
+
49
+
50
+ if attributes[:'user']
51
+ self.user = attributes[:'user']
52
+ end
53
+
54
+ if attributes[:'assignment']
55
+ self.assignment = attributes[:'assignment']
56
+ end
57
+
58
+ if attributes[:'externalContentId']
59
+ self.external_content_id = attributes[:'externalContentId']
60
+ end
61
+
62
+ if attributes[:'score']
63
+ self.score = attributes[:'score']
64
+ end
65
+
66
+ end
67
+
68
+ # Check equality by comparing each attribute.
69
+ def ==(o)
70
+ return true if self.equal?(o)
71
+ self.class == o.class &&
72
+ user == o.user &&
73
+ assignment == o.assignment &&
74
+ external_content_id == o.external_content_id &&
75
+ score == o.score
76
+ end
77
+
78
+ # @see the `==` method
79
+ def eql?(o)
80
+ self == o
81
+ end
82
+
83
+ # Calculate hash code according to all attributes.
84
+ def hash
85
+ [user, assignment, external_content_id, score].hash
86
+ end
87
+
88
+ # build the object from hash
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 =~ /^Array<(.*)>/i
93
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
94
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
95
+ else
96
+ #TODO show warning in debug mode
97
+ end
98
+ elsif !attributes[self.class.attribute_map[key]].nil?
99
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
100
+ else
101
+ # data not found in attributes(hash), not an issue as the data can be optional
102
+ end
103
+ end
104
+
105
+ self
106
+ end
107
+
108
+ def _deserialize(type, value)
109
+ case type.to_sym
110
+ when :DateTime
111
+ DateTime.parse(value)
112
+ when :Date
113
+ Date.parse(value)
114
+ when :String
115
+ value.to_s
116
+ when :Integer
117
+ value.to_i
118
+ when :Float
119
+ value.to_f
120
+ when :BOOLEAN
121
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
122
+ true
123
+ else
124
+ false
125
+ end
126
+ when :Object
127
+ # generic object (usually a Hash), return directly
128
+ value
129
+ when /\AArray<(?<inner_type>.+)>\z/
130
+ inner_type = Regexp.last_match[:inner_type]
131
+ value.map { |v| _deserialize(inner_type, v) }
132
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
133
+ k_type = Regexp.last_match[:k_type]
134
+ v_type = Regexp.last_match[:v_type]
135
+ {}.tap do |hash|
136
+ value.each do |k, v|
137
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
138
+ end
139
+ end
140
+ else # model
141
+ _model = VeriCiteClient.const_get(type).new
142
+ _model.build_from_hash(value)
143
+ end
144
+ end
145
+
146
+ def to_s
147
+ to_hash.to_s
148
+ end
149
+
150
+ # to_body is an alias to to_body (backward compatibility))
151
+ def to_body
152
+ to_hash
153
+ end
154
+
155
+ # return 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
+ # Method to output non-array value in the form of hash
167
+ # For object, use to_hash. Otherwise, just return the value
168
+ def _to_hash(value)
169
+ if value.is_a?(Array)
170
+ value.compact.map{ |v| _to_hash(v) }
171
+ elsif value.is_a?(Hash)
172
+ {}.tap do |hash|
173
+ value.each { |k, v| hash[k] = _to_hash(v) }
174
+ end
175
+ elsif value.respond_to? :to_hash
176
+ value.to_hash
177
+ else
178
+ value
179
+ end
180
+ end
181
+
182
+ end
183
+ end
@@ -0,0 +1,198 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ require 'date'
6
+
7
+ module VeriCiteClient
8
+ class ReportURLLinkReponse
9
+ # The url to retrieve the report
10
+ attr_accessor :url
11
+
12
+ # Context ID.
13
+ attr_accessor :context_id
14
+
15
+ # Assignment ID.
16
+ attr_accessor :assignment_id
17
+
18
+ # User ID.
19
+ attr_accessor :user_id
20
+
21
+ # external Content ID
22
+ attr_accessor :external_content_id
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+
28
+ :'url' => :'url',
29
+
30
+ :'context_id' => :'contextID',
31
+
32
+ :'assignment_id' => :'assignmentID',
33
+
34
+ :'user_id' => :'userID',
35
+
36
+ :'external_content_id' => :'externalContentID'
37
+
38
+ }
39
+ end
40
+
41
+ # Attribute type mapping.
42
+ def self.swagger_types
43
+ {
44
+ :'url' => :'String',
45
+ :'context_id' => :'String',
46
+ :'assignment_id' => :'String',
47
+ :'user_id' => :'String',
48
+ :'external_content_id' => :'String'
49
+
50
+ }
51
+ end
52
+
53
+ def initialize(attributes = {})
54
+ return unless attributes.is_a?(Hash)
55
+
56
+ # convert string to symbol for hash key
57
+ attributes = attributes.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
58
+
59
+
60
+ if attributes[:'url']
61
+ self.url = attributes[:'url']
62
+ end
63
+
64
+ if attributes[:'contextID']
65
+ self.context_id = attributes[:'contextID']
66
+ end
67
+
68
+ if attributes[:'assignmentID']
69
+ self.assignment_id = attributes[:'assignmentID']
70
+ end
71
+
72
+ if attributes[:'userID']
73
+ self.user_id = attributes[:'userID']
74
+ end
75
+
76
+ if attributes[:'externalContentID']
77
+ self.external_content_id = attributes[:'externalContentID']
78
+ end
79
+
80
+ end
81
+
82
+ # Check equality by comparing each attribute.
83
+ def ==(o)
84
+ return true if self.equal?(o)
85
+ self.class == o.class &&
86
+ url == o.url &&
87
+ context_id == o.context_id &&
88
+ assignment_id == o.assignment_id &&
89
+ user_id == o.user_id &&
90
+ external_content_id == o.external_content_id
91
+ end
92
+
93
+ # @see the `==` method
94
+ def eql?(o)
95
+ self == o
96
+ end
97
+
98
+ # Calculate hash code according to all attributes.
99
+ def hash
100
+ [url, context_id, assignment_id, user_id, external_content_id].hash
101
+ end
102
+
103
+ # build the object from hash
104
+ def build_from_hash(attributes)
105
+ return nil unless attributes.is_a?(Hash)
106
+ self.class.swagger_types.each_pair do |key, type|
107
+ if type =~ /^Array<(.*)>/i
108
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
109
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
110
+ else
111
+ #TODO show warning in debug mode
112
+ end
113
+ elsif !attributes[self.class.attribute_map[key]].nil?
114
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
115
+ else
116
+ # data not found in attributes(hash), not an issue as the data can be optional
117
+ end
118
+ end
119
+
120
+ self
121
+ end
122
+
123
+ def _deserialize(type, value)
124
+ case type.to_sym
125
+ when :DateTime
126
+ DateTime.parse(value)
127
+ when :Date
128
+ Date.parse(value)
129
+ when :String
130
+ value.to_s
131
+ when :Integer
132
+ value.to_i
133
+ when :Float
134
+ value.to_f
135
+ when :BOOLEAN
136
+ if value.to_s =~ /^(true|t|yes|y|1)$/i
137
+ true
138
+ else
139
+ false
140
+ end
141
+ when :Object
142
+ # generic object (usually a Hash), return directly
143
+ value
144
+ when /\AArray<(?<inner_type>.+)>\z/
145
+ inner_type = Regexp.last_match[:inner_type]
146
+ value.map { |v| _deserialize(inner_type, v) }
147
+ when /\AHash<(?<k_type>.+), (?<v_type>.+)>\z/
148
+ k_type = Regexp.last_match[:k_type]
149
+ v_type = Regexp.last_match[:v_type]
150
+ {}.tap do |hash|
151
+ value.each do |k, v|
152
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
153
+ end
154
+ end
155
+ else # model
156
+ _model = VeriCiteClient.const_get(type).new
157
+ _model.build_from_hash(value)
158
+ end
159
+ end
160
+
161
+ def to_s
162
+ to_hash.to_s
163
+ end
164
+
165
+ # to_body is an alias to to_body (backward compatibility))
166
+ def to_body
167
+ to_hash
168
+ end
169
+
170
+ # return 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
+ # Method to output non-array value in the form of hash
182
+ # For object, use to_hash. Otherwise, just return the value
183
+ def _to_hash(value)
184
+ if value.is_a?(Array)
185
+ value.compact.map{ |v| _to_hash(v) }
186
+ elsif value.is_a?(Hash)
187
+ {}.tap do |hash|
188
+ value.each { |k, v| hash[k] = _to_hash(v) }
189
+ end
190
+ elsif value.respond_to? :to_hash
191
+ value.to_hash
192
+ else
193
+ value
194
+ end
195
+ end
196
+
197
+ end
198
+ end
@@ -0,0 +1,7 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ module VeriCiteClient
6
+ VERSION = "1.0.0"
7
+ end
@@ -0,0 +1,41 @@
1
+ =begin
2
+ VeriCiteV1
3
+ =end
4
+
5
+ # Common files
6
+ require 'vericite_client/api_client'
7
+ require 'vericite_client/api_error'
8
+ require 'vericite_client/version'
9
+ require 'vericite_client/configuration'
10
+
11
+ # Models
12
+ require 'vericite_client/models/external_content_data'
13
+ require 'vericite_client/models/consumer_data'
14
+ require 'vericite_client/models/error'
15
+ require 'vericite_client/models/consumer_response'
16
+ require 'vericite_client/models/external_content_upload_info'
17
+ require 'vericite_client/models/report_meta_data'
18
+ require 'vericite_client/models/report_url_link_reponse'
19
+ require 'vericite_client/models/report_score_reponse'
20
+ require 'vericite_client/models/assignment_data'
21
+
22
+ # APIs
23
+ require 'vericite_client/api/default_api'
24
+
25
+ module VeriCiteClient
26
+ class << self
27
+ # Customize default settings for the SDK using block.
28
+ # VeriCiteClient.configure do |config|
29
+ # config.username = "xxx"
30
+ # config.password = "xxx"
31
+ # end
32
+ # If no block given, return the default Configuration object.
33
+ def configure
34
+ if block_given?
35
+ yield(Configuration.default)
36
+ else
37
+ Configuration.default
38
+ end
39
+ end
40
+ end
41
+ end