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.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +3 -1
  3. data/Gemfile.lock +46 -41
  4. data/Makefile +1 -1
  5. data/README.md +943 -11
  6. data/clever-ruby.gemspec +3 -10
  7. data/commonlit-clever-ruby-2.1.6.beta1.gem +0 -0
  8. data/docs/AdminName.md +0 -1
  9. data/docs/BadRequest.md +0 -1
  10. data/docs/Contact.md +0 -1
  11. data/docs/ContactObject.md +0 -1
  12. data/docs/ContactResponse.md +0 -1
  13. data/docs/ContactsCreated.md +0 -1
  14. data/docs/ContactsDeleted.md +0 -1
  15. data/docs/ContactsResponse.md +0 -1
  16. data/docs/ContactsUpdated.md +0 -1
  17. data/docs/Course.md +0 -1
  18. data/docs/CourseObject.md +0 -1
  19. data/docs/CourseResponse.md +0 -1
  20. data/docs/CoursesCreated.md +0 -1
  21. data/docs/CoursesDeleted.md +0 -1
  22. data/docs/CoursesResponse.md +0 -1
  23. data/docs/CoursesUpdated.md +0 -1
  24. data/docs/Credentials.md +0 -1
  25. data/docs/DataApi.md +1 -69
  26. data/docs/District.md +0 -1
  27. data/docs/DistrictAdmin.md +0 -1
  28. data/docs/DistrictAdminObject.md +0 -1
  29. data/docs/DistrictAdminResponse.md +0 -1
  30. data/docs/DistrictAdminsResponse.md +0 -1
  31. data/docs/DistrictObject.md +0 -1
  32. data/docs/DistrictResponse.md +0 -1
  33. data/docs/DistrictadminsCreated.md +0 -1
  34. data/docs/DistrictadminsDeleted.md +0 -1
  35. data/docs/DistrictadminsUpdated.md +0 -1
  36. data/docs/DistrictsCreated.md +0 -1
  37. data/docs/DistrictsDeleted.md +0 -1
  38. data/docs/DistrictsResponse.md +0 -1
  39. data/docs/DistrictsUpdated.md +0 -1
  40. data/docs/Event.md +0 -1
  41. data/docs/EventResponse.md +0 -1
  42. data/docs/EventsApi.md +0 -3
  43. data/docs/EventsResponse.md +0 -1
  44. data/docs/InternalError.md +0 -1
  45. data/docs/Link.md +0 -1
  46. data/docs/Location.md +0 -1
  47. data/docs/Name.md +0 -1
  48. data/docs/NotFound.md +0 -1
  49. data/docs/Principal.md +0 -1
  50. data/docs/School.md +0 -1
  51. data/docs/SchoolAdmin.md +0 -1
  52. data/docs/SchoolAdminObject.md +0 -1
  53. data/docs/SchoolAdminResponse.md +0 -1
  54. data/docs/SchoolAdminsResponse.md +0 -1
  55. data/docs/SchoolEnrollment.md +0 -1
  56. data/docs/SchoolObject.md +0 -1
  57. data/docs/SchoolResponse.md +0 -1
  58. data/docs/SchooladminsCreated.md +0 -1
  59. data/docs/SchooladminsDeleted.md +0 -1
  60. data/docs/SchooladminsUpdated.md +0 -1
  61. data/docs/SchoolsCreated.md +0 -1
  62. data/docs/SchoolsDeleted.md +0 -1
  63. data/docs/SchoolsResponse.md +0 -1
  64. data/docs/SchoolsUpdated.md +0 -1
  65. data/docs/Section.md +0 -1
  66. data/docs/SectionObject.md +0 -1
  67. data/docs/SectionResponse.md +0 -1
  68. data/docs/SectionsCreated.md +0 -1
  69. data/docs/SectionsDeleted.md +0 -1
  70. data/docs/SectionsResponse.md +0 -1
  71. data/docs/SectionsUpdated.md +0 -1
  72. data/docs/Student.md +0 -1
  73. data/docs/StudentObject.md +0 -1
  74. data/docs/StudentResponse.md +0 -1
  75. data/docs/StudentsCreated.md +0 -1
  76. data/docs/StudentsDeleted.md +0 -1
  77. data/docs/StudentsResponse.md +0 -1
  78. data/docs/StudentsUpdated.md +0 -1
  79. data/docs/Teacher.md +0 -1
  80. data/docs/TeacherObject.md +0 -1
  81. data/docs/TeacherResponse.md +0 -1
  82. data/docs/TeachersCreated.md +0 -1
  83. data/docs/TeachersDeleted.md +0 -1
  84. data/docs/TeachersResponse.md +0 -1
  85. data/docs/TeachersUpdated.md +0 -1
  86. data/docs/Term.md +0 -1
  87. data/docs/TermObject.md +0 -1
  88. data/docs/TermResponse.md +0 -1
  89. data/docs/TermsCreated.md +0 -1
  90. data/docs/TermsDeleted.md +0 -1
  91. data/docs/TermsResponse.md +0 -1
  92. data/docs/TermsUpdated.md +0 -1
  93. data/full-v2.yml +2541 -0
  94. data/lib/clever-ruby/api/data_api.rb +836 -635
  95. data/lib/clever-ruby/api/events_api.rb +23 -18
  96. data/lib/clever-ruby/api_client.rb +1 -0
  97. data/lib/clever-ruby/api_error.rb +21 -2
  98. data/lib/clever-ruby/configuration.rb +3 -7
  99. data/lib/clever-ruby/models/admin_name.rb +44 -20
  100. data/lib/clever-ruby/models/bad_request.rb +40 -18
  101. data/lib/clever-ruby/models/contact.rb +73 -45
  102. data/lib/clever-ruby/models/contact_object.rb +40 -18
  103. data/lib/clever-ruby/models/contact_response.rb +40 -18
  104. data/lib/clever-ruby/models/contacts_response.rb +42 -20
  105. data/lib/clever-ruby/models/course.rb +48 -24
  106. data/lib/clever-ruby/models/course_object.rb +40 -18
  107. data/lib/clever-ruby/models/course_response.rb +40 -18
  108. data/lib/clever-ruby/models/courses_response.rb +42 -20
  109. data/lib/clever-ruby/models/credentials.rb +40 -18
  110. data/lib/clever-ruby/models/district.rb +75 -47
  111. data/lib/clever-ruby/models/district_admin.rb +49 -26
  112. data/lib/clever-ruby/models/district_admin_object.rb +40 -18
  113. data/lib/clever-ruby/models/district_admin_response.rb +40 -18
  114. data/lib/clever-ruby/models/district_admins_response.rb +42 -20
  115. data/lib/clever-ruby/models/district_object.rb +40 -18
  116. data/lib/clever-ruby/models/district_response.rb +40 -18
  117. data/lib/clever-ruby/models/districts_response.rb +42 -20
  118. data/lib/clever-ruby/models/event.rb +49 -22
  119. data/lib/clever-ruby/models/event_response.rb +40 -18
  120. data/lib/clever-ruby/models/events_response.rb +42 -20
  121. data/lib/clever-ruby/models/internal_error.rb +40 -18
  122. data/lib/clever-ruby/models/link.rb +45 -23
  123. data/lib/clever-ruby/models/location.rb +56 -28
  124. data/lib/clever-ruby/models/name.rb +47 -22
  125. data/lib/clever-ruby/models/not_found.rb +40 -18
  126. data/lib/clever-ruby/models/principal.rb +44 -20
  127. data/lib/clever-ruby/models/school.rb +81 -53
  128. data/lib/clever-ruby/models/school_admin.rb +59 -35
  129. data/lib/clever-ruby/models/school_admin_object.rb +40 -18
  130. data/lib/clever-ruby/models/school_admin_response.rb +40 -18
  131. data/lib/clever-ruby/models/school_admins_response.rb +42 -20
  132. data/lib/clever-ruby/models/school_enrollment.rb +44 -22
  133. data/lib/clever-ruby/models/school_object.rb +40 -18
  134. data/lib/clever-ruby/models/school_response.rb +40 -18
  135. data/lib/clever-ruby/models/schools_response.rb +42 -20
  136. data/lib/clever-ruby/models/section.rb +84 -55
  137. data/lib/clever-ruby/models/section_object.rb +40 -18
  138. data/lib/clever-ruby/models/section_response.rb +40 -18
  139. data/lib/clever-ruby/models/sections_response.rb +42 -20
  140. data/lib/clever-ruby/models/student.rb +121 -100
  141. data/lib/clever-ruby/models/student_object.rb +40 -18
  142. data/lib/clever-ruby/models/student_response.rb +40 -18
  143. data/lib/clever-ruby/models/students_response.rb +42 -20
  144. data/lib/clever-ruby/models/teacher.rb +69 -43
  145. data/lib/clever-ruby/models/teacher_object.rb +40 -18
  146. data/lib/clever-ruby/models/teacher_response.rb +40 -18
  147. data/lib/clever-ruby/models/teachers_response.rb +42 -20
  148. data/lib/clever-ruby/models/term.rb +51 -26
  149. data/lib/clever-ruby/models/term_object.rb +40 -18
  150. data/lib/clever-ruby/models/term_response.rb +40 -18
  151. data/lib/clever-ruby/models/terms_response.rb +42 -20
  152. data/lib/clever-ruby/version.rb +2 -3
  153. data/lib/clever-ruby.rb +1 -2
  154. data/override/README-extension.md +4 -5
  155. data/override/api_client.rb +1 -0
  156. data/override/override.sh +7 -5
  157. data/spec/api/data_api_spec.rb +671 -0
  158. data/spec/api/events_api_spec.rb +61 -0
  159. data/spec/api_client_spec.rb +243 -0
  160. data/spec/spec_helper.rb +26 -18
  161. metadata +34 -150
  162. data/commonlit-clever-ruby-2.1.3.gem +0 -0
  163. data/spec/events.json +0 -227
  164. 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: 2.4.18
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.swagger_types
29
+ def self.openapi_types
31
30
  {
32
- :'data' => :'Array<SectionResponse>',
33
- :'links' => :'Array<Link>'
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
- return unless attributes.is_a?(Hash)
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| h[k.to_sym] = v }
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.has_key?(:'data')
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.has_key?(:'links')
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 [Fixnum] Hash code
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.swagger_types.each_pair do |key, type|
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
- end # or else data not found in attributes(hash), not an issue as the data can be optional
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 :BOOLEAN
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
- temp_model = Clever.const_get(type).new
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
- next if value.nil?
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: 2.4.18
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.swagger_types
123
+ def self.openapi_types
125
124
  {
126
- :'created' => :'String',
127
- :'credentials' => :'Credentials',
128
- :'district' => :'String',
129
- :'dob' => :'String',
130
- :'ell_status' => :'String',
131
- :'email' => :'String',
132
- :'enrollments' => :'Array<SchoolEnrollment>',
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' => :'String',
135
- :'grade' => :'String',
136
- :'graduation_year' => :'String',
137
- :'hispanic_ethnicity' => :'String',
138
- :'home_language' => :'String',
139
- :'id' => :'String',
140
- :'iep_status' => :'String',
141
- :'last_modified' => :'String',
142
- :'location' => :'Location',
143
- :'name' => :'Name',
144
- :'race' => :'String',
145
- :'school' => :'String',
146
- :'schools' => :'Array<String>',
147
- :'sis_id' => :'String',
148
- :'state_id' => :'String',
149
- :'student_number' => :'String',
150
- :'unweighted_gpa' => :'String',
151
- :'weighted_gpa' => :'String'
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)
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| h[k.to_sym] = v }
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.has_key?(:'created')
189
+ if attributes.key?(:'created')
164
190
  self.created = attributes[:'created']
165
191
  end
166
192
 
167
- if attributes.has_key?(:'credentials')
193
+ if attributes.key?(:'credentials')
168
194
  self.credentials = attributes[:'credentials']
169
195
  end
170
196
 
171
- if attributes.has_key?(:'district')
197
+ if attributes.key?(:'district')
172
198
  self.district = attributes[:'district']
173
199
  end
174
200
 
175
- if attributes.has_key?(:'dob')
201
+ if attributes.key?(:'dob')
176
202
  self.dob = attributes[:'dob']
177
203
  end
178
204
 
179
- if attributes.has_key?(:'ell_status')
205
+ if attributes.key?(:'ell_status')
180
206
  self.ell_status = attributes[:'ell_status']
181
207
  end
182
208
 
183
- if attributes.has_key?(:'email')
209
+ if attributes.key?(:'email')
184
210
  self.email = attributes[:'email']
185
211
  end
186
212
 
187
- if attributes.has_key?(:'enrollments')
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.has_key?(:'ext')
219
+ if attributes.key?(:'ext')
194
220
  self.ext = attributes[:'ext']
195
221
  end
196
222
 
197
- if attributes.has_key?(:'gender')
223
+ if attributes.key?(:'gender')
198
224
  self.gender = attributes[:'gender']
199
225
  end
200
226
 
201
- if attributes.has_key?(:'grade')
227
+ if attributes.key?(:'grade')
202
228
  self.grade = attributes[:'grade']
203
229
  end
204
230
 
205
- if attributes.has_key?(:'graduation_year')
231
+ if attributes.key?(:'graduation_year')
206
232
  self.graduation_year = attributes[:'graduation_year']
207
233
  end
208
234
 
209
- if attributes.has_key?(:'hispanic_ethnicity')
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?(:'id')
243
+ if attributes.key?(:'id')
218
244
  self.id = attributes[:'id']
219
245
  end
220
246
 
221
- if attributes.has_key?(:'iep_status')
247
+ if attributes.key?(:'iep_status')
222
248
  self.iep_status = attributes[:'iep_status']
223
249
  end
224
250
 
225
- if attributes.has_key?(:'last_modified')
251
+ if attributes.key?(:'last_modified')
226
252
  self.last_modified = attributes[:'last_modified']
227
253
  end
228
254
 
229
- if attributes.has_key?(:'location')
255
+ if attributes.key?(:'location')
230
256
  self.location = attributes[:'location']
231
257
  end
232
258
 
233
- if attributes.has_key?(:'name')
259
+ if attributes.key?(:'name')
234
260
  self.name = attributes[:'name']
235
261
  end
236
262
 
237
- if attributes.has_key?(:'race')
263
+ if attributes.key?(:'race')
238
264
  self.race = attributes[:'race']
239
265
  end
240
266
 
241
- if attributes.has_key?(:'school')
267
+ if attributes.key?(:'school')
242
268
  self.school = attributes[:'school']
243
269
  end
244
270
 
245
- if attributes.has_key?(:'schools')
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.has_key?(:'sis_id')
277
+ if attributes.key?(:'sis_id')
252
278
  self.sis_id = attributes[:'sis_id']
253
279
  end
254
280
 
255
- if attributes.has_key?(:'state_id')
281
+ if attributes.key?(:'state_id')
256
282
  self.state_id = attributes[:'state_id']
257
283
  end
258
284
 
259
- if attributes.has_key?(:'student_number')
285
+ if attributes.key?(:'student_number')
260
286
  self.student_number = attributes[:'student_number']
261
287
  end
262
288
 
263
- if attributes.has_key?(:'unweighted_gpa')
289
+ if attributes.key?(:'unweighted_gpa')
264
290
  self.unweighted_gpa = attributes[:'unweighted_gpa']
265
291
  end
266
292
 
267
- if attributes.has_key?(:'weighted_gpa')
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
- 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
@@ -409,17 +420,24 @@ 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
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.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