commonlit-clever-ruby 2.1.4 → 2.1.6.beta2
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.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +46 -41
- data/Makefile +1 -1
- data/README.md +943 -11
- data/clever-ruby.gemspec +3 -10
- data/commonlit-clever-ruby-2.1.6.beta1.gem +0 -0
- data/docs/AdminName.md +0 -1
- data/docs/BadRequest.md +0 -1
- data/docs/Contact.md +0 -1
- data/docs/ContactObject.md +0 -1
- data/docs/ContactResponse.md +0 -1
- data/docs/ContactsCreated.md +0 -1
- data/docs/ContactsDeleted.md +0 -1
- data/docs/ContactsResponse.md +0 -1
- data/docs/ContactsUpdated.md +0 -1
- data/docs/Course.md +0 -1
- data/docs/CourseObject.md +0 -1
- data/docs/CourseResponse.md +0 -1
- data/docs/CoursesCreated.md +0 -1
- data/docs/CoursesDeleted.md +0 -1
- data/docs/CoursesResponse.md +0 -1
- data/docs/CoursesUpdated.md +0 -1
- data/docs/Credentials.md +0 -1
- data/docs/DataApi.md +1 -69
- data/docs/District.md +0 -1
- data/docs/DistrictAdmin.md +0 -1
- data/docs/DistrictAdminObject.md +0 -1
- data/docs/DistrictAdminResponse.md +0 -1
- data/docs/DistrictAdminsResponse.md +0 -1
- data/docs/DistrictObject.md +0 -1
- data/docs/DistrictResponse.md +0 -1
- data/docs/DistrictadminsCreated.md +0 -1
- data/docs/DistrictadminsDeleted.md +0 -1
- data/docs/DistrictadminsUpdated.md +0 -1
- data/docs/DistrictsCreated.md +0 -1
- data/docs/DistrictsDeleted.md +0 -1
- data/docs/DistrictsResponse.md +0 -1
- data/docs/DistrictsUpdated.md +0 -1
- data/docs/Event.md +0 -1
- data/docs/EventResponse.md +0 -1
- data/docs/EventsApi.md +0 -3
- data/docs/EventsResponse.md +0 -1
- data/docs/InternalError.md +0 -1
- data/docs/Link.md +0 -1
- data/docs/Location.md +0 -1
- data/docs/Name.md +0 -1
- data/docs/NotFound.md +0 -1
- data/docs/Principal.md +0 -1
- data/docs/School.md +0 -1
- data/docs/SchoolAdmin.md +0 -1
- data/docs/SchoolAdminObject.md +0 -1
- data/docs/SchoolAdminResponse.md +0 -1
- data/docs/SchoolAdminsResponse.md +0 -1
- data/docs/SchoolEnrollment.md +0 -1
- data/docs/SchoolObject.md +0 -1
- data/docs/SchoolResponse.md +0 -1
- data/docs/SchooladminsCreated.md +0 -1
- data/docs/SchooladminsDeleted.md +0 -1
- data/docs/SchooladminsUpdated.md +0 -1
- data/docs/SchoolsCreated.md +0 -1
- data/docs/SchoolsDeleted.md +0 -1
- data/docs/SchoolsResponse.md +0 -1
- data/docs/SchoolsUpdated.md +0 -1
- data/docs/Section.md +0 -1
- data/docs/SectionObject.md +0 -1
- data/docs/SectionResponse.md +0 -1
- data/docs/SectionsCreated.md +0 -1
- data/docs/SectionsDeleted.md +0 -1
- data/docs/SectionsResponse.md +0 -1
- data/docs/SectionsUpdated.md +0 -1
- data/docs/Student.md +0 -1
- data/docs/StudentObject.md +0 -1
- data/docs/StudentResponse.md +0 -1
- data/docs/StudentsCreated.md +0 -1
- data/docs/StudentsDeleted.md +0 -1
- data/docs/StudentsResponse.md +0 -1
- data/docs/StudentsUpdated.md +0 -1
- data/docs/Teacher.md +0 -1
- data/docs/TeacherObject.md +0 -1
- data/docs/TeacherResponse.md +0 -1
- data/docs/TeachersCreated.md +0 -1
- data/docs/TeachersDeleted.md +0 -1
- data/docs/TeachersResponse.md +0 -1
- data/docs/TeachersUpdated.md +0 -1
- data/docs/Term.md +0 -1
- data/docs/TermObject.md +0 -1
- data/docs/TermResponse.md +0 -1
- data/docs/TermsCreated.md +0 -1
- data/docs/TermsDeleted.md +0 -1
- data/docs/TermsResponse.md +0 -1
- data/docs/TermsUpdated.md +0 -1
- data/full-v2.yml +2541 -0
- data/lib/clever-ruby/api/data_api.rb +836 -635
- data/lib/clever-ruby/api/events_api.rb +23 -18
- data/lib/clever-ruby/api_client.rb +1 -0
- data/lib/clever-ruby/api_error.rb +21 -2
- data/lib/clever-ruby/configuration.rb +3 -7
- data/lib/clever-ruby/models/admin_name.rb +44 -20
- data/lib/clever-ruby/models/bad_request.rb +40 -18
- data/lib/clever-ruby/models/contact.rb +73 -45
- data/lib/clever-ruby/models/contact_object.rb +40 -18
- data/lib/clever-ruby/models/contact_response.rb +40 -18
- data/lib/clever-ruby/models/contacts_response.rb +42 -20
- data/lib/clever-ruby/models/course.rb +48 -24
- data/lib/clever-ruby/models/course_object.rb +40 -18
- data/lib/clever-ruby/models/course_response.rb +40 -18
- data/lib/clever-ruby/models/courses_response.rb +42 -20
- data/lib/clever-ruby/models/credentials.rb +40 -18
- data/lib/clever-ruby/models/district.rb +75 -47
- data/lib/clever-ruby/models/district_admin.rb +49 -26
- data/lib/clever-ruby/models/district_admin_object.rb +40 -18
- data/lib/clever-ruby/models/district_admin_response.rb +40 -18
- data/lib/clever-ruby/models/district_admins_response.rb +42 -20
- data/lib/clever-ruby/models/district_object.rb +40 -18
- data/lib/clever-ruby/models/district_response.rb +40 -18
- data/lib/clever-ruby/models/districts_response.rb +42 -20
- data/lib/clever-ruby/models/event.rb +49 -22
- data/lib/clever-ruby/models/event_response.rb +40 -18
- data/lib/clever-ruby/models/events_response.rb +42 -20
- data/lib/clever-ruby/models/internal_error.rb +40 -18
- data/lib/clever-ruby/models/link.rb +45 -23
- data/lib/clever-ruby/models/location.rb +56 -28
- data/lib/clever-ruby/models/name.rb +47 -22
- data/lib/clever-ruby/models/not_found.rb +40 -18
- data/lib/clever-ruby/models/principal.rb +44 -20
- data/lib/clever-ruby/models/school.rb +81 -53
- data/lib/clever-ruby/models/school_admin.rb +59 -35
- data/lib/clever-ruby/models/school_admin_object.rb +40 -18
- data/lib/clever-ruby/models/school_admin_response.rb +40 -18
- data/lib/clever-ruby/models/school_admins_response.rb +42 -20
- data/lib/clever-ruby/models/school_enrollment.rb +44 -22
- data/lib/clever-ruby/models/school_object.rb +40 -18
- data/lib/clever-ruby/models/school_response.rb +40 -18
- data/lib/clever-ruby/models/schools_response.rb +42 -20
- data/lib/clever-ruby/models/section.rb +84 -55
- data/lib/clever-ruby/models/section_object.rb +40 -18
- data/lib/clever-ruby/models/section_response.rb +40 -18
- data/lib/clever-ruby/models/sections_response.rb +42 -20
- data/lib/clever-ruby/models/student.rb +121 -100
- data/lib/clever-ruby/models/student_object.rb +40 -18
- data/lib/clever-ruby/models/student_response.rb +40 -18
- data/lib/clever-ruby/models/students_response.rb +42 -20
- data/lib/clever-ruby/models/teacher.rb +69 -43
- data/lib/clever-ruby/models/teacher_object.rb +40 -18
- data/lib/clever-ruby/models/teacher_response.rb +40 -18
- data/lib/clever-ruby/models/teachers_response.rb +42 -20
- data/lib/clever-ruby/models/term.rb +51 -26
- data/lib/clever-ruby/models/term_object.rb +40 -18
- data/lib/clever-ruby/models/term_response.rb +40 -18
- data/lib/clever-ruby/models/terms_response.rb +42 -20
- data/lib/clever-ruby/version.rb +2 -3
- data/lib/clever-ruby.rb +1 -2
- data/override/README-extension.md +4 -5
- data/override/api_client.rb +1 -0
- data/override/override.sh +7 -5
- data/spec/api/data_api_spec.rb +671 -0
- data/spec/api/events_api_spec.rb +61 -0
- data/spec/api_client_spec.rb +243 -0
- data/spec/spec_helper.rb +26 -18
- metadata +34 -150
- data/commonlit-clever-ruby-2.1.3.gem +0 -0
- data/spec/events.json +0 -227
- data/tags +0 -1681
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 2.1.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version:
|
|
10
|
-
|
|
9
|
+
Swagger Codegen version: 3.0.51
|
|
11
10
|
=end
|
|
12
11
|
|
|
13
12
|
require 'date'
|
|
@@ -27,28 +26,41 @@ module Clever
|
|
|
27
26
|
end
|
|
28
27
|
|
|
29
28
|
# Attribute type mapping.
|
|
30
|
-
def self.
|
|
29
|
+
def self.openapi_types
|
|
31
30
|
{
|
|
32
|
-
:'data' => :'
|
|
33
|
-
:'links' => :'
|
|
31
|
+
:'data' => :'Object',
|
|
32
|
+
:'links' => :'Object'
|
|
34
33
|
}
|
|
35
34
|
end
|
|
36
35
|
|
|
36
|
+
# List of attributes with nullable: true
|
|
37
|
+
def self.openapi_nullable
|
|
38
|
+
Set.new([
|
|
39
|
+
])
|
|
40
|
+
end
|
|
41
|
+
|
|
37
42
|
# Initializes the object
|
|
38
43
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
39
44
|
def initialize(attributes = {})
|
|
40
|
-
|
|
45
|
+
if (!attributes.is_a?(Hash))
|
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SectionsResponse` initialize method"
|
|
47
|
+
end
|
|
41
48
|
|
|
42
|
-
# convert string to symbol for hash key
|
|
43
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
49
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
50
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SectionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
53
|
+
end
|
|
54
|
+
h[k.to_sym] = v
|
|
55
|
+
}
|
|
44
56
|
|
|
45
|
-
if attributes.
|
|
57
|
+
if attributes.key?(:'data')
|
|
46
58
|
if (value = attributes[:'data']).is_a?(Array)
|
|
47
59
|
self.data = value
|
|
48
60
|
end
|
|
49
61
|
end
|
|
50
62
|
|
|
51
|
-
if attributes.
|
|
63
|
+
if attributes.key?(:'links')
|
|
52
64
|
if (value = attributes[:'links']).is_a?(Array)
|
|
53
65
|
self.links = value
|
|
54
66
|
end
|
|
@@ -84,17 +96,24 @@ module Clever
|
|
|
84
96
|
end
|
|
85
97
|
|
|
86
98
|
# Calculates hash code according to all attributes.
|
|
87
|
-
# @return [
|
|
99
|
+
# @return [Integer] Hash code
|
|
88
100
|
def hash
|
|
89
101
|
[data, links].hash
|
|
90
102
|
end
|
|
91
103
|
|
|
104
|
+
# Builds the object from hash
|
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
106
|
+
# @return [Object] Returns the model itself
|
|
107
|
+
def self.build_from_hash(attributes)
|
|
108
|
+
new.build_from_hash(attributes)
|
|
109
|
+
end
|
|
110
|
+
|
|
92
111
|
# Builds the object from hash
|
|
93
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
113
|
# @return [Object] Returns the model itself
|
|
95
114
|
def build_from_hash(attributes)
|
|
96
115
|
return nil unless attributes.is_a?(Hash)
|
|
97
|
-
self.class.
|
|
116
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
98
117
|
if type =~ /\AArray<(.*)>/i
|
|
99
118
|
# check to ensure the input is an array given that the attribute
|
|
100
119
|
# is documented as an array but the input is not
|
|
@@ -103,7 +122,9 @@ module Clever
|
|
|
103
122
|
end
|
|
104
123
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
105
124
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
106
|
-
|
|
125
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
126
|
+
self.send("#{key}=", nil)
|
|
127
|
+
end
|
|
107
128
|
end
|
|
108
129
|
|
|
109
130
|
self
|
|
@@ -125,7 +146,7 @@ module Clever
|
|
|
125
146
|
value.to_i
|
|
126
147
|
when :Float
|
|
127
148
|
value.to_f
|
|
128
|
-
when :
|
|
149
|
+
when :Boolean
|
|
129
150
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
130
151
|
true
|
|
131
152
|
else
|
|
@@ -146,8 +167,7 @@ module Clever
|
|
|
146
167
|
end
|
|
147
168
|
end
|
|
148
169
|
else # model
|
|
149
|
-
|
|
150
|
-
temp_model.build_from_hash(value)
|
|
170
|
+
Clever.const_get(type).build_from_hash(value)
|
|
151
171
|
end
|
|
152
172
|
end
|
|
153
173
|
|
|
@@ -169,7 +189,11 @@ module Clever
|
|
|
169
189
|
hash = {}
|
|
170
190
|
self.class.attribute_map.each_pair do |attr, param|
|
|
171
191
|
value = self.send(attr)
|
|
172
|
-
|
|
192
|
+
if value.nil?
|
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
195
|
+
end
|
|
196
|
+
|
|
173
197
|
hash[param] = _to_hash(value)
|
|
174
198
|
end
|
|
175
199
|
hash
|
|
@@ -191,7 +215,5 @@ module Clever
|
|
|
191
215
|
else
|
|
192
216
|
value
|
|
193
217
|
end
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
end
|
|
218
|
+
end end
|
|
197
219
|
end
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
OpenAPI spec version: 2.1.0
|
|
7
7
|
|
|
8
8
|
Generated by: https://github.com/swagger-api/swagger-codegen.git
|
|
9
|
-
Swagger Codegen version:
|
|
10
|
-
|
|
9
|
+
Swagger Codegen version: 3.0.51
|
|
11
10
|
=end
|
|
12
11
|
|
|
13
12
|
require 'date'
|
|
@@ -121,150 +120,177 @@ module Clever
|
|
|
121
120
|
end
|
|
122
121
|
|
|
123
122
|
# Attribute type mapping.
|
|
124
|
-
def self.
|
|
123
|
+
def self.openapi_types
|
|
125
124
|
{
|
|
126
|
-
:'created' => :'
|
|
127
|
-
:'credentials' => :'
|
|
128
|
-
:'district' => :'
|
|
129
|
-
:'dob' => :'
|
|
130
|
-
:'ell_status' => :'
|
|
131
|
-
:'email' => :'
|
|
132
|
-
:'enrollments' => :'
|
|
125
|
+
:'created' => :'Object',
|
|
126
|
+
:'credentials' => :'Object',
|
|
127
|
+
:'district' => :'Object',
|
|
128
|
+
:'dob' => :'Object',
|
|
129
|
+
:'ell_status' => :'Object',
|
|
130
|
+
:'email' => :'Object',
|
|
131
|
+
:'enrollments' => :'Object',
|
|
133
132
|
:'ext' => :'Object',
|
|
134
|
-
:'gender' => :'
|
|
135
|
-
:'grade' => :'
|
|
136
|
-
:'graduation_year' => :'
|
|
137
|
-
:'hispanic_ethnicity' => :'
|
|
138
|
-
:'home_language' => :'
|
|
139
|
-
:'id' => :'
|
|
140
|
-
:'iep_status' => :'
|
|
141
|
-
:'last_modified' => :'
|
|
142
|
-
:'location' => :'
|
|
143
|
-
:'name' => :'
|
|
144
|
-
:'race' => :'
|
|
145
|
-
:'school' => :'
|
|
146
|
-
:'schools' => :'
|
|
147
|
-
:'sis_id' => :'
|
|
148
|
-
:'state_id' => :'
|
|
149
|
-
:'student_number' => :'
|
|
150
|
-
:'unweighted_gpa' => :'
|
|
151
|
-
:'weighted_gpa' => :'
|
|
133
|
+
:'gender' => :'Object',
|
|
134
|
+
:'grade' => :'Object',
|
|
135
|
+
:'graduation_year' => :'Object',
|
|
136
|
+
:'hispanic_ethnicity' => :'Object',
|
|
137
|
+
:'home_language' => :'Object',
|
|
138
|
+
:'id' => :'Object',
|
|
139
|
+
:'iep_status' => :'Object',
|
|
140
|
+
:'last_modified' => :'Object',
|
|
141
|
+
:'location' => :'Object',
|
|
142
|
+
:'name' => :'Object',
|
|
143
|
+
:'race' => :'Object',
|
|
144
|
+
:'school' => :'Object',
|
|
145
|
+
:'schools' => :'Object',
|
|
146
|
+
:'sis_id' => :'Object',
|
|
147
|
+
:'state_id' => :'Object',
|
|
148
|
+
:'student_number' => :'Object',
|
|
149
|
+
:'unweighted_gpa' => :'Object',
|
|
150
|
+
:'weighted_gpa' => :'Object'
|
|
152
151
|
}
|
|
153
152
|
end
|
|
154
153
|
|
|
154
|
+
# List of attributes with nullable: true
|
|
155
|
+
def self.openapi_nullable
|
|
156
|
+
Set.new([
|
|
157
|
+
:'dob',
|
|
158
|
+
:'ell_status',
|
|
159
|
+
:'email',
|
|
160
|
+
:'gender',
|
|
161
|
+
:'grade',
|
|
162
|
+
:'graduation_year',
|
|
163
|
+
:'hispanic_ethnicity',
|
|
164
|
+
:'home_language',
|
|
165
|
+
:'iep_status',
|
|
166
|
+
:'race',
|
|
167
|
+
:'state_id',
|
|
168
|
+
:'student_number',
|
|
169
|
+
:'unweighted_gpa',
|
|
170
|
+
:'weighted_gpa'
|
|
171
|
+
])
|
|
172
|
+
end
|
|
173
|
+
|
|
155
174
|
# Initializes the object
|
|
156
175
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
157
176
|
def initialize(attributes = {})
|
|
158
|
-
|
|
177
|
+
if (!attributes.is_a?(Hash))
|
|
178
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Student` initialize method"
|
|
179
|
+
end
|
|
159
180
|
|
|
160
|
-
# convert string to symbol for hash key
|
|
161
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
181
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
182
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
183
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
184
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Student`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
185
|
+
end
|
|
186
|
+
h[k.to_sym] = v
|
|
187
|
+
}
|
|
162
188
|
|
|
163
|
-
if attributes.
|
|
189
|
+
if attributes.key?(:'created')
|
|
164
190
|
self.created = attributes[:'created']
|
|
165
191
|
end
|
|
166
192
|
|
|
167
|
-
if attributes.
|
|
193
|
+
if attributes.key?(:'credentials')
|
|
168
194
|
self.credentials = attributes[:'credentials']
|
|
169
195
|
end
|
|
170
196
|
|
|
171
|
-
if attributes.
|
|
197
|
+
if attributes.key?(:'district')
|
|
172
198
|
self.district = attributes[:'district']
|
|
173
199
|
end
|
|
174
200
|
|
|
175
|
-
if attributes.
|
|
201
|
+
if attributes.key?(:'dob')
|
|
176
202
|
self.dob = attributes[:'dob']
|
|
177
203
|
end
|
|
178
204
|
|
|
179
|
-
if attributes.
|
|
205
|
+
if attributes.key?(:'ell_status')
|
|
180
206
|
self.ell_status = attributes[:'ell_status']
|
|
181
207
|
end
|
|
182
208
|
|
|
183
|
-
if attributes.
|
|
209
|
+
if attributes.key?(:'email')
|
|
184
210
|
self.email = attributes[:'email']
|
|
185
211
|
end
|
|
186
212
|
|
|
187
|
-
if attributes.
|
|
213
|
+
if attributes.key?(:'enrollments')
|
|
188
214
|
if (value = attributes[:'enrollments']).is_a?(Array)
|
|
189
215
|
self.enrollments = value
|
|
190
216
|
end
|
|
191
217
|
end
|
|
192
218
|
|
|
193
|
-
if attributes.
|
|
219
|
+
if attributes.key?(:'ext')
|
|
194
220
|
self.ext = attributes[:'ext']
|
|
195
221
|
end
|
|
196
222
|
|
|
197
|
-
if attributes.
|
|
223
|
+
if attributes.key?(:'gender')
|
|
198
224
|
self.gender = attributes[:'gender']
|
|
199
225
|
end
|
|
200
226
|
|
|
201
|
-
if attributes.
|
|
227
|
+
if attributes.key?(:'grade')
|
|
202
228
|
self.grade = attributes[:'grade']
|
|
203
229
|
end
|
|
204
230
|
|
|
205
|
-
if attributes.
|
|
231
|
+
if attributes.key?(:'graduation_year')
|
|
206
232
|
self.graduation_year = attributes[:'graduation_year']
|
|
207
233
|
end
|
|
208
234
|
|
|
209
|
-
if attributes.
|
|
235
|
+
if attributes.key?(:'hispanic_ethnicity')
|
|
210
236
|
self.hispanic_ethnicity = attributes[:'hispanic_ethnicity']
|
|
211
237
|
end
|
|
212
238
|
|
|
213
|
-
if attributes.
|
|
239
|
+
if attributes.key?(:'home_language')
|
|
214
240
|
self.home_language = attributes[:'home_language']
|
|
215
241
|
end
|
|
216
242
|
|
|
217
|
-
if attributes.
|
|
243
|
+
if attributes.key?(:'id')
|
|
218
244
|
self.id = attributes[:'id']
|
|
219
245
|
end
|
|
220
246
|
|
|
221
|
-
if attributes.
|
|
247
|
+
if attributes.key?(:'iep_status')
|
|
222
248
|
self.iep_status = attributes[:'iep_status']
|
|
223
249
|
end
|
|
224
250
|
|
|
225
|
-
if attributes.
|
|
251
|
+
if attributes.key?(:'last_modified')
|
|
226
252
|
self.last_modified = attributes[:'last_modified']
|
|
227
253
|
end
|
|
228
254
|
|
|
229
|
-
if attributes.
|
|
255
|
+
if attributes.key?(:'location')
|
|
230
256
|
self.location = attributes[:'location']
|
|
231
257
|
end
|
|
232
258
|
|
|
233
|
-
if attributes.
|
|
259
|
+
if attributes.key?(:'name')
|
|
234
260
|
self.name = attributes[:'name']
|
|
235
261
|
end
|
|
236
262
|
|
|
237
|
-
if attributes.
|
|
263
|
+
if attributes.key?(:'race')
|
|
238
264
|
self.race = attributes[:'race']
|
|
239
265
|
end
|
|
240
266
|
|
|
241
|
-
if attributes.
|
|
267
|
+
if attributes.key?(:'school')
|
|
242
268
|
self.school = attributes[:'school']
|
|
243
269
|
end
|
|
244
270
|
|
|
245
|
-
if attributes.
|
|
271
|
+
if attributes.key?(:'schools')
|
|
246
272
|
if (value = attributes[:'schools']).is_a?(Array)
|
|
247
273
|
self.schools = value
|
|
248
274
|
end
|
|
249
275
|
end
|
|
250
276
|
|
|
251
|
-
if attributes.
|
|
277
|
+
if attributes.key?(:'sis_id')
|
|
252
278
|
self.sis_id = attributes[:'sis_id']
|
|
253
279
|
end
|
|
254
280
|
|
|
255
|
-
if attributes.
|
|
281
|
+
if attributes.key?(:'state_id')
|
|
256
282
|
self.state_id = attributes[:'state_id']
|
|
257
283
|
end
|
|
258
284
|
|
|
259
|
-
if attributes.
|
|
285
|
+
if attributes.key?(:'student_number')
|
|
260
286
|
self.student_number = attributes[:'student_number']
|
|
261
287
|
end
|
|
262
288
|
|
|
263
|
-
if attributes.
|
|
289
|
+
if attributes.key?(:'unweighted_gpa')
|
|
264
290
|
self.unweighted_gpa = attributes[:'unweighted_gpa']
|
|
265
291
|
end
|
|
266
292
|
|
|
267
|
-
if attributes.
|
|
293
|
+
if attributes.key?(:'weighted_gpa')
|
|
268
294
|
self.weighted_gpa = attributes[:'weighted_gpa']
|
|
269
295
|
end
|
|
270
296
|
end
|
|
@@ -273,48 +299,33 @@ module Clever
|
|
|
273
299
|
# @return Array for valid properties with the reasons
|
|
274
300
|
def list_invalid_properties
|
|
275
301
|
invalid_properties = Array.new
|
|
276
|
-
if !@dob.nil? && @dob !~ Regexp.new(/(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/)
|
|
277
|
-
invalid_properties.push('invalid value for "dob", must conform to the pattern /(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/.')
|
|
278
|
-
end
|
|
279
|
-
|
|
280
302
|
invalid_properties
|
|
281
303
|
end
|
|
282
304
|
|
|
283
305
|
# Check to see if the all the properties in the model are valid
|
|
284
306
|
# @return true if the model is valid
|
|
285
307
|
def valid?
|
|
286
|
-
|
|
287
|
-
ell_status_validator = EnumAttributeValidator.new('String', ['Y', 'N', ''])
|
|
308
|
+
ell_status_validator = EnumAttributeValidator.new('Object', ['Y', 'N', ''])
|
|
288
309
|
return false unless ell_status_validator.valid?(@ell_status)
|
|
289
|
-
gender_validator = EnumAttributeValidator.new('
|
|
310
|
+
gender_validator = EnumAttributeValidator.new('Object', ['M', 'F', 'X', ''])
|
|
290
311
|
return false unless gender_validator.valid?(@gender)
|
|
291
|
-
grade_validator = EnumAttributeValidator.new('
|
|
312
|
+
grade_validator = EnumAttributeValidator.new('Object', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', ''])
|
|
292
313
|
return false unless grade_validator.valid?(@grade)
|
|
293
|
-
hispanic_ethnicity_validator = EnumAttributeValidator.new('
|
|
314
|
+
hispanic_ethnicity_validator = EnumAttributeValidator.new('Object', ['Y', 'N', ''])
|
|
294
315
|
return false unless hispanic_ethnicity_validator.valid?(@hispanic_ethnicity)
|
|
295
|
-
home_language_validator = EnumAttributeValidator.new('
|
|
316
|
+
home_language_validator = EnumAttributeValidator.new('Object', ['English', 'Albanian', 'Amharic', 'Arabic', 'Bengali', 'Bosnian', 'Burmese', 'Cantonese', 'Chinese', 'Dutch', 'Farsi', 'French', 'German', 'Hebrew', 'Hindi', 'Hmong', 'Ilocano', 'Japanese', 'Javanese', 'Karen', 'Khmer', 'Korean', 'Laotian', 'Latvian', 'Malay', 'Mandarin', 'Nepali', 'Oromo', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Somali', 'Spanish', 'Swahili', 'Tagalog', 'Tamil', 'Telugu', 'Thai', 'Tigrinya', 'Turkish', 'Ukrainian', 'Urdu', 'Vietnamese', ''])
|
|
296
317
|
return false unless home_language_validator.valid?(@home_language)
|
|
297
|
-
race_validator = EnumAttributeValidator.new('
|
|
318
|
+
race_validator = EnumAttributeValidator.new('Object', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', ''])
|
|
298
319
|
return false unless race_validator.valid?(@race)
|
|
299
320
|
true
|
|
300
321
|
end
|
|
301
322
|
|
|
302
|
-
# Custom attribute writer method with validation
|
|
303
|
-
# @param [Object] dob Value to be assigned
|
|
304
|
-
def dob=(dob)
|
|
305
|
-
if !dob.nil? && dob !~ Regexp.new(/(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/)
|
|
306
|
-
fail ArgumentError, 'invalid value for "dob", must conform to the pattern /(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/.'
|
|
307
|
-
end
|
|
308
|
-
|
|
309
|
-
@dob = dob
|
|
310
|
-
end
|
|
311
|
-
|
|
312
323
|
# Custom attribute writer method checking allowed values (enum).
|
|
313
324
|
# @param [Object] ell_status Object to be assigned
|
|
314
325
|
def ell_status=(ell_status)
|
|
315
|
-
validator = EnumAttributeValidator.new('
|
|
326
|
+
validator = EnumAttributeValidator.new('Object', ['Y', 'N', ''])
|
|
316
327
|
unless validator.valid?(ell_status)
|
|
317
|
-
fail ArgumentError,
|
|
328
|
+
fail ArgumentError, "invalid value for \"ell_status\", must be one of #{validator.allowable_values}."
|
|
318
329
|
end
|
|
319
330
|
@ell_status = ell_status
|
|
320
331
|
end
|
|
@@ -322,9 +333,9 @@ module Clever
|
|
|
322
333
|
# Custom attribute writer method checking allowed values (enum).
|
|
323
334
|
# @param [Object] gender Object to be assigned
|
|
324
335
|
def gender=(gender)
|
|
325
|
-
validator = EnumAttributeValidator.new('
|
|
336
|
+
validator = EnumAttributeValidator.new('Object', ['M', 'F', 'X', ''])
|
|
326
337
|
unless validator.valid?(gender)
|
|
327
|
-
fail ArgumentError,
|
|
338
|
+
fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}."
|
|
328
339
|
end
|
|
329
340
|
@gender = gender
|
|
330
341
|
end
|
|
@@ -332,9 +343,9 @@ module Clever
|
|
|
332
343
|
# Custom attribute writer method checking allowed values (enum).
|
|
333
344
|
# @param [Object] grade Object to be assigned
|
|
334
345
|
def grade=(grade)
|
|
335
|
-
validator = EnumAttributeValidator.new('
|
|
346
|
+
validator = EnumAttributeValidator.new('Object', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', ''])
|
|
336
347
|
unless validator.valid?(grade)
|
|
337
|
-
fail ArgumentError,
|
|
348
|
+
fail ArgumentError, "invalid value for \"grade\", must be one of #{validator.allowable_values}."
|
|
338
349
|
end
|
|
339
350
|
@grade = grade
|
|
340
351
|
end
|
|
@@ -342,9 +353,9 @@ module Clever
|
|
|
342
353
|
# Custom attribute writer method checking allowed values (enum).
|
|
343
354
|
# @param [Object] hispanic_ethnicity Object to be assigned
|
|
344
355
|
def hispanic_ethnicity=(hispanic_ethnicity)
|
|
345
|
-
validator = EnumAttributeValidator.new('
|
|
356
|
+
validator = EnumAttributeValidator.new('Object', ['Y', 'N', ''])
|
|
346
357
|
unless validator.valid?(hispanic_ethnicity)
|
|
347
|
-
fail ArgumentError,
|
|
358
|
+
fail ArgumentError, "invalid value for \"hispanic_ethnicity\", must be one of #{validator.allowable_values}."
|
|
348
359
|
end
|
|
349
360
|
@hispanic_ethnicity = hispanic_ethnicity
|
|
350
361
|
end
|
|
@@ -352,9 +363,9 @@ module Clever
|
|
|
352
363
|
# Custom attribute writer method checking allowed values (enum).
|
|
353
364
|
# @param [Object] home_language Object to be assigned
|
|
354
365
|
def home_language=(home_language)
|
|
355
|
-
validator = EnumAttributeValidator.new('
|
|
366
|
+
validator = EnumAttributeValidator.new('Object', ['English', 'Albanian', 'Amharic', 'Arabic', 'Bengali', 'Bosnian', 'Burmese', 'Cantonese', 'Chinese', 'Dutch', 'Farsi', 'French', 'German', 'Hebrew', 'Hindi', 'Hmong', 'Ilocano', 'Japanese', 'Javanese', 'Karen', 'Khmer', 'Korean', 'Laotian', 'Latvian', 'Malay', 'Mandarin', 'Nepali', 'Oromo', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Somali', 'Spanish', 'Swahili', 'Tagalog', 'Tamil', 'Telugu', 'Thai', 'Tigrinya', 'Turkish', 'Ukrainian', 'Urdu', 'Vietnamese', ''])
|
|
356
367
|
unless validator.valid?(home_language)
|
|
357
|
-
fail ArgumentError,
|
|
368
|
+
fail ArgumentError, "invalid value for \"home_language\", must be one of #{validator.allowable_values}."
|
|
358
369
|
end
|
|
359
370
|
@home_language = home_language
|
|
360
371
|
end
|
|
@@ -362,9 +373,9 @@ module Clever
|
|
|
362
373
|
# Custom attribute writer method checking allowed values (enum).
|
|
363
374
|
# @param [Object] race Object to be assigned
|
|
364
375
|
def race=(race)
|
|
365
|
-
validator = EnumAttributeValidator.new('
|
|
376
|
+
validator = EnumAttributeValidator.new('Object', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', ''])
|
|
366
377
|
unless validator.valid?(race)
|
|
367
|
-
fail ArgumentError,
|
|
378
|
+
fail ArgumentError, "invalid value for \"race\", must be one of #{validator.allowable_values}."
|
|
368
379
|
end
|
|
369
380
|
@race = race
|
|
370
381
|
end
|
|
@@ -409,17 +420,24 @@ module Clever
|
|
|
409
420
|
end
|
|
410
421
|
|
|
411
422
|
# Calculates hash code according to all attributes.
|
|
412
|
-
# @return [
|
|
423
|
+
# @return [Integer] Hash code
|
|
413
424
|
def hash
|
|
414
425
|
[created, credentials, district, dob, ell_status, email, enrollments, ext, gender, grade, graduation_year, hispanic_ethnicity, home_language, id, iep_status, last_modified, location, name, race, school, schools, sis_id, state_id, student_number, unweighted_gpa, weighted_gpa].hash
|
|
415
426
|
end
|
|
416
427
|
|
|
428
|
+
# Builds the object from hash
|
|
429
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
430
|
+
# @return [Object] Returns the model itself
|
|
431
|
+
def self.build_from_hash(attributes)
|
|
432
|
+
new.build_from_hash(attributes)
|
|
433
|
+
end
|
|
434
|
+
|
|
417
435
|
# Builds the object from hash
|
|
418
436
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
419
437
|
# @return [Object] Returns the model itself
|
|
420
438
|
def build_from_hash(attributes)
|
|
421
439
|
return nil unless attributes.is_a?(Hash)
|
|
422
|
-
self.class.
|
|
440
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
423
441
|
if type =~ /\AArray<(.*)>/i
|
|
424
442
|
# check to ensure the input is an array given that the attribute
|
|
425
443
|
# is documented as an array but the input is not
|
|
@@ -428,7 +446,9 @@ module Clever
|
|
|
428
446
|
end
|
|
429
447
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
430
448
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
431
|
-
|
|
449
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
450
|
+
self.send("#{key}=", nil)
|
|
451
|
+
end
|
|
432
452
|
end
|
|
433
453
|
|
|
434
454
|
self
|
|
@@ -450,7 +470,7 @@ module Clever
|
|
|
450
470
|
value.to_i
|
|
451
471
|
when :Float
|
|
452
472
|
value.to_f
|
|
453
|
-
when :
|
|
473
|
+
when :Boolean
|
|
454
474
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
455
475
|
true
|
|
456
476
|
else
|
|
@@ -471,8 +491,7 @@ module Clever
|
|
|
471
491
|
end
|
|
472
492
|
end
|
|
473
493
|
else # model
|
|
474
|
-
|
|
475
|
-
temp_model.build_from_hash(value)
|
|
494
|
+
Clever.const_get(type).build_from_hash(value)
|
|
476
495
|
end
|
|
477
496
|
end
|
|
478
497
|
|
|
@@ -494,7 +513,11 @@ module Clever
|
|
|
494
513
|
hash = {}
|
|
495
514
|
self.class.attribute_map.each_pair do |attr, param|
|
|
496
515
|
value = self.send(attr)
|
|
497
|
-
|
|
516
|
+
if value.nil?
|
|
517
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
518
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
519
|
+
end
|
|
520
|
+
|
|
498
521
|
hash[param] = _to_hash(value)
|
|
499
522
|
end
|
|
500
523
|
hash
|
|
@@ -516,7 +539,5 @@ module Clever
|
|
|
516
539
|
else
|
|
517
540
|
value
|
|
518
541
|
end
|
|
519
|
-
end
|
|
520
|
-
|
|
521
|
-
end
|
|
542
|
+
end end
|
|
522
543
|
end
|