commonlit-clever-ruby 2.1.6.beta1 → 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.
Files changed (188) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +37 -29
  4. data/README.md +994 -61
  5. data/clever-ruby.gemspec +6 -13
  6. data/commonlit-clever-ruby-2.1.6.beta1.gem +0 -0
  7. data/docs/AdminName.md +0 -1
  8. data/docs/BadRequest.md +0 -1
  9. data/docs/Contact.md +1 -2
  10. data/docs/ContactObject.md +0 -1
  11. data/docs/ContactResponse.md +0 -1
  12. data/docs/ContactsCreated.md +2 -3
  13. data/docs/ContactsDeleted.md +2 -3
  14. data/docs/ContactsResponse.md +0 -1
  15. data/docs/ContactsUpdated.md +2 -3
  16. data/docs/Course.md +1 -2
  17. data/docs/CourseObject.md +0 -1
  18. data/docs/CourseResponse.md +0 -1
  19. data/docs/CoursesCreated.md +2 -3
  20. data/docs/CoursesDeleted.md +2 -3
  21. data/docs/CoursesResponse.md +0 -1
  22. data/docs/CoursesUpdated.md +2 -3
  23. data/docs/Credentials.md +0 -1
  24. data/docs/DataApi.md +2784 -0
  25. data/docs/District.md +9 -10
  26. data/docs/DistrictAdmin.md +2 -3
  27. data/docs/DistrictAdminObject.md +0 -1
  28. data/docs/DistrictAdminResponse.md +0 -1
  29. data/docs/DistrictAdminsResponse.md +0 -1
  30. data/docs/DistrictObject.md +0 -1
  31. data/docs/DistrictResponse.md +0 -1
  32. data/docs/DistrictadminsCreated.md +2 -3
  33. data/docs/DistrictadminsDeleted.md +2 -3
  34. data/docs/DistrictadminsUpdated.md +2 -3
  35. data/docs/DistrictsCreated.md +2 -3
  36. data/docs/DistrictsDeleted.md +2 -3
  37. data/docs/DistrictsResponse.md +0 -1
  38. data/docs/DistrictsUpdated.md +2 -3
  39. data/docs/Event.md +2 -3
  40. data/docs/EventResponse.md +0 -1
  41. data/docs/EventsApi.md +1 -4
  42. data/docs/EventsResponse.md +0 -1
  43. data/docs/InternalError.md +0 -1
  44. data/docs/Link.md +0 -1
  45. data/docs/Location.md +2 -3
  46. data/docs/Name.md +1 -2
  47. data/docs/NotFound.md +0 -1
  48. data/docs/Principal.md +1 -2
  49. data/docs/School.md +3 -4
  50. data/docs/SchoolAdmin.md +3 -4
  51. data/docs/SchoolAdminObject.md +0 -1
  52. data/docs/SchoolAdminResponse.md +0 -1
  53. data/docs/SchoolAdminsResponse.md +0 -1
  54. data/docs/SchoolEnrollment.md +1 -2
  55. data/docs/SchoolObject.md +0 -1
  56. data/docs/SchoolResponse.md +0 -1
  57. data/docs/SchooladminsCreated.md +2 -3
  58. data/docs/SchooladminsDeleted.md +2 -3
  59. data/docs/SchooladminsUpdated.md +2 -3
  60. data/docs/SchoolsCreated.md +2 -3
  61. data/docs/SchoolsDeleted.md +2 -3
  62. data/docs/SchoolsResponse.md +0 -1
  63. data/docs/SchoolsUpdated.md +2 -3
  64. data/docs/Section.md +2 -3
  65. data/docs/SectionObject.md +0 -1
  66. data/docs/SectionResponse.md +0 -1
  67. data/docs/SectionsCreated.md +2 -3
  68. data/docs/SectionsDeleted.md +2 -3
  69. data/docs/SectionsResponse.md +0 -1
  70. data/docs/SectionsUpdated.md +2 -3
  71. data/docs/Student.md +3 -4
  72. data/docs/StudentObject.md +0 -1
  73. data/docs/StudentResponse.md +0 -1
  74. data/docs/StudentsCreated.md +2 -3
  75. data/docs/StudentsDeleted.md +2 -3
  76. data/docs/StudentsResponse.md +0 -1
  77. data/docs/StudentsUpdated.md +2 -3
  78. data/docs/Teacher.md +2 -3
  79. data/docs/TeacherObject.md +0 -1
  80. data/docs/TeacherResponse.md +0 -1
  81. data/docs/TeachersCreated.md +2 -3
  82. data/docs/TeachersDeleted.md +2 -3
  83. data/docs/TeachersResponse.md +0 -1
  84. data/docs/TeachersUpdated.md +2 -3
  85. data/docs/Term.md +2 -3
  86. data/docs/TermObject.md +0 -1
  87. data/docs/TermResponse.md +0 -1
  88. data/docs/TermsCreated.md +2 -3
  89. data/docs/TermsDeleted.md +2 -3
  90. data/docs/TermsResponse.md +0 -1
  91. data/docs/TermsUpdated.md +2 -3
  92. data/git_push.sh +55 -0
  93. data/lib/clever-ruby/api/data_api.rb +2999 -0
  94. data/lib/clever-ruby/api/events_api.rb +25 -20
  95. data/lib/clever-ruby/api_error.rb +23 -4
  96. data/lib/clever-ruby/configuration.rb +5 -9
  97. data/lib/clever-ruby/models/admin_name.rb +46 -22
  98. data/lib/clever-ruby/models/bad_request.rb +42 -20
  99. data/lib/clever-ruby/models/contact.rb +83 -55
  100. data/lib/clever-ruby/models/contact_object.rb +42 -20
  101. data/lib/clever-ruby/models/contact_response.rb +42 -20
  102. data/lib/clever-ruby/models/contacts_response.rb +44 -22
  103. data/lib/clever-ruby/models/course.rb +60 -36
  104. data/lib/clever-ruby/models/course_object.rb +42 -20
  105. data/lib/clever-ruby/models/course_response.rb +42 -20
  106. data/lib/clever-ruby/models/courses_response.rb +44 -22
  107. data/lib/clever-ruby/models/credentials.rb +42 -20
  108. data/lib/clever-ruby/models/district.rb +122 -94
  109. data/lib/clever-ruby/models/district_admin.rb +67 -44
  110. data/lib/clever-ruby/models/district_admin_object.rb +42 -20
  111. data/lib/clever-ruby/models/district_admin_response.rb +42 -20
  112. data/lib/clever-ruby/models/district_admins_response.rb +44 -22
  113. data/lib/clever-ruby/models/district_object.rb +42 -20
  114. data/lib/clever-ruby/models/district_response.rb +42 -20
  115. data/lib/clever-ruby/models/districts_response.rb +44 -22
  116. data/lib/clever-ruby/models/event.rb +60 -33
  117. data/lib/clever-ruby/models/event_response.rb +42 -20
  118. data/lib/clever-ruby/models/events_response.rb +44 -22
  119. data/lib/clever-ruby/models/internal_error.rb +42 -20
  120. data/lib/clever-ruby/models/link.rb +47 -25
  121. data/lib/clever-ruby/models/location.rb +73 -45
  122. data/lib/clever-ruby/models/name.rb +58 -33
  123. data/lib/clever-ruby/models/not_found.rb +42 -20
  124. data/lib/clever-ruby/models/principal.rb +55 -31
  125. data/lib/clever-ruby/models/school.rb +108 -80
  126. data/lib/clever-ruby/models/school_admin.rb +85 -61
  127. data/lib/clever-ruby/models/school_admin_object.rb +42 -20
  128. data/lib/clever-ruby/models/school_admin_response.rb +42 -20
  129. data/lib/clever-ruby/models/school_admins_response.rb +44 -22
  130. data/lib/clever-ruby/models/school_enrollment.rb +56 -34
  131. data/lib/clever-ruby/models/school_object.rb +42 -20
  132. data/lib/clever-ruby/models/school_response.rb +42 -20
  133. data/lib/clever-ruby/models/schools_response.rb +44 -22
  134. data/lib/clever-ruby/models/section.rb +104 -75
  135. data/lib/clever-ruby/models/section_object.rb +42 -20
  136. data/lib/clever-ruby/models/section_response.rb +42 -20
  137. data/lib/clever-ruby/models/sections_response.rb +44 -22
  138. data/lib/clever-ruby/models/student.rb +147 -126
  139. data/lib/clever-ruby/models/student_object.rb +42 -20
  140. data/lib/clever-ruby/models/student_response.rb +42 -20
  141. data/lib/clever-ruby/models/students_response.rb +44 -22
  142. data/lib/clever-ruby/models/teacher.rb +89 -63
  143. data/lib/clever-ruby/models/teacher_object.rb +42 -20
  144. data/lib/clever-ruby/models/teacher_response.rb +42 -20
  145. data/lib/clever-ruby/models/teachers_response.rb +44 -22
  146. data/lib/clever-ruby/models/term.rb +69 -44
  147. data/lib/clever-ruby/models/term_object.rb +42 -20
  148. data/lib/clever-ruby/models/term_response.rb +42 -20
  149. data/lib/clever-ruby/models/terms_response.rb +44 -22
  150. data/lib/clever-ruby/version.rb +4 -5
  151. data/lib/clever-ruby.rb +4 -14
  152. data/override/README-extension.md +1 -1
  153. data/override/override.sh +3 -0
  154. data/spec/api/data_api_spec.rb +671 -0
  155. data/spec/api/events_api_spec.rb +4 -3
  156. data/spec/api_client_spec.rb +21 -3
  157. data/spec/spec_helper.rb +4 -3
  158. metadata +25 -179
  159. data/docs/ContactsApi.md +0 -231
  160. data/docs/CoursesApi.md +0 -231
  161. data/docs/DistrictAdminsApi.md +0 -171
  162. data/docs/DistrictsApi.md +0 -113
  163. data/docs/SchoolAdminsApi.md +0 -231
  164. data/docs/SchoolsApi.md +0 -351
  165. data/docs/SectionsApi.md +0 -499
  166. data/docs/StudentsApi.md +0 -463
  167. data/docs/TeachersApi.md +0 -403
  168. data/docs/TermsApi.md +0 -231
  169. data/lib/clever-ruby/api/contacts_api.rb +0 -241
  170. data/lib/clever-ruby/api/courses_api.rb +0 -241
  171. data/lib/clever-ruby/api/district_admins_api.rb +0 -182
  172. data/lib/clever-ruby/api/districts_api.rb +0 -123
  173. data/lib/clever-ruby/api/school_admins_api.rb +0 -241
  174. data/lib/clever-ruby/api/schools_api.rb +0 -359
  175. data/lib/clever-ruby/api/sections_api.rb +0 -500
  176. data/lib/clever-ruby/api/students_api.rb +0 -468
  177. data/lib/clever-ruby/api/teachers_api.rb +0 -409
  178. data/lib/clever-ruby/api/terms_api.rb +0 -241
  179. data/spec/api/contacts_api_spec.rb +0 -84
  180. data/spec/api/courses_api_spec.rb +0 -84
  181. data/spec/api/district_admins_api_spec.rb +0 -70
  182. data/spec/api/districts_api_spec.rb +0 -56
  183. data/spec/api/school_admins_api_spec.rb +0 -84
  184. data/spec/api/schools_api_spec.rb +0 -112
  185. data/spec/api/sections_api_spec.rb +0 -142
  186. data/spec/api/students_api_spec.rb +0 -137
  187. data/spec/api/teachers_api_spec.rb +0 -123
  188. data/spec/api/terms_api_spec.rb +0 -84
@@ -1,21 +1,18 @@
1
1
  =begin
2
- #Data API
2
+ #Clever API
3
3
 
4
- #Serves the Clever Data API
4
+ #The Clever API
5
5
 
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: 2.4.37
10
-
9
+ Swagger Codegen version: 3.0.51
11
10
  =end
12
11
 
13
12
  require 'date'
14
13
 
15
14
  module Clever
16
15
  class Student
17
- attr_accessor :id
18
-
19
16
  attr_accessor :created
20
17
 
21
18
  attr_accessor :credentials
@@ -30,16 +27,20 @@ module Clever
30
27
 
31
28
  attr_accessor :enrollments
32
29
 
33
- attr_accessor :gender
30
+ attr_accessor :ext
34
31
 
35
- attr_accessor :graduation_year
32
+ attr_accessor :gender
36
33
 
37
34
  attr_accessor :grade
38
35
 
36
+ attr_accessor :graduation_year
37
+
39
38
  attr_accessor :hispanic_ethnicity
40
39
 
41
40
  attr_accessor :home_language
42
41
 
42
+ attr_accessor :id
43
+
43
44
  attr_accessor :iep_status
44
45
 
45
46
  attr_accessor :last_modified
@@ -64,8 +65,6 @@ module Clever
64
65
 
65
66
  attr_accessor :weighted_gpa
66
67
 
67
- attr_accessor :ext
68
-
69
68
  class EnumAttributeValidator
70
69
  attr_reader :datatype
71
70
  attr_reader :allowable_values
@@ -91,7 +90,6 @@ module Clever
91
90
  # Attribute mapping from ruby-style variable name to JSON key.
92
91
  def self.attribute_map
93
92
  {
94
- :'id' => :'id',
95
93
  :'created' => :'created',
96
94
  :'credentials' => :'credentials',
97
95
  :'district' => :'district',
@@ -99,11 +97,13 @@ module Clever
99
97
  :'ell_status' => :'ell_status',
100
98
  :'email' => :'email',
101
99
  :'enrollments' => :'enrollments',
100
+ :'ext' => :'ext',
102
101
  :'gender' => :'gender',
103
- :'graduation_year' => :'graduation_year',
104
102
  :'grade' => :'grade',
103
+ :'graduation_year' => :'graduation_year',
105
104
  :'hispanic_ethnicity' => :'hispanic_ethnicity',
106
105
  :'home_language' => :'home_language',
106
+ :'id' => :'id',
107
107
  :'iep_status' => :'iep_status',
108
108
  :'last_modified' => :'last_modified',
109
109
  :'location' => :'location',
@@ -115,206 +115,217 @@ module Clever
115
115
  :'state_id' => :'state_id',
116
116
  :'student_number' => :'student_number',
117
117
  :'unweighted_gpa' => :'unweighted_gpa',
118
- :'weighted_gpa' => :'weighted_gpa',
119
- :'ext' => :'ext'
118
+ :'weighted_gpa' => :'weighted_gpa'
120
119
  }
121
120
  end
122
121
 
123
122
  # Attribute type mapping.
124
- def self.swagger_types
123
+ def self.openapi_types
125
124
  {
126
- :'id' => :'String',
127
- :'created' => :'String',
128
- :'credentials' => :'Credentials',
129
- :'district' => :'String',
130
- :'dob' => :'String',
131
- :'ell_status' => :'String',
132
- :'email' => :'String',
133
- :'enrollments' => :'Array<SchoolEnrollment>',
134
- :'gender' => :'String',
135
- :'graduation_year' => :'String',
136
- :'grade' => :'String',
137
- :'hispanic_ethnicity' => :'String',
138
- :'home_language' => :'String',
139
- :'iep_status' => :'String',
140
- :'last_modified' => :'String',
141
- :'location' => :'Location',
142
- :'name' => :'Name',
143
- :'race' => :'String',
144
- :'school' => :'String',
145
- :'schools' => :'Array<String>',
146
- :'sis_id' => :'String',
147
- :'state_id' => :'String',
148
- :'student_number' => :'String',
149
- :'unweighted_gpa' => :'String',
150
- :'weighted_gpa' => :'String',
151
- :'ext' => :'Object'
125
+ :'created' => :'Object',
126
+ :'credentials' => :'Object',
127
+ :'district' => :'Object',
128
+ :'dob' => :'Object',
129
+ :'ell_status' => :'Object',
130
+ :'email' => :'Object',
131
+ :'enrollments' => :'Object',
132
+ :'ext' => :'Object',
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
- return unless attributes.is_a?(Hash)
159
-
160
- # convert string to symbol for hash key
161
- attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
162
-
163
- if attributes.has_key?(:'id')
164
- self.id = attributes[:'id']
177
+ if (!attributes.is_a?(Hash))
178
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Student` initialize method"
165
179
  end
166
180
 
167
- if attributes.has_key?(:'created')
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
+ }
188
+
189
+ if attributes.key?(:'created')
168
190
  self.created = attributes[:'created']
169
191
  end
170
192
 
171
- if attributes.has_key?(:'credentials')
193
+ if attributes.key?(:'credentials')
172
194
  self.credentials = attributes[:'credentials']
173
195
  end
174
196
 
175
- if attributes.has_key?(:'district')
197
+ if attributes.key?(:'district')
176
198
  self.district = attributes[:'district']
177
199
  end
178
200
 
179
- if attributes.has_key?(:'dob')
201
+ if attributes.key?(:'dob')
180
202
  self.dob = attributes[:'dob']
181
203
  end
182
204
 
183
- if attributes.has_key?(:'ell_status')
205
+ if attributes.key?(:'ell_status')
184
206
  self.ell_status = attributes[:'ell_status']
185
207
  end
186
208
 
187
- if attributes.has_key?(:'email')
209
+ if attributes.key?(:'email')
188
210
  self.email = attributes[:'email']
189
211
  end
190
212
 
191
- if attributes.has_key?(:'enrollments')
213
+ if attributes.key?(:'enrollments')
192
214
  if (value = attributes[:'enrollments']).is_a?(Array)
193
215
  self.enrollments = value
194
216
  end
195
217
  end
196
218
 
197
- if attributes.has_key?(:'gender')
198
- self.gender = attributes[:'gender']
219
+ if attributes.key?(:'ext')
220
+ self.ext = attributes[:'ext']
199
221
  end
200
222
 
201
- if attributes.has_key?(:'graduation_year')
202
- self.graduation_year = attributes[:'graduation_year']
223
+ if attributes.key?(:'gender')
224
+ self.gender = attributes[:'gender']
203
225
  end
204
226
 
205
- if attributes.has_key?(:'grade')
227
+ if attributes.key?(:'grade')
206
228
  self.grade = attributes[:'grade']
207
229
  end
208
230
 
209
- if attributes.has_key?(:'hispanic_ethnicity')
231
+ if attributes.key?(:'graduation_year')
232
+ self.graduation_year = attributes[:'graduation_year']
233
+ end
234
+
235
+ if attributes.key?(:'hispanic_ethnicity')
210
236
  self.hispanic_ethnicity = attributes[:'hispanic_ethnicity']
211
237
  end
212
238
 
213
- if attributes.has_key?(:'home_language')
239
+ if attributes.key?(:'home_language')
214
240
  self.home_language = attributes[:'home_language']
215
241
  end
216
242
 
217
- if attributes.has_key?(:'iep_status')
243
+ if attributes.key?(:'id')
244
+ self.id = attributes[:'id']
245
+ end
246
+
247
+ if attributes.key?(:'iep_status')
218
248
  self.iep_status = attributes[:'iep_status']
219
249
  end
220
250
 
221
- if attributes.has_key?(:'last_modified')
251
+ if attributes.key?(:'last_modified')
222
252
  self.last_modified = attributes[:'last_modified']
223
253
  end
224
254
 
225
- if attributes.has_key?(:'location')
255
+ if attributes.key?(:'location')
226
256
  self.location = attributes[:'location']
227
257
  end
228
258
 
229
- if attributes.has_key?(:'name')
259
+ if attributes.key?(:'name')
230
260
  self.name = attributes[:'name']
231
261
  end
232
262
 
233
- if attributes.has_key?(:'race')
263
+ if attributes.key?(:'race')
234
264
  self.race = attributes[:'race']
235
265
  end
236
266
 
237
- if attributes.has_key?(:'school')
267
+ if attributes.key?(:'school')
238
268
  self.school = attributes[:'school']
239
269
  end
240
270
 
241
- if attributes.has_key?(:'schools')
271
+ if attributes.key?(:'schools')
242
272
  if (value = attributes[:'schools']).is_a?(Array)
243
273
  self.schools = value
244
274
  end
245
275
  end
246
276
 
247
- if attributes.has_key?(:'sis_id')
277
+ if attributes.key?(:'sis_id')
248
278
  self.sis_id = attributes[:'sis_id']
249
279
  end
250
280
 
251
- if attributes.has_key?(:'state_id')
281
+ if attributes.key?(:'state_id')
252
282
  self.state_id = attributes[:'state_id']
253
283
  end
254
284
 
255
- if attributes.has_key?(:'student_number')
285
+ if attributes.key?(:'student_number')
256
286
  self.student_number = attributes[:'student_number']
257
287
  end
258
288
 
259
- if attributes.has_key?(:'unweighted_gpa')
289
+ if attributes.key?(:'unweighted_gpa')
260
290
  self.unweighted_gpa = attributes[:'unweighted_gpa']
261
291
  end
262
292
 
263
- if attributes.has_key?(:'weighted_gpa')
293
+ if attributes.key?(:'weighted_gpa')
264
294
  self.weighted_gpa = attributes[:'weighted_gpa']
265
295
  end
266
-
267
- if attributes.has_key?(:'ext')
268
- self.ext = attributes[:'ext']
269
- end
270
296
  end
271
297
 
272
298
  # Show invalid properties with the reasons. Usually used together with valid?
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
- return false if !@dob.nil? && @dob !~ Regexp.new(/(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/)
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('String', ['M', 'F', 'X', ''])
310
+ gender_validator = EnumAttributeValidator.new('Object', ['M', 'F', 'X', ''])
290
311
  return false unless gender_validator.valid?(@gender)
291
- grade_validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', ''])
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('String', ['Y', 'N', ''])
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('String', ['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', ''])
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('String', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', ''])
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('String', ['Y', 'N', ''])
326
+ validator = EnumAttributeValidator.new('Object', ['Y', 'N', ''])
316
327
  unless validator.valid?(ell_status)
317
- fail ArgumentError, 'invalid value for "ell_status", must be one of #{validator.allowable_values}.'
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('String', ['M', 'F', 'X', ''])
336
+ validator = EnumAttributeValidator.new('Object', ['M', 'F', 'X', ''])
326
337
  unless validator.valid?(gender)
327
- fail ArgumentError, 'invalid value for "gender", must be one of #{validator.allowable_values}.'
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('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', ''])
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, 'invalid value for "grade", must be one of #{validator.allowable_values}.'
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('String', ['Y', 'N', ''])
356
+ validator = EnumAttributeValidator.new('Object', ['Y', 'N', ''])
346
357
  unless validator.valid?(hispanic_ethnicity)
347
- fail ArgumentError, 'invalid value for "hispanic_ethnicity", must be one of #{validator.allowable_values}.'
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('String', ['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', ''])
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, 'invalid value for "home_language", must be one of #{validator.allowable_values}.'
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('String', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', ''])
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, 'invalid value for "race", must be one of #{validator.allowable_values}.'
378
+ fail ArgumentError, "invalid value for \"race\", must be one of #{validator.allowable_values}."
368
379
  end
369
380
  @race = race
370
381
  end
@@ -374,7 +385,6 @@ module Clever
374
385
  def ==(o)
375
386
  return true if self.equal?(o)
376
387
  self.class == o.class &&
377
- id == o.id &&
378
388
  created == o.created &&
379
389
  credentials == o.credentials &&
380
390
  district == o.district &&
@@ -382,11 +392,13 @@ module Clever
382
392
  ell_status == o.ell_status &&
383
393
  email == o.email &&
384
394
  enrollments == o.enrollments &&
395
+ ext == o.ext &&
385
396
  gender == o.gender &&
386
- graduation_year == o.graduation_year &&
387
397
  grade == o.grade &&
398
+ graduation_year == o.graduation_year &&
388
399
  hispanic_ethnicity == o.hispanic_ethnicity &&
389
400
  home_language == o.home_language &&
401
+ id == o.id &&
390
402
  iep_status == o.iep_status &&
391
403
  last_modified == o.last_modified &&
392
404
  location == o.location &&
@@ -398,8 +410,7 @@ module Clever
398
410
  state_id == o.state_id &&
399
411
  student_number == o.student_number &&
400
412
  unweighted_gpa == o.unweighted_gpa &&
401
- weighted_gpa == o.weighted_gpa &&
402
- ext == o.ext
413
+ weighted_gpa == o.weighted_gpa
403
414
  end
404
415
 
405
416
  # @see the `==` method
@@ -409,9 +420,16 @@ module Clever
409
420
  end
410
421
 
411
422
  # Calculates hash code according to all attributes.
412
- # @return [Fixnum] Hash code
423
+ # @return [Integer] Hash code
413
424
  def hash
414
- [id, created, credentials, district, dob, ell_status, email, enrollments, gender, graduation_year, grade, hispanic_ethnicity, home_language, iep_status, last_modified, location, name, race, school, schools, sis_id, state_id, student_number, unweighted_gpa, weighted_gpa, ext].hash
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
426
+ end
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)
415
433
  end
416
434
 
417
435
  # Builds the object from hash
@@ -419,7 +437,7 @@ module Clever
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.swagger_types.each_pair do |key, type|
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
- end # or else data not found in attributes(hash), not an issue as the data can be optional
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 :BOOLEAN
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
- temp_model = Clever.const_get(type).new
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
- next if value.nil?
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