commonlit-clever-ruby 2.1.6.beta1 → 2.1.6.beta2
Sign up to get free protection for your applications and to get access to all the features.
- 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,53 +1,67 @@
|
|
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 Principal
|
17
|
-
attr_accessor :name
|
18
|
-
|
19
16
|
attr_accessor :email
|
20
17
|
|
18
|
+
attr_accessor :name
|
19
|
+
|
21
20
|
# Attribute mapping from ruby-style variable name to JSON key.
|
22
21
|
def self.attribute_map
|
23
22
|
{
|
24
|
-
:'
|
25
|
-
:'
|
23
|
+
:'email' => :'email',
|
24
|
+
:'name' => :'name'
|
26
25
|
}
|
27
26
|
end
|
28
27
|
|
29
28
|
# Attribute type mapping.
|
30
|
-
def self.
|
29
|
+
def self.openapi_types
|
31
30
|
{
|
32
|
-
:'
|
33
|
-
:'
|
31
|
+
:'email' => :'Object',
|
32
|
+
:'name' => :'Object'
|
34
33
|
}
|
35
34
|
end
|
36
35
|
|
36
|
+
# List of attributes with nullable: true
|
37
|
+
def self.openapi_nullable
|
38
|
+
Set.new([
|
39
|
+
:'email',
|
40
|
+
:'name'
|
41
|
+
])
|
42
|
+
end
|
43
|
+
|
37
44
|
# Initializes the object
|
38
45
|
# @param [Hash] attributes Model attributes in the form of hash
|
39
46
|
def initialize(attributes = {})
|
40
|
-
|
47
|
+
if (!attributes.is_a?(Hash))
|
48
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Principal` initialize method"
|
49
|
+
end
|
41
50
|
|
42
|
-
# convert string to symbol for hash key
|
43
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
51
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
52
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
53
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
54
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Principal`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
55
|
+
end
|
56
|
+
h[k.to_sym] = v
|
57
|
+
}
|
44
58
|
|
45
|
-
if attributes.
|
46
|
-
self.
|
59
|
+
if attributes.key?(:'email')
|
60
|
+
self.email = attributes[:'email']
|
47
61
|
end
|
48
62
|
|
49
|
-
if attributes.
|
50
|
-
self.
|
63
|
+
if attributes.key?(:'name')
|
64
|
+
self.name = attributes[:'name']
|
51
65
|
end
|
52
66
|
end
|
53
67
|
|
@@ -69,8 +83,8 @@ module Clever
|
|
69
83
|
def ==(o)
|
70
84
|
return true if self.equal?(o)
|
71
85
|
self.class == o.class &&
|
72
|
-
|
73
|
-
|
86
|
+
email == o.email &&
|
87
|
+
name == o.name
|
74
88
|
end
|
75
89
|
|
76
90
|
# @see the `==` method
|
@@ -80,9 +94,16 @@ module Clever
|
|
80
94
|
end
|
81
95
|
|
82
96
|
# Calculates hash code according to all attributes.
|
83
|
-
# @return [
|
97
|
+
# @return [Integer] Hash code
|
84
98
|
def hash
|
85
|
-
[
|
99
|
+
[email, name].hash
|
100
|
+
end
|
101
|
+
|
102
|
+
# Builds the object from hash
|
103
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
104
|
+
# @return [Object] Returns the model itself
|
105
|
+
def self.build_from_hash(attributes)
|
106
|
+
new.build_from_hash(attributes)
|
86
107
|
end
|
87
108
|
|
88
109
|
# Builds the object from hash
|
@@ -90,7 +111,7 @@ module Clever
|
|
90
111
|
# @return [Object] Returns the model itself
|
91
112
|
def build_from_hash(attributes)
|
92
113
|
return nil unless attributes.is_a?(Hash)
|
93
|
-
self.class.
|
114
|
+
self.class.openapi_types.each_pair do |key, type|
|
94
115
|
if type =~ /\AArray<(.*)>/i
|
95
116
|
# check to ensure the input is an array given that the attribute
|
96
117
|
# is documented as an array but the input is not
|
@@ -99,7 +120,9 @@ module Clever
|
|
99
120
|
end
|
100
121
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
101
122
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
102
|
-
|
123
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
124
|
+
self.send("#{key}=", nil)
|
125
|
+
end
|
103
126
|
end
|
104
127
|
|
105
128
|
self
|
@@ -121,7 +144,7 @@ module Clever
|
|
121
144
|
value.to_i
|
122
145
|
when :Float
|
123
146
|
value.to_f
|
124
|
-
when :
|
147
|
+
when :Boolean
|
125
148
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
126
149
|
true
|
127
150
|
else
|
@@ -142,8 +165,7 @@ module Clever
|
|
142
165
|
end
|
143
166
|
end
|
144
167
|
else # model
|
145
|
-
|
146
|
-
temp_model.build_from_hash(value)
|
168
|
+
Clever.const_get(type).build_from_hash(value)
|
147
169
|
end
|
148
170
|
end
|
149
171
|
|
@@ -165,7 +187,11 @@ module Clever
|
|
165
187
|
hash = {}
|
166
188
|
self.class.attribute_map.each_pair do |attr, param|
|
167
189
|
value = self.send(attr)
|
168
|
-
|
190
|
+
if value.nil?
|
191
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
192
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
193
|
+
end
|
194
|
+
|
169
195
|
hash[param] = _to_hash(value)
|
170
196
|
end
|
171
197
|
hash
|
@@ -187,7 +213,5 @@ module Clever
|
|
187
213
|
else
|
188
214
|
value
|
189
215
|
end
|
190
|
-
end
|
191
|
-
|
192
|
-
end
|
216
|
+
end end
|
193
217
|
end
|
@@ -1,33 +1,36 @@
|
|
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 School
|
17
|
-
attr_accessor :id
|
18
|
-
|
19
16
|
attr_accessor :created
|
20
17
|
|
21
18
|
attr_accessor :district
|
22
19
|
|
20
|
+
attr_accessor :ext
|
21
|
+
|
23
22
|
attr_accessor :high_grade
|
24
23
|
|
24
|
+
attr_accessor :id
|
25
|
+
|
25
26
|
attr_accessor :last_modified
|
26
27
|
|
27
28
|
attr_accessor :location
|
28
29
|
|
29
30
|
attr_accessor :low_grade
|
30
31
|
|
32
|
+
attr_accessor :mdr_number
|
33
|
+
|
31
34
|
attr_accessor :name
|
32
35
|
|
33
36
|
attr_accessor :nces_id
|
@@ -42,10 +45,6 @@ module Clever
|
|
42
45
|
|
43
46
|
attr_accessor :state_id
|
44
47
|
|
45
|
-
attr_accessor :mdr_number
|
46
|
-
|
47
|
-
attr_accessor :ext
|
48
|
-
|
49
48
|
class EnumAttributeValidator
|
50
49
|
attr_reader :datatype
|
51
50
|
attr_reader :allowable_values
|
@@ -71,118 +70,137 @@ module Clever
|
|
71
70
|
# Attribute mapping from ruby-style variable name to JSON key.
|
72
71
|
def self.attribute_map
|
73
72
|
{
|
74
|
-
:'id' => :'id',
|
75
73
|
:'created' => :'created',
|
76
74
|
:'district' => :'district',
|
75
|
+
:'ext' => :'ext',
|
77
76
|
:'high_grade' => :'high_grade',
|
77
|
+
:'id' => :'id',
|
78
78
|
:'last_modified' => :'last_modified',
|
79
79
|
:'location' => :'location',
|
80
80
|
:'low_grade' => :'low_grade',
|
81
|
+
:'mdr_number' => :'mdr_number',
|
81
82
|
:'name' => :'name',
|
82
83
|
:'nces_id' => :'nces_id',
|
83
84
|
:'phone' => :'phone',
|
84
85
|
:'principal' => :'principal',
|
85
86
|
:'school_number' => :'school_number',
|
86
87
|
:'sis_id' => :'sis_id',
|
87
|
-
:'state_id' => :'state_id'
|
88
|
-
:'mdr_number' => :'mdr_number',
|
89
|
-
:'ext' => :'ext'
|
88
|
+
:'state_id' => :'state_id'
|
90
89
|
}
|
91
90
|
end
|
92
91
|
|
93
92
|
# Attribute type mapping.
|
94
|
-
def self.
|
93
|
+
def self.openapi_types
|
95
94
|
{
|
96
|
-
:'
|
97
|
-
:'
|
98
|
-
:'
|
99
|
-
:'high_grade' => :'
|
100
|
-
:'
|
101
|
-
:'
|
102
|
-
:'
|
103
|
-
:'
|
104
|
-
:'
|
105
|
-
:'
|
106
|
-
:'
|
107
|
-
:'
|
108
|
-
:'
|
109
|
-
:'
|
110
|
-
:'
|
111
|
-
:'
|
95
|
+
:'created' => :'Object',
|
96
|
+
:'district' => :'Object',
|
97
|
+
:'ext' => :'Object',
|
98
|
+
:'high_grade' => :'Object',
|
99
|
+
:'id' => :'Object',
|
100
|
+
:'last_modified' => :'Object',
|
101
|
+
:'location' => :'Object',
|
102
|
+
:'low_grade' => :'Object',
|
103
|
+
:'mdr_number' => :'Object',
|
104
|
+
:'name' => :'Object',
|
105
|
+
:'nces_id' => :'Object',
|
106
|
+
:'phone' => :'Object',
|
107
|
+
:'principal' => :'Object',
|
108
|
+
:'school_number' => :'Object',
|
109
|
+
:'sis_id' => :'Object',
|
110
|
+
:'state_id' => :'Object'
|
112
111
|
}
|
113
112
|
end
|
114
113
|
|
114
|
+
# List of attributes with nullable: true
|
115
|
+
def self.openapi_nullable
|
116
|
+
Set.new([
|
117
|
+
:'high_grade',
|
118
|
+
:'low_grade',
|
119
|
+
:'mdr_number',
|
120
|
+
:'nces_id',
|
121
|
+
:'phone',
|
122
|
+
:'state_id'
|
123
|
+
])
|
124
|
+
end
|
125
|
+
|
115
126
|
# Initializes the object
|
116
127
|
# @param [Hash] attributes Model attributes in the form of hash
|
117
128
|
def initialize(attributes = {})
|
118
|
-
|
119
|
-
|
120
|
-
# convert string to symbol for hash key
|
121
|
-
attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }
|
122
|
-
|
123
|
-
if attributes.has_key?(:'id')
|
124
|
-
self.id = attributes[:'id']
|
129
|
+
if (!attributes.is_a?(Hash))
|
130
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::School` initialize method"
|
125
131
|
end
|
126
132
|
|
127
|
-
if
|
133
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
134
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
135
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
136
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::School`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
137
|
+
end
|
138
|
+
h[k.to_sym] = v
|
139
|
+
}
|
140
|
+
|
141
|
+
if attributes.key?(:'created')
|
128
142
|
self.created = attributes[:'created']
|
129
143
|
end
|
130
144
|
|
131
|
-
if attributes.
|
145
|
+
if attributes.key?(:'district')
|
132
146
|
self.district = attributes[:'district']
|
133
147
|
end
|
134
148
|
|
135
|
-
if attributes.
|
149
|
+
if attributes.key?(:'ext')
|
150
|
+
self.ext = attributes[:'ext']
|
151
|
+
end
|
152
|
+
|
153
|
+
if attributes.key?(:'high_grade')
|
136
154
|
self.high_grade = attributes[:'high_grade']
|
137
155
|
end
|
138
156
|
|
139
|
-
if attributes.
|
157
|
+
if attributes.key?(:'id')
|
158
|
+
self.id = attributes[:'id']
|
159
|
+
end
|
160
|
+
|
161
|
+
if attributes.key?(:'last_modified')
|
140
162
|
self.last_modified = attributes[:'last_modified']
|
141
163
|
end
|
142
164
|
|
143
|
-
if attributes.
|
165
|
+
if attributes.key?(:'location')
|
144
166
|
self.location = attributes[:'location']
|
145
167
|
end
|
146
168
|
|
147
|
-
if attributes.
|
169
|
+
if attributes.key?(:'low_grade')
|
148
170
|
self.low_grade = attributes[:'low_grade']
|
149
171
|
end
|
150
172
|
|
151
|
-
if attributes.
|
173
|
+
if attributes.key?(:'mdr_number')
|
174
|
+
self.mdr_number = attributes[:'mdr_number']
|
175
|
+
end
|
176
|
+
|
177
|
+
if attributes.key?(:'name')
|
152
178
|
self.name = attributes[:'name']
|
153
179
|
end
|
154
180
|
|
155
|
-
if attributes.
|
181
|
+
if attributes.key?(:'nces_id')
|
156
182
|
self.nces_id = attributes[:'nces_id']
|
157
183
|
end
|
158
184
|
|
159
|
-
if attributes.
|
185
|
+
if attributes.key?(:'phone')
|
160
186
|
self.phone = attributes[:'phone']
|
161
187
|
end
|
162
188
|
|
163
|
-
if attributes.
|
189
|
+
if attributes.key?(:'principal')
|
164
190
|
self.principal = attributes[:'principal']
|
165
191
|
end
|
166
192
|
|
167
|
-
if attributes.
|
193
|
+
if attributes.key?(:'school_number')
|
168
194
|
self.school_number = attributes[:'school_number']
|
169
195
|
end
|
170
196
|
|
171
|
-
if attributes.
|
197
|
+
if attributes.key?(:'sis_id')
|
172
198
|
self.sis_id = attributes[:'sis_id']
|
173
199
|
end
|
174
200
|
|
175
|
-
if attributes.
|
201
|
+
if attributes.key?(:'state_id')
|
176
202
|
self.state_id = attributes[:'state_id']
|
177
203
|
end
|
178
|
-
|
179
|
-
if attributes.has_key?(:'mdr_number')
|
180
|
-
self.mdr_number = attributes[:'mdr_number']
|
181
|
-
end
|
182
|
-
|
183
|
-
if attributes.has_key?(:'ext')
|
184
|
-
self.ext = attributes[:'ext']
|
185
|
-
end
|
186
204
|
end
|
187
205
|
|
188
206
|
# Show invalid properties with the reasons. Usually used together with valid?
|
@@ -195,9 +213,9 @@ module Clever
|
|
195
213
|
# Check to see if the all the properties in the model are valid
|
196
214
|
# @return true if the model is valid
|
197
215
|
def valid?
|
198
|
-
high_grade_validator = EnumAttributeValidator.new('
|
216
|
+
high_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', ''])
|
199
217
|
return false unless high_grade_validator.valid?(@high_grade)
|
200
|
-
low_grade_validator = EnumAttributeValidator.new('
|
218
|
+
low_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', ''])
|
201
219
|
return false unless low_grade_validator.valid?(@low_grade)
|
202
220
|
true
|
203
221
|
end
|
@@ -205,9 +223,9 @@ module Clever
|
|
205
223
|
# Custom attribute writer method checking allowed values (enum).
|
206
224
|
# @param [Object] high_grade Object to be assigned
|
207
225
|
def high_grade=(high_grade)
|
208
|
-
validator = EnumAttributeValidator.new('
|
226
|
+
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', ''])
|
209
227
|
unless validator.valid?(high_grade)
|
210
|
-
fail ArgumentError,
|
228
|
+
fail ArgumentError, "invalid value for \"high_grade\", must be one of #{validator.allowable_values}."
|
211
229
|
end
|
212
230
|
@high_grade = high_grade
|
213
231
|
end
|
@@ -215,9 +233,9 @@ module Clever
|
|
215
233
|
# Custom attribute writer method checking allowed values (enum).
|
216
234
|
# @param [Object] low_grade Object to be assigned
|
217
235
|
def low_grade=(low_grade)
|
218
|
-
validator = EnumAttributeValidator.new('
|
236
|
+
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', ''])
|
219
237
|
unless validator.valid?(low_grade)
|
220
|
-
fail ArgumentError,
|
238
|
+
fail ArgumentError, "invalid value for \"low_grade\", must be one of #{validator.allowable_values}."
|
221
239
|
end
|
222
240
|
@low_grade = low_grade
|
223
241
|
end
|
@@ -227,22 +245,22 @@ module Clever
|
|
227
245
|
def ==(o)
|
228
246
|
return true if self.equal?(o)
|
229
247
|
self.class == o.class &&
|
230
|
-
id == o.id &&
|
231
248
|
created == o.created &&
|
232
249
|
district == o.district &&
|
250
|
+
ext == o.ext &&
|
233
251
|
high_grade == o.high_grade &&
|
252
|
+
id == o.id &&
|
234
253
|
last_modified == o.last_modified &&
|
235
254
|
location == o.location &&
|
236
255
|
low_grade == o.low_grade &&
|
256
|
+
mdr_number == o.mdr_number &&
|
237
257
|
name == o.name &&
|
238
258
|
nces_id == o.nces_id &&
|
239
259
|
phone == o.phone &&
|
240
260
|
principal == o.principal &&
|
241
261
|
school_number == o.school_number &&
|
242
262
|
sis_id == o.sis_id &&
|
243
|
-
state_id == o.state_id
|
244
|
-
mdr_number == o.mdr_number &&
|
245
|
-
ext == o.ext
|
263
|
+
state_id == o.state_id
|
246
264
|
end
|
247
265
|
|
248
266
|
# @see the `==` method
|
@@ -252,9 +270,16 @@ module Clever
|
|
252
270
|
end
|
253
271
|
|
254
272
|
# Calculates hash code according to all attributes.
|
255
|
-
# @return [
|
273
|
+
# @return [Integer] Hash code
|
256
274
|
def hash
|
257
|
-
[
|
275
|
+
[created, district, ext, high_grade, id, last_modified, location, low_grade, mdr_number, name, nces_id, phone, principal, school_number, sis_id, state_id].hash
|
276
|
+
end
|
277
|
+
|
278
|
+
# Builds the object from hash
|
279
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
280
|
+
# @return [Object] Returns the model itself
|
281
|
+
def self.build_from_hash(attributes)
|
282
|
+
new.build_from_hash(attributes)
|
258
283
|
end
|
259
284
|
|
260
285
|
# Builds the object from hash
|
@@ -262,7 +287,7 @@ module Clever
|
|
262
287
|
# @return [Object] Returns the model itself
|
263
288
|
def build_from_hash(attributes)
|
264
289
|
return nil unless attributes.is_a?(Hash)
|
265
|
-
self.class.
|
290
|
+
self.class.openapi_types.each_pair do |key, type|
|
266
291
|
if type =~ /\AArray<(.*)>/i
|
267
292
|
# check to ensure the input is an array given that the attribute
|
268
293
|
# is documented as an array but the input is not
|
@@ -271,7 +296,9 @@ module Clever
|
|
271
296
|
end
|
272
297
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
273
298
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
274
|
-
|
299
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
300
|
+
self.send("#{key}=", nil)
|
301
|
+
end
|
275
302
|
end
|
276
303
|
|
277
304
|
self
|
@@ -293,7 +320,7 @@ module Clever
|
|
293
320
|
value.to_i
|
294
321
|
when :Float
|
295
322
|
value.to_f
|
296
|
-
when :
|
323
|
+
when :Boolean
|
297
324
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
298
325
|
true
|
299
326
|
else
|
@@ -314,8 +341,7 @@ module Clever
|
|
314
341
|
end
|
315
342
|
end
|
316
343
|
else # model
|
317
|
-
|
318
|
-
temp_model.build_from_hash(value)
|
344
|
+
Clever.const_get(type).build_from_hash(value)
|
319
345
|
end
|
320
346
|
end
|
321
347
|
|
@@ -337,7 +363,11 @@ module Clever
|
|
337
363
|
hash = {}
|
338
364
|
self.class.attribute_map.each_pair do |attr, param|
|
339
365
|
value = self.send(attr)
|
340
|
-
|
366
|
+
if value.nil?
|
367
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
368
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
369
|
+
end
|
370
|
+
|
341
371
|
hash[param] = _to_hash(value)
|
342
372
|
end
|
343
373
|
hash
|
@@ -359,7 +389,5 @@ module Clever
|
|
359
389
|
else
|
360
390
|
value
|
361
391
|
end
|
362
|
-
end
|
363
|
-
|
364
|
-
end
|
392
|
+
end end
|
365
393
|
end
|