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.
- checksums.yaml +4 -4
- data/Gemfile +3 -1
- data/Gemfile.lock +37 -29
- data/README.md +994 -61
- data/clever-ruby.gemspec +6 -13
- 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 +1 -2
- data/docs/ContactObject.md +0 -1
- data/docs/ContactResponse.md +0 -1
- data/docs/ContactsCreated.md +2 -3
- data/docs/ContactsDeleted.md +2 -3
- data/docs/ContactsResponse.md +0 -1
- data/docs/ContactsUpdated.md +2 -3
- data/docs/Course.md +1 -2
- data/docs/CourseObject.md +0 -1
- data/docs/CourseResponse.md +0 -1
- data/docs/CoursesCreated.md +2 -3
- data/docs/CoursesDeleted.md +2 -3
- data/docs/CoursesResponse.md +0 -1
- data/docs/CoursesUpdated.md +2 -3
- data/docs/Credentials.md +0 -1
- data/docs/DataApi.md +2784 -0
- data/docs/District.md +9 -10
- data/docs/DistrictAdmin.md +2 -3
- 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 +2 -3
- data/docs/DistrictadminsDeleted.md +2 -3
- data/docs/DistrictadminsUpdated.md +2 -3
- data/docs/DistrictsCreated.md +2 -3
- data/docs/DistrictsDeleted.md +2 -3
- data/docs/DistrictsResponse.md +0 -1
- data/docs/DistrictsUpdated.md +2 -3
- data/docs/Event.md +2 -3
- data/docs/EventResponse.md +0 -1
- data/docs/EventsApi.md +1 -4
- data/docs/EventsResponse.md +0 -1
- data/docs/InternalError.md +0 -1
- data/docs/Link.md +0 -1
- data/docs/Location.md +2 -3
- data/docs/Name.md +1 -2
- data/docs/NotFound.md +0 -1
- data/docs/Principal.md +1 -2
- data/docs/School.md +3 -4
- data/docs/SchoolAdmin.md +3 -4
- data/docs/SchoolAdminObject.md +0 -1
- data/docs/SchoolAdminResponse.md +0 -1
- data/docs/SchoolAdminsResponse.md +0 -1
- data/docs/SchoolEnrollment.md +1 -2
- data/docs/SchoolObject.md +0 -1
- data/docs/SchoolResponse.md +0 -1
- data/docs/SchooladminsCreated.md +2 -3
- data/docs/SchooladminsDeleted.md +2 -3
- data/docs/SchooladminsUpdated.md +2 -3
- data/docs/SchoolsCreated.md +2 -3
- data/docs/SchoolsDeleted.md +2 -3
- data/docs/SchoolsResponse.md +0 -1
- data/docs/SchoolsUpdated.md +2 -3
- data/docs/Section.md +2 -3
- data/docs/SectionObject.md +0 -1
- data/docs/SectionResponse.md +0 -1
- data/docs/SectionsCreated.md +2 -3
- data/docs/SectionsDeleted.md +2 -3
- data/docs/SectionsResponse.md +0 -1
- data/docs/SectionsUpdated.md +2 -3
- data/docs/Student.md +3 -4
- data/docs/StudentObject.md +0 -1
- data/docs/StudentResponse.md +0 -1
- data/docs/StudentsCreated.md +2 -3
- data/docs/StudentsDeleted.md +2 -3
- data/docs/StudentsResponse.md +0 -1
- data/docs/StudentsUpdated.md +2 -3
- data/docs/Teacher.md +2 -3
- data/docs/TeacherObject.md +0 -1
- data/docs/TeacherResponse.md +0 -1
- data/docs/TeachersCreated.md +2 -3
- data/docs/TeachersDeleted.md +2 -3
- data/docs/TeachersResponse.md +0 -1
- data/docs/TeachersUpdated.md +2 -3
- data/docs/Term.md +2 -3
- data/docs/TermObject.md +0 -1
- data/docs/TermResponse.md +0 -1
- data/docs/TermsCreated.md +2 -3
- data/docs/TermsDeleted.md +2 -3
- data/docs/TermsResponse.md +0 -1
- data/docs/TermsUpdated.md +2 -3
- data/git_push.sh +55 -0
- data/lib/clever-ruby/api/data_api.rb +2999 -0
- data/lib/clever-ruby/api/events_api.rb +25 -20
- data/lib/clever-ruby/api_error.rb +23 -4
- data/lib/clever-ruby/configuration.rb +5 -9
- data/lib/clever-ruby/models/admin_name.rb +46 -22
- data/lib/clever-ruby/models/bad_request.rb +42 -20
- data/lib/clever-ruby/models/contact.rb +83 -55
- data/lib/clever-ruby/models/contact_object.rb +42 -20
- data/lib/clever-ruby/models/contact_response.rb +42 -20
- data/lib/clever-ruby/models/contacts_response.rb +44 -22
- data/lib/clever-ruby/models/course.rb +60 -36
- data/lib/clever-ruby/models/course_object.rb +42 -20
- data/lib/clever-ruby/models/course_response.rb +42 -20
- data/lib/clever-ruby/models/courses_response.rb +44 -22
- data/lib/clever-ruby/models/credentials.rb +42 -20
- data/lib/clever-ruby/models/district.rb +122 -94
- data/lib/clever-ruby/models/district_admin.rb +67 -44
- data/lib/clever-ruby/models/district_admin_object.rb +42 -20
- data/lib/clever-ruby/models/district_admin_response.rb +42 -20
- data/lib/clever-ruby/models/district_admins_response.rb +44 -22
- data/lib/clever-ruby/models/district_object.rb +42 -20
- data/lib/clever-ruby/models/district_response.rb +42 -20
- data/lib/clever-ruby/models/districts_response.rb +44 -22
- data/lib/clever-ruby/models/event.rb +60 -33
- data/lib/clever-ruby/models/event_response.rb +42 -20
- data/lib/clever-ruby/models/events_response.rb +44 -22
- data/lib/clever-ruby/models/internal_error.rb +42 -20
- data/lib/clever-ruby/models/link.rb +47 -25
- data/lib/clever-ruby/models/location.rb +73 -45
- data/lib/clever-ruby/models/name.rb +58 -33
- data/lib/clever-ruby/models/not_found.rb +42 -20
- data/lib/clever-ruby/models/principal.rb +55 -31
- data/lib/clever-ruby/models/school.rb +108 -80
- data/lib/clever-ruby/models/school_admin.rb +85 -61
- data/lib/clever-ruby/models/school_admin_object.rb +42 -20
- data/lib/clever-ruby/models/school_admin_response.rb +42 -20
- data/lib/clever-ruby/models/school_admins_response.rb +44 -22
- data/lib/clever-ruby/models/school_enrollment.rb +56 -34
- data/lib/clever-ruby/models/school_object.rb +42 -20
- data/lib/clever-ruby/models/school_response.rb +42 -20
- data/lib/clever-ruby/models/schools_response.rb +44 -22
- data/lib/clever-ruby/models/section.rb +104 -75
- data/lib/clever-ruby/models/section_object.rb +42 -20
- data/lib/clever-ruby/models/section_response.rb +42 -20
- data/lib/clever-ruby/models/sections_response.rb +44 -22
- data/lib/clever-ruby/models/student.rb +147 -126
- data/lib/clever-ruby/models/student_object.rb +42 -20
- data/lib/clever-ruby/models/student_response.rb +42 -20
- data/lib/clever-ruby/models/students_response.rb +44 -22
- data/lib/clever-ruby/models/teacher.rb +89 -63
- data/lib/clever-ruby/models/teacher_object.rb +42 -20
- data/lib/clever-ruby/models/teacher_response.rb +42 -20
- data/lib/clever-ruby/models/teachers_response.rb +44 -22
- data/lib/clever-ruby/models/term.rb +69 -44
- data/lib/clever-ruby/models/term_object.rb +42 -20
- data/lib/clever-ruby/models/term_response.rb +42 -20
- data/lib/clever-ruby/models/terms_response.rb +44 -22
- data/lib/clever-ruby/version.rb +4 -5
- data/lib/clever-ruby.rb +4 -14
- data/override/README-extension.md +1 -1
- data/override/override.sh +3 -0
- data/spec/api/data_api_spec.rb +671 -0
- data/spec/api/events_api_spec.rb +4 -3
- data/spec/api_client_spec.rb +21 -3
- data/spec/spec_helper.rb +4 -3
- metadata +25 -179
- data/docs/ContactsApi.md +0 -231
- data/docs/CoursesApi.md +0 -231
- data/docs/DistrictAdminsApi.md +0 -171
- data/docs/DistrictsApi.md +0 -113
- data/docs/SchoolAdminsApi.md +0 -231
- data/docs/SchoolsApi.md +0 -351
- data/docs/SectionsApi.md +0 -499
- data/docs/StudentsApi.md +0 -463
- data/docs/TeachersApi.md +0 -403
- data/docs/TermsApi.md +0 -231
- data/lib/clever-ruby/api/contacts_api.rb +0 -241
- data/lib/clever-ruby/api/courses_api.rb +0 -241
- data/lib/clever-ruby/api/district_admins_api.rb +0 -182
- data/lib/clever-ruby/api/districts_api.rb +0 -123
- data/lib/clever-ruby/api/school_admins_api.rb +0 -241
- data/lib/clever-ruby/api/schools_api.rb +0 -359
- data/lib/clever-ruby/api/sections_api.rb +0 -500
- data/lib/clever-ruby/api/students_api.rb +0 -468
- data/lib/clever-ruby/api/teachers_api.rb +0 -409
- data/lib/clever-ruby/api/terms_api.rb +0 -241
- data/spec/api/contacts_api_spec.rb +0 -84
- data/spec/api/courses_api_spec.rb +0 -84
- data/spec/api/district_admins_api_spec.rb +0 -70
- data/spec/api/districts_api_spec.rb +0 -56
- data/spec/api/school_admins_api_spec.rb +0 -84
- data/spec/api/schools_api_spec.rb +0 -112
- data/spec/api/sections_api_spec.rb +0 -142
- data/spec/api/students_api_spec.rb +0 -137
- data/spec/api/teachers_api_spec.rb +0 -123
- data/spec/api/terms_api_spec.rb +0 -84
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#
|
|
2
|
+
#Clever API
|
|
3
3
|
|
|
4
|
-
#
|
|
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:
|
|
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 Section
|
|
17
|
-
attr_accessor :id
|
|
18
|
-
|
|
19
16
|
attr_accessor :course
|
|
20
17
|
|
|
21
18
|
attr_accessor :created
|
|
22
19
|
|
|
23
20
|
attr_accessor :district
|
|
24
21
|
|
|
22
|
+
attr_accessor :ext
|
|
23
|
+
|
|
25
24
|
attr_accessor :grade
|
|
26
25
|
|
|
26
|
+
attr_accessor :id
|
|
27
|
+
|
|
27
28
|
attr_accessor :last_modified
|
|
28
29
|
|
|
29
30
|
attr_accessor :name
|
|
@@ -46,8 +47,6 @@ module Clever
|
|
|
46
47
|
|
|
47
48
|
attr_accessor :term_id
|
|
48
49
|
|
|
49
|
-
attr_accessor :ext
|
|
50
|
-
|
|
51
50
|
class EnumAttributeValidator
|
|
52
51
|
attr_reader :datatype
|
|
53
52
|
attr_reader :allowable_values
|
|
@@ -73,11 +72,12 @@ module Clever
|
|
|
73
72
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
74
73
|
def self.attribute_map
|
|
75
74
|
{
|
|
76
|
-
:'id' => :'id',
|
|
77
75
|
:'course' => :'course',
|
|
78
76
|
:'created' => :'created',
|
|
79
77
|
:'district' => :'district',
|
|
78
|
+
:'ext' => :'ext',
|
|
80
79
|
:'grade' => :'grade',
|
|
80
|
+
:'id' => :'id',
|
|
81
81
|
:'last_modified' => :'last_modified',
|
|
82
82
|
:'name' => :'name',
|
|
83
83
|
:'period' => :'period',
|
|
@@ -88,113 +88,132 @@ module Clever
|
|
|
88
88
|
:'subject' => :'subject',
|
|
89
89
|
:'teacher' => :'teacher',
|
|
90
90
|
:'teachers' => :'teachers',
|
|
91
|
-
:'term_id' => :'term_id'
|
|
92
|
-
:'ext' => :'ext'
|
|
91
|
+
:'term_id' => :'term_id'
|
|
93
92
|
}
|
|
94
93
|
end
|
|
95
94
|
|
|
96
95
|
# Attribute type mapping.
|
|
97
|
-
def self.
|
|
96
|
+
def self.openapi_types
|
|
98
97
|
{
|
|
99
|
-
:'
|
|
100
|
-
:'
|
|
101
|
-
:'
|
|
102
|
-
:'
|
|
103
|
-
:'grade' => :'
|
|
104
|
-
:'
|
|
105
|
-
:'
|
|
106
|
-
:'
|
|
107
|
-
:'
|
|
108
|
-
:'
|
|
109
|
-
:'
|
|
110
|
-
:'
|
|
111
|
-
:'
|
|
112
|
-
:'
|
|
113
|
-
:'
|
|
114
|
-
:'
|
|
115
|
-
:'
|
|
98
|
+
:'course' => :'Object',
|
|
99
|
+
:'created' => :'Object',
|
|
100
|
+
:'district' => :'Object',
|
|
101
|
+
:'ext' => :'Object',
|
|
102
|
+
:'grade' => :'Object',
|
|
103
|
+
:'id' => :'Object',
|
|
104
|
+
:'last_modified' => :'Object',
|
|
105
|
+
:'name' => :'Object',
|
|
106
|
+
:'period' => :'Object',
|
|
107
|
+
:'school' => :'Object',
|
|
108
|
+
:'section_number' => :'Object',
|
|
109
|
+
:'sis_id' => :'Object',
|
|
110
|
+
:'students' => :'Object',
|
|
111
|
+
:'subject' => :'Object',
|
|
112
|
+
:'teacher' => :'Object',
|
|
113
|
+
:'teachers' => :'Object',
|
|
114
|
+
:'term_id' => :'Object'
|
|
116
115
|
}
|
|
117
116
|
end
|
|
118
117
|
|
|
118
|
+
# List of attributes with nullable: true
|
|
119
|
+
def self.openapi_nullable
|
|
120
|
+
Set.new([
|
|
121
|
+
:'course',
|
|
122
|
+
:'grade',
|
|
123
|
+
:'period',
|
|
124
|
+
:'section_number',
|
|
125
|
+
:'subject',
|
|
126
|
+
:'teacher',
|
|
127
|
+
:'term_id'
|
|
128
|
+
])
|
|
129
|
+
end
|
|
130
|
+
|
|
119
131
|
# Initializes the object
|
|
120
132
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
121
133
|
def initialize(attributes = {})
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
# convert string to symbol for hash key
|
|
125
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
|
126
|
-
|
|
127
|
-
if attributes.has_key?(:'id')
|
|
128
|
-
self.id = attributes[:'id']
|
|
134
|
+
if (!attributes.is_a?(Hash))
|
|
135
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Section` initialize method"
|
|
129
136
|
end
|
|
130
137
|
|
|
131
|
-
if
|
|
138
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
139
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
140
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
141
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Section`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
142
|
+
end
|
|
143
|
+
h[k.to_sym] = v
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
if attributes.key?(:'course')
|
|
132
147
|
self.course = attributes[:'course']
|
|
133
148
|
end
|
|
134
149
|
|
|
135
|
-
if attributes.
|
|
150
|
+
if attributes.key?(:'created')
|
|
136
151
|
self.created = attributes[:'created']
|
|
137
152
|
end
|
|
138
153
|
|
|
139
|
-
if attributes.
|
|
154
|
+
if attributes.key?(:'district')
|
|
140
155
|
self.district = attributes[:'district']
|
|
141
156
|
end
|
|
142
157
|
|
|
143
|
-
if attributes.
|
|
158
|
+
if attributes.key?(:'ext')
|
|
159
|
+
self.ext = attributes[:'ext']
|
|
160
|
+
end
|
|
161
|
+
|
|
162
|
+
if attributes.key?(:'grade')
|
|
144
163
|
self.grade = attributes[:'grade']
|
|
145
164
|
end
|
|
146
165
|
|
|
147
|
-
if attributes.
|
|
166
|
+
if attributes.key?(:'id')
|
|
167
|
+
self.id = attributes[:'id']
|
|
168
|
+
end
|
|
169
|
+
|
|
170
|
+
if attributes.key?(:'last_modified')
|
|
148
171
|
self.last_modified = attributes[:'last_modified']
|
|
149
172
|
end
|
|
150
173
|
|
|
151
|
-
if attributes.
|
|
174
|
+
if attributes.key?(:'name')
|
|
152
175
|
self.name = attributes[:'name']
|
|
153
176
|
end
|
|
154
177
|
|
|
155
|
-
if attributes.
|
|
178
|
+
if attributes.key?(:'period')
|
|
156
179
|
self.period = attributes[:'period']
|
|
157
180
|
end
|
|
158
181
|
|
|
159
|
-
if attributes.
|
|
182
|
+
if attributes.key?(:'school')
|
|
160
183
|
self.school = attributes[:'school']
|
|
161
184
|
end
|
|
162
185
|
|
|
163
|
-
if attributes.
|
|
186
|
+
if attributes.key?(:'section_number')
|
|
164
187
|
self.section_number = attributes[:'section_number']
|
|
165
188
|
end
|
|
166
189
|
|
|
167
|
-
if attributes.
|
|
190
|
+
if attributes.key?(:'sis_id')
|
|
168
191
|
self.sis_id = attributes[:'sis_id']
|
|
169
192
|
end
|
|
170
193
|
|
|
171
|
-
if attributes.
|
|
194
|
+
if attributes.key?(:'students')
|
|
172
195
|
if (value = attributes[:'students']).is_a?(Array)
|
|
173
196
|
self.students = value
|
|
174
197
|
end
|
|
175
198
|
end
|
|
176
199
|
|
|
177
|
-
if attributes.
|
|
200
|
+
if attributes.key?(:'subject')
|
|
178
201
|
self.subject = attributes[:'subject']
|
|
179
202
|
end
|
|
180
203
|
|
|
181
|
-
if attributes.
|
|
204
|
+
if attributes.key?(:'teacher')
|
|
182
205
|
self.teacher = attributes[:'teacher']
|
|
183
206
|
end
|
|
184
207
|
|
|
185
|
-
if attributes.
|
|
208
|
+
if attributes.key?(:'teachers')
|
|
186
209
|
if (value = attributes[:'teachers']).is_a?(Array)
|
|
187
210
|
self.teachers = value
|
|
188
211
|
end
|
|
189
212
|
end
|
|
190
213
|
|
|
191
|
-
if attributes.
|
|
214
|
+
if attributes.key?(:'term_id')
|
|
192
215
|
self.term_id = attributes[:'term_id']
|
|
193
216
|
end
|
|
194
|
-
|
|
195
|
-
if attributes.has_key?(:'ext')
|
|
196
|
-
self.ext = attributes[:'ext']
|
|
197
|
-
end
|
|
198
217
|
end
|
|
199
218
|
|
|
200
219
|
# Show invalid properties with the reasons. Usually used together with valid?
|
|
@@ -207,9 +226,9 @@ module Clever
|
|
|
207
226
|
# Check to see if the all the properties in the model are valid
|
|
208
227
|
# @return true if the model is valid
|
|
209
228
|
def valid?
|
|
210
|
-
grade_validator = EnumAttributeValidator.new('
|
|
229
|
+
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', ''])
|
|
211
230
|
return false unless grade_validator.valid?(@grade)
|
|
212
|
-
subject_validator = EnumAttributeValidator.new('
|
|
231
|
+
subject_validator = EnumAttributeValidator.new('Object', ['english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other', ''])
|
|
213
232
|
return false unless subject_validator.valid?(@subject)
|
|
214
233
|
true
|
|
215
234
|
end
|
|
@@ -217,9 +236,9 @@ module Clever
|
|
|
217
236
|
# Custom attribute writer method checking allowed values (enum).
|
|
218
237
|
# @param [Object] grade Object to be assigned
|
|
219
238
|
def grade=(grade)
|
|
220
|
-
validator = EnumAttributeValidator.new('
|
|
239
|
+
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', ''])
|
|
221
240
|
unless validator.valid?(grade)
|
|
222
|
-
fail ArgumentError,
|
|
241
|
+
fail ArgumentError, "invalid value for \"grade\", must be one of #{validator.allowable_values}."
|
|
223
242
|
end
|
|
224
243
|
@grade = grade
|
|
225
244
|
end
|
|
@@ -227,9 +246,9 @@ module Clever
|
|
|
227
246
|
# Custom attribute writer method checking allowed values (enum).
|
|
228
247
|
# @param [Object] subject Object to be assigned
|
|
229
248
|
def subject=(subject)
|
|
230
|
-
validator = EnumAttributeValidator.new('
|
|
249
|
+
validator = EnumAttributeValidator.new('Object', ['english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other', ''])
|
|
231
250
|
unless validator.valid?(subject)
|
|
232
|
-
fail ArgumentError,
|
|
251
|
+
fail ArgumentError, "invalid value for \"subject\", must be one of #{validator.allowable_values}."
|
|
233
252
|
end
|
|
234
253
|
@subject = subject
|
|
235
254
|
end
|
|
@@ -239,11 +258,12 @@ module Clever
|
|
|
239
258
|
def ==(o)
|
|
240
259
|
return true if self.equal?(o)
|
|
241
260
|
self.class == o.class &&
|
|
242
|
-
id == o.id &&
|
|
243
261
|
course == o.course &&
|
|
244
262
|
created == o.created &&
|
|
245
263
|
district == o.district &&
|
|
264
|
+
ext == o.ext &&
|
|
246
265
|
grade == o.grade &&
|
|
266
|
+
id == o.id &&
|
|
247
267
|
last_modified == o.last_modified &&
|
|
248
268
|
name == o.name &&
|
|
249
269
|
period == o.period &&
|
|
@@ -254,8 +274,7 @@ module Clever
|
|
|
254
274
|
subject == o.subject &&
|
|
255
275
|
teacher == o.teacher &&
|
|
256
276
|
teachers == o.teachers &&
|
|
257
|
-
term_id == o.term_id
|
|
258
|
-
ext == o.ext
|
|
277
|
+
term_id == o.term_id
|
|
259
278
|
end
|
|
260
279
|
|
|
261
280
|
# @see the `==` method
|
|
@@ -265,9 +284,16 @@ module Clever
|
|
|
265
284
|
end
|
|
266
285
|
|
|
267
286
|
# Calculates hash code according to all attributes.
|
|
268
|
-
# @return [
|
|
287
|
+
# @return [Integer] Hash code
|
|
269
288
|
def hash
|
|
270
|
-
[
|
|
289
|
+
[course, created, district, ext, grade, id, last_modified, name, period, school, section_number, sis_id, students, subject, teacher, teachers, term_id].hash
|
|
290
|
+
end
|
|
291
|
+
|
|
292
|
+
# Builds the object from hash
|
|
293
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
294
|
+
# @return [Object] Returns the model itself
|
|
295
|
+
def self.build_from_hash(attributes)
|
|
296
|
+
new.build_from_hash(attributes)
|
|
271
297
|
end
|
|
272
298
|
|
|
273
299
|
# Builds the object from hash
|
|
@@ -275,7 +301,7 @@ module Clever
|
|
|
275
301
|
# @return [Object] Returns the model itself
|
|
276
302
|
def build_from_hash(attributes)
|
|
277
303
|
return nil unless attributes.is_a?(Hash)
|
|
278
|
-
self.class.
|
|
304
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
279
305
|
if type =~ /\AArray<(.*)>/i
|
|
280
306
|
# check to ensure the input is an array given that the attribute
|
|
281
307
|
# is documented as an array but the input is not
|
|
@@ -284,7 +310,9 @@ module Clever
|
|
|
284
310
|
end
|
|
285
311
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
286
312
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
287
|
-
|
|
313
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
314
|
+
self.send("#{key}=", nil)
|
|
315
|
+
end
|
|
288
316
|
end
|
|
289
317
|
|
|
290
318
|
self
|
|
@@ -306,7 +334,7 @@ module Clever
|
|
|
306
334
|
value.to_i
|
|
307
335
|
when :Float
|
|
308
336
|
value.to_f
|
|
309
|
-
when :
|
|
337
|
+
when :Boolean
|
|
310
338
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
311
339
|
true
|
|
312
340
|
else
|
|
@@ -327,8 +355,7 @@ module Clever
|
|
|
327
355
|
end
|
|
328
356
|
end
|
|
329
357
|
else # model
|
|
330
|
-
|
|
331
|
-
temp_model.build_from_hash(value)
|
|
358
|
+
Clever.const_get(type).build_from_hash(value)
|
|
332
359
|
end
|
|
333
360
|
end
|
|
334
361
|
|
|
@@ -350,7 +377,11 @@ module Clever
|
|
|
350
377
|
hash = {}
|
|
351
378
|
self.class.attribute_map.each_pair do |attr, param|
|
|
352
379
|
value = self.send(attr)
|
|
353
|
-
|
|
380
|
+
if value.nil?
|
|
381
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
382
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
383
|
+
end
|
|
384
|
+
|
|
354
385
|
hash[param] = _to_hash(value)
|
|
355
386
|
end
|
|
356
387
|
hash
|
|
@@ -372,7 +403,5 @@ module Clever
|
|
|
372
403
|
else
|
|
373
404
|
value
|
|
374
405
|
end
|
|
375
|
-
end
|
|
376
|
-
|
|
377
|
-
end
|
|
406
|
+
end end
|
|
378
407
|
end
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#
|
|
2
|
+
#Clever API
|
|
3
3
|
|
|
4
|
-
#
|
|
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:
|
|
10
|
-
|
|
9
|
+
Swagger Codegen version: 3.0.51
|
|
11
10
|
=end
|
|
12
11
|
|
|
13
12
|
require 'date'
|
|
@@ -24,21 +23,34 @@ module Clever
|
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
# Attribute type mapping.
|
|
27
|
-
def self.
|
|
26
|
+
def self.openapi_types
|
|
28
27
|
{
|
|
29
|
-
:'object' => :'
|
|
28
|
+
:'object' => :'Object'
|
|
30
29
|
}
|
|
31
30
|
end
|
|
32
31
|
|
|
32
|
+
# List of attributes with nullable: true
|
|
33
|
+
def self.openapi_nullable
|
|
34
|
+
Set.new([
|
|
35
|
+
])
|
|
36
|
+
end
|
|
37
|
+
|
|
33
38
|
# Initializes the object
|
|
34
39
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
35
40
|
def initialize(attributes = {})
|
|
36
|
-
|
|
41
|
+
if (!attributes.is_a?(Hash))
|
|
42
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SectionObject` initialize method"
|
|
43
|
+
end
|
|
37
44
|
|
|
38
|
-
# convert string to symbol for hash key
|
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
45
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
47
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
48
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SectionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
49
|
+
end
|
|
50
|
+
h[k.to_sym] = v
|
|
51
|
+
}
|
|
40
52
|
|
|
41
|
-
if attributes.
|
|
53
|
+
if attributes.key?(:'object')
|
|
42
54
|
self.object = attributes[:'object']
|
|
43
55
|
end
|
|
44
56
|
end
|
|
@@ -71,17 +83,24 @@ module Clever
|
|
|
71
83
|
end
|
|
72
84
|
|
|
73
85
|
# Calculates hash code according to all attributes.
|
|
74
|
-
# @return [
|
|
86
|
+
# @return [Integer] Hash code
|
|
75
87
|
def hash
|
|
76
88
|
[object].hash
|
|
77
89
|
end
|
|
78
90
|
|
|
91
|
+
# Builds the object from hash
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
# @return [Object] Returns the model itself
|
|
94
|
+
def self.build_from_hash(attributes)
|
|
95
|
+
new.build_from_hash(attributes)
|
|
96
|
+
end
|
|
97
|
+
|
|
79
98
|
# Builds the object from hash
|
|
80
99
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
100
|
# @return [Object] Returns the model itself
|
|
82
101
|
def build_from_hash(attributes)
|
|
83
102
|
return nil unless attributes.is_a?(Hash)
|
|
84
|
-
self.class.
|
|
103
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
85
104
|
if type =~ /\AArray<(.*)>/i
|
|
86
105
|
# check to ensure the input is an array given that the attribute
|
|
87
106
|
# is documented as an array but the input is not
|
|
@@ -90,7 +109,9 @@ module Clever
|
|
|
90
109
|
end
|
|
91
110
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
92
111
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
93
|
-
|
|
112
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
113
|
+
self.send("#{key}=", nil)
|
|
114
|
+
end
|
|
94
115
|
end
|
|
95
116
|
|
|
96
117
|
self
|
|
@@ -112,7 +133,7 @@ module Clever
|
|
|
112
133
|
value.to_i
|
|
113
134
|
when :Float
|
|
114
135
|
value.to_f
|
|
115
|
-
when :
|
|
136
|
+
when :Boolean
|
|
116
137
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
117
138
|
true
|
|
118
139
|
else
|
|
@@ -133,8 +154,7 @@ module Clever
|
|
|
133
154
|
end
|
|
134
155
|
end
|
|
135
156
|
else # model
|
|
136
|
-
|
|
137
|
-
temp_model.build_from_hash(value)
|
|
157
|
+
Clever.const_get(type).build_from_hash(value)
|
|
138
158
|
end
|
|
139
159
|
end
|
|
140
160
|
|
|
@@ -156,7 +176,11 @@ module Clever
|
|
|
156
176
|
hash = {}
|
|
157
177
|
self.class.attribute_map.each_pair do |attr, param|
|
|
158
178
|
value = self.send(attr)
|
|
159
|
-
|
|
179
|
+
if value.nil?
|
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
182
|
+
end
|
|
183
|
+
|
|
160
184
|
hash[param] = _to_hash(value)
|
|
161
185
|
end
|
|
162
186
|
hash
|
|
@@ -178,7 +202,5 @@ module Clever
|
|
|
178
202
|
else
|
|
179
203
|
value
|
|
180
204
|
end
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
end
|
|
205
|
+
end end
|
|
184
206
|
end
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
=begin
|
|
2
|
-
#
|
|
2
|
+
#Clever API
|
|
3
3
|
|
|
4
|
-
#
|
|
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:
|
|
10
|
-
|
|
9
|
+
Swagger Codegen version: 3.0.51
|
|
11
10
|
=end
|
|
12
11
|
|
|
13
12
|
require 'date'
|
|
@@ -24,21 +23,34 @@ module Clever
|
|
|
24
23
|
end
|
|
25
24
|
|
|
26
25
|
# Attribute type mapping.
|
|
27
|
-
def self.
|
|
26
|
+
def self.openapi_types
|
|
28
27
|
{
|
|
29
|
-
:'data' => :'
|
|
28
|
+
:'data' => :'Object'
|
|
30
29
|
}
|
|
31
30
|
end
|
|
32
31
|
|
|
32
|
+
# List of attributes with nullable: true
|
|
33
|
+
def self.openapi_nullable
|
|
34
|
+
Set.new([
|
|
35
|
+
])
|
|
36
|
+
end
|
|
37
|
+
|
|
33
38
|
# Initializes the object
|
|
34
39
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
35
40
|
def initialize(attributes = {})
|
|
36
|
-
|
|
41
|
+
if (!attributes.is_a?(Hash))
|
|
42
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SectionResponse` initialize method"
|
|
43
|
+
end
|
|
37
44
|
|
|
38
|
-
# convert string to symbol for hash key
|
|
39
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
45
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
46
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
47
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
48
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SectionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
49
|
+
end
|
|
50
|
+
h[k.to_sym] = v
|
|
51
|
+
}
|
|
40
52
|
|
|
41
|
-
if attributes.
|
|
53
|
+
if attributes.key?(:'data')
|
|
42
54
|
self.data = attributes[:'data']
|
|
43
55
|
end
|
|
44
56
|
end
|
|
@@ -71,17 +83,24 @@ module Clever
|
|
|
71
83
|
end
|
|
72
84
|
|
|
73
85
|
# Calculates hash code according to all attributes.
|
|
74
|
-
# @return [
|
|
86
|
+
# @return [Integer] Hash code
|
|
75
87
|
def hash
|
|
76
88
|
[data].hash
|
|
77
89
|
end
|
|
78
90
|
|
|
91
|
+
# Builds the object from hash
|
|
92
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
93
|
+
# @return [Object] Returns the model itself
|
|
94
|
+
def self.build_from_hash(attributes)
|
|
95
|
+
new.build_from_hash(attributes)
|
|
96
|
+
end
|
|
97
|
+
|
|
79
98
|
# Builds the object from hash
|
|
80
99
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
81
100
|
# @return [Object] Returns the model itself
|
|
82
101
|
def build_from_hash(attributes)
|
|
83
102
|
return nil unless attributes.is_a?(Hash)
|
|
84
|
-
self.class.
|
|
103
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
85
104
|
if type =~ /\AArray<(.*)>/i
|
|
86
105
|
# check to ensure the input is an array given that the attribute
|
|
87
106
|
# is documented as an array but the input is not
|
|
@@ -90,7 +109,9 @@ module Clever
|
|
|
90
109
|
end
|
|
91
110
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
92
111
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
93
|
-
|
|
112
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
113
|
+
self.send("#{key}=", nil)
|
|
114
|
+
end
|
|
94
115
|
end
|
|
95
116
|
|
|
96
117
|
self
|
|
@@ -112,7 +133,7 @@ module Clever
|
|
|
112
133
|
value.to_i
|
|
113
134
|
when :Float
|
|
114
135
|
value.to_f
|
|
115
|
-
when :
|
|
136
|
+
when :Boolean
|
|
116
137
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
117
138
|
true
|
|
118
139
|
else
|
|
@@ -133,8 +154,7 @@ module Clever
|
|
|
133
154
|
end
|
|
134
155
|
end
|
|
135
156
|
else # model
|
|
136
|
-
|
|
137
|
-
temp_model.build_from_hash(value)
|
|
157
|
+
Clever.const_get(type).build_from_hash(value)
|
|
138
158
|
end
|
|
139
159
|
end
|
|
140
160
|
|
|
@@ -156,7 +176,11 @@ module Clever
|
|
|
156
176
|
hash = {}
|
|
157
177
|
self.class.attribute_map.each_pair do |attr, param|
|
|
158
178
|
value = self.send(attr)
|
|
159
|
-
|
|
179
|
+
if value.nil?
|
|
180
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
181
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
182
|
+
end
|
|
183
|
+
|
|
160
184
|
hash[param] = _to_hash(value)
|
|
161
185
|
end
|
|
162
186
|
hash
|
|
@@ -178,7 +202,5 @@ module Clever
|
|
|
178
202
|
else
|
|
179
203
|
value
|
|
180
204
|
end
|
|
181
|
-
end
|
|
182
|
-
|
|
183
|
-
end
|
|
205
|
+
end end
|
|
184
206
|
end
|