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,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'
|
|
@@ -27,28 +26,41 @@ module Clever
|
|
|
27
26
|
end
|
|
28
27
|
|
|
29
28
|
# Attribute type mapping.
|
|
30
|
-
def self.
|
|
29
|
+
def self.openapi_types
|
|
31
30
|
{
|
|
32
|
-
:'data' => :'
|
|
33
|
-
:'links' => :'
|
|
31
|
+
:'data' => :'Object',
|
|
32
|
+
:'links' => :'Object'
|
|
34
33
|
}
|
|
35
34
|
end
|
|
36
35
|
|
|
36
|
+
# List of attributes with nullable: true
|
|
37
|
+
def self.openapi_nullable
|
|
38
|
+
Set.new([
|
|
39
|
+
])
|
|
40
|
+
end
|
|
41
|
+
|
|
37
42
|
# Initializes the object
|
|
38
43
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
39
44
|
def initialize(attributes = {})
|
|
40
|
-
|
|
45
|
+
if (!attributes.is_a?(Hash))
|
|
46
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::CoursesResponse` initialize method"
|
|
47
|
+
end
|
|
41
48
|
|
|
42
|
-
# convert string to symbol for hash key
|
|
43
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
49
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
50
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
51
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
52
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::CoursesResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
53
|
+
end
|
|
54
|
+
h[k.to_sym] = v
|
|
55
|
+
}
|
|
44
56
|
|
|
45
|
-
if attributes.
|
|
57
|
+
if attributes.key?(:'data')
|
|
46
58
|
if (value = attributes[:'data']).is_a?(Array)
|
|
47
59
|
self.data = value
|
|
48
60
|
end
|
|
49
61
|
end
|
|
50
62
|
|
|
51
|
-
if attributes.
|
|
63
|
+
if attributes.key?(:'links')
|
|
52
64
|
if (value = attributes[:'links']).is_a?(Array)
|
|
53
65
|
self.links = value
|
|
54
66
|
end
|
|
@@ -84,17 +96,24 @@ module Clever
|
|
|
84
96
|
end
|
|
85
97
|
|
|
86
98
|
# Calculates hash code according to all attributes.
|
|
87
|
-
# @return [
|
|
99
|
+
# @return [Integer] Hash code
|
|
88
100
|
def hash
|
|
89
101
|
[data, links].hash
|
|
90
102
|
end
|
|
91
103
|
|
|
104
|
+
# Builds the object from hash
|
|
105
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
106
|
+
# @return [Object] Returns the model itself
|
|
107
|
+
def self.build_from_hash(attributes)
|
|
108
|
+
new.build_from_hash(attributes)
|
|
109
|
+
end
|
|
110
|
+
|
|
92
111
|
# Builds the object from hash
|
|
93
112
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
94
113
|
# @return [Object] Returns the model itself
|
|
95
114
|
def build_from_hash(attributes)
|
|
96
115
|
return nil unless attributes.is_a?(Hash)
|
|
97
|
-
self.class.
|
|
116
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
98
117
|
if type =~ /\AArray<(.*)>/i
|
|
99
118
|
# check to ensure the input is an array given that the attribute
|
|
100
119
|
# is documented as an array but the input is not
|
|
@@ -103,7 +122,9 @@ module Clever
|
|
|
103
122
|
end
|
|
104
123
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
105
124
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
106
|
-
|
|
125
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
126
|
+
self.send("#{key}=", nil)
|
|
127
|
+
end
|
|
107
128
|
end
|
|
108
129
|
|
|
109
130
|
self
|
|
@@ -125,7 +146,7 @@ module Clever
|
|
|
125
146
|
value.to_i
|
|
126
147
|
when :Float
|
|
127
148
|
value.to_f
|
|
128
|
-
when :
|
|
149
|
+
when :Boolean
|
|
129
150
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
130
151
|
true
|
|
131
152
|
else
|
|
@@ -146,8 +167,7 @@ module Clever
|
|
|
146
167
|
end
|
|
147
168
|
end
|
|
148
169
|
else # model
|
|
149
|
-
|
|
150
|
-
temp_model.build_from_hash(value)
|
|
170
|
+
Clever.const_get(type).build_from_hash(value)
|
|
151
171
|
end
|
|
152
172
|
end
|
|
153
173
|
|
|
@@ -169,7 +189,11 @@ module Clever
|
|
|
169
189
|
hash = {}
|
|
170
190
|
self.class.attribute_map.each_pair do |attr, param|
|
|
171
191
|
value = self.send(attr)
|
|
172
|
-
|
|
192
|
+
if value.nil?
|
|
193
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
194
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
195
|
+
end
|
|
196
|
+
|
|
173
197
|
hash[param] = _to_hash(value)
|
|
174
198
|
end
|
|
175
199
|
hash
|
|
@@ -191,7 +215,5 @@ module Clever
|
|
|
191
215
|
else
|
|
192
216
|
value
|
|
193
217
|
end
|
|
194
|
-
end
|
|
195
|
-
|
|
196
|
-
end
|
|
218
|
+
end end
|
|
197
219
|
end
|
|
@@ -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
|
-
:'district_username' => :'
|
|
28
|
+
:'district_username' => :'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::Credentials` 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::Credentials`. 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?(:'district_username')
|
|
42
54
|
self.district_username = attributes[:'district_username']
|
|
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
|
[district_username].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,46 +1,45 @@
|
|
|
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 District
|
|
17
|
-
attr_accessor :
|
|
16
|
+
attr_accessor :district_contact
|
|
18
17
|
|
|
19
|
-
attr_accessor :
|
|
18
|
+
attr_accessor :error
|
|
20
19
|
|
|
21
|
-
attr_accessor :
|
|
20
|
+
attr_accessor :id
|
|
22
21
|
|
|
23
|
-
attr_accessor :
|
|
22
|
+
attr_accessor :last_sync
|
|
24
23
|
|
|
25
|
-
attr_accessor :
|
|
24
|
+
attr_accessor :launch_date
|
|
26
25
|
|
|
27
|
-
attr_accessor :
|
|
26
|
+
attr_accessor :login_methods
|
|
28
27
|
|
|
29
|
-
attr_accessor :
|
|
28
|
+
attr_accessor :mdr_number
|
|
30
29
|
|
|
31
|
-
attr_accessor :
|
|
30
|
+
attr_accessor :name
|
|
32
31
|
|
|
33
|
-
attr_accessor :
|
|
32
|
+
attr_accessor :nces_id
|
|
34
33
|
|
|
35
34
|
attr_accessor :pause_end
|
|
36
35
|
|
|
37
|
-
attr_accessor :
|
|
36
|
+
attr_accessor :pause_start
|
|
38
37
|
|
|
39
38
|
attr_accessor :portal_url
|
|
40
39
|
|
|
41
|
-
attr_accessor :
|
|
40
|
+
attr_accessor :sis_type
|
|
42
41
|
|
|
43
|
-
attr_accessor :
|
|
42
|
+
attr_accessor :state
|
|
44
43
|
|
|
45
44
|
class EnumAttributeValidator
|
|
46
45
|
attr_reader :datatype
|
|
@@ -67,107 +66,126 @@ module Clever
|
|
|
67
66
|
# Attribute mapping from ruby-style variable name to JSON key.
|
|
68
67
|
def self.attribute_map
|
|
69
68
|
{
|
|
69
|
+
:'district_contact' => :'district_contact',
|
|
70
|
+
:'error' => :'error',
|
|
70
71
|
:'id' => :'id',
|
|
71
|
-
:'
|
|
72
|
+
:'last_sync' => :'last_sync',
|
|
73
|
+
:'launch_date' => :'launch_date',
|
|
74
|
+
:'login_methods' => :'login_methods',
|
|
72
75
|
:'mdr_number' => :'mdr_number',
|
|
76
|
+
:'name' => :'name',
|
|
73
77
|
:'nces_id' => :'nces_id',
|
|
74
|
-
:'sis_type' => :'sis_type',
|
|
75
|
-
:'state' => :'state',
|
|
76
|
-
:'last_sync' => :'last_sync',
|
|
77
|
-
:'error' => :'error',
|
|
78
|
-
:'pause_start' => :'pause_start',
|
|
79
78
|
:'pause_end' => :'pause_end',
|
|
80
|
-
:'
|
|
79
|
+
:'pause_start' => :'pause_start',
|
|
81
80
|
:'portal_url' => :'portal_url',
|
|
82
|
-
:'
|
|
83
|
-
:'
|
|
81
|
+
:'sis_type' => :'sis_type',
|
|
82
|
+
:'state' => :'state'
|
|
84
83
|
}
|
|
85
84
|
end
|
|
86
85
|
|
|
87
86
|
# Attribute type mapping.
|
|
88
|
-
def self.
|
|
87
|
+
def self.openapi_types
|
|
89
88
|
{
|
|
90
|
-
:'
|
|
91
|
-
:'
|
|
92
|
-
:'
|
|
93
|
-
:'
|
|
94
|
-
:'
|
|
95
|
-
:'
|
|
96
|
-
:'
|
|
97
|
-
:'
|
|
98
|
-
:'
|
|
99
|
-
:'pause_end' => :'
|
|
100
|
-
:'
|
|
101
|
-
:'portal_url' => :'
|
|
102
|
-
:'
|
|
103
|
-
:'
|
|
89
|
+
:'district_contact' => :'Object',
|
|
90
|
+
:'error' => :'Object',
|
|
91
|
+
:'id' => :'Object',
|
|
92
|
+
:'last_sync' => :'Object',
|
|
93
|
+
:'launch_date' => :'Object',
|
|
94
|
+
:'login_methods' => :'Object',
|
|
95
|
+
:'mdr_number' => :'Object',
|
|
96
|
+
:'name' => :'Object',
|
|
97
|
+
:'nces_id' => :'Object',
|
|
98
|
+
:'pause_end' => :'Object',
|
|
99
|
+
:'pause_start' => :'Object',
|
|
100
|
+
:'portal_url' => :'Object',
|
|
101
|
+
:'sis_type' => :'Object',
|
|
102
|
+
:'state' => :'Object'
|
|
104
103
|
}
|
|
105
104
|
end
|
|
106
105
|
|
|
106
|
+
# List of attributes with nullable: true
|
|
107
|
+
def self.openapi_nullable
|
|
108
|
+
Set.new([
|
|
109
|
+
:'last_sync',
|
|
110
|
+
:'mdr_number',
|
|
111
|
+
:'nces_id',
|
|
112
|
+
:'pause_end',
|
|
113
|
+
:'pause_start',
|
|
114
|
+
:'state'
|
|
115
|
+
])
|
|
116
|
+
end
|
|
117
|
+
|
|
107
118
|
# Initializes the object
|
|
108
119
|
# @param [Hash] attributes Model attributes in the form of hash
|
|
109
120
|
def initialize(attributes = {})
|
|
110
|
-
|
|
121
|
+
if (!attributes.is_a?(Hash))
|
|
122
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::District` initialize method"
|
|
123
|
+
end
|
|
111
124
|
|
|
112
|
-
# convert string to symbol for hash key
|
|
113
|
-
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
125
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
|
126
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
|
127
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
|
128
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::District`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
|
129
|
+
end
|
|
130
|
+
h[k.to_sym] = v
|
|
131
|
+
}
|
|
114
132
|
|
|
115
|
-
if attributes.
|
|
116
|
-
self.
|
|
133
|
+
if attributes.key?(:'district_contact')
|
|
134
|
+
self.district_contact = attributes[:'district_contact']
|
|
117
135
|
end
|
|
118
136
|
|
|
119
|
-
if attributes.
|
|
120
|
-
self.
|
|
137
|
+
if attributes.key?(:'error')
|
|
138
|
+
self.error = attributes[:'error']
|
|
121
139
|
end
|
|
122
140
|
|
|
123
|
-
if attributes.
|
|
124
|
-
self.
|
|
141
|
+
if attributes.key?(:'id')
|
|
142
|
+
self.id = attributes[:'id']
|
|
125
143
|
end
|
|
126
144
|
|
|
127
|
-
if attributes.
|
|
128
|
-
self.
|
|
145
|
+
if attributes.key?(:'last_sync')
|
|
146
|
+
self.last_sync = attributes[:'last_sync']
|
|
129
147
|
end
|
|
130
148
|
|
|
131
|
-
if attributes.
|
|
132
|
-
self.
|
|
149
|
+
if attributes.key?(:'launch_date')
|
|
150
|
+
self.launch_date = attributes[:'launch_date']
|
|
133
151
|
end
|
|
134
152
|
|
|
135
|
-
if attributes.
|
|
136
|
-
|
|
153
|
+
if attributes.key?(:'login_methods')
|
|
154
|
+
if (value = attributes[:'login_methods']).is_a?(Array)
|
|
155
|
+
self.login_methods = value
|
|
156
|
+
end
|
|
137
157
|
end
|
|
138
158
|
|
|
139
|
-
if attributes.
|
|
140
|
-
self.
|
|
159
|
+
if attributes.key?(:'mdr_number')
|
|
160
|
+
self.mdr_number = attributes[:'mdr_number']
|
|
141
161
|
end
|
|
142
162
|
|
|
143
|
-
if attributes.
|
|
144
|
-
self.
|
|
163
|
+
if attributes.key?(:'name')
|
|
164
|
+
self.name = attributes[:'name']
|
|
145
165
|
end
|
|
146
166
|
|
|
147
|
-
if attributes.
|
|
148
|
-
self.
|
|
167
|
+
if attributes.key?(:'nces_id')
|
|
168
|
+
self.nces_id = attributes[:'nces_id']
|
|
149
169
|
end
|
|
150
170
|
|
|
151
|
-
if attributes.
|
|
171
|
+
if attributes.key?(:'pause_end')
|
|
152
172
|
self.pause_end = attributes[:'pause_end']
|
|
153
173
|
end
|
|
154
174
|
|
|
155
|
-
if attributes.
|
|
156
|
-
self.
|
|
175
|
+
if attributes.key?(:'pause_start')
|
|
176
|
+
self.pause_start = attributes[:'pause_start']
|
|
157
177
|
end
|
|
158
178
|
|
|
159
|
-
if attributes.
|
|
179
|
+
if attributes.key?(:'portal_url')
|
|
160
180
|
self.portal_url = attributes[:'portal_url']
|
|
161
181
|
end
|
|
162
182
|
|
|
163
|
-
if attributes.
|
|
164
|
-
|
|
165
|
-
self.login_methods = value
|
|
166
|
-
end
|
|
183
|
+
if attributes.key?(:'sis_type')
|
|
184
|
+
self.sis_type = attributes[:'sis_type']
|
|
167
185
|
end
|
|
168
186
|
|
|
169
|
-
if attributes.
|
|
170
|
-
self.
|
|
187
|
+
if attributes.key?(:'state')
|
|
188
|
+
self.state = attributes[:'state']
|
|
171
189
|
end
|
|
172
190
|
end
|
|
173
191
|
|
|
@@ -181,7 +199,7 @@ module Clever
|
|
|
181
199
|
# Check to see if the all the properties in the model are valid
|
|
182
200
|
# @return true if the model is valid
|
|
183
201
|
def valid?
|
|
184
|
-
state_validator = EnumAttributeValidator.new('
|
|
202
|
+
state_validator = EnumAttributeValidator.new('Object', ['running', 'pending', 'error', 'paused', '', 'success'])
|
|
185
203
|
return false unless state_validator.valid?(@state)
|
|
186
204
|
true
|
|
187
205
|
end
|
|
@@ -189,9 +207,9 @@ module Clever
|
|
|
189
207
|
# Custom attribute writer method checking allowed values (enum).
|
|
190
208
|
# @param [Object] state Object to be assigned
|
|
191
209
|
def state=(state)
|
|
192
|
-
validator = EnumAttributeValidator.new('
|
|
210
|
+
validator = EnumAttributeValidator.new('Object', ['running', 'pending', 'error', 'paused', '', 'success'])
|
|
193
211
|
unless validator.valid?(state)
|
|
194
|
-
fail ArgumentError,
|
|
212
|
+
fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}."
|
|
195
213
|
end
|
|
196
214
|
@state = state
|
|
197
215
|
end
|
|
@@ -201,20 +219,20 @@ module Clever
|
|
|
201
219
|
def ==(o)
|
|
202
220
|
return true if self.equal?(o)
|
|
203
221
|
self.class == o.class &&
|
|
222
|
+
district_contact == o.district_contact &&
|
|
223
|
+
error == o.error &&
|
|
204
224
|
id == o.id &&
|
|
205
|
-
|
|
225
|
+
last_sync == o.last_sync &&
|
|
226
|
+
launch_date == o.launch_date &&
|
|
227
|
+
login_methods == o.login_methods &&
|
|
206
228
|
mdr_number == o.mdr_number &&
|
|
229
|
+
name == o.name &&
|
|
207
230
|
nces_id == o.nces_id &&
|
|
208
|
-
sis_type == o.sis_type &&
|
|
209
|
-
state == o.state &&
|
|
210
|
-
last_sync == o.last_sync &&
|
|
211
|
-
error == o.error &&
|
|
212
|
-
pause_start == o.pause_start &&
|
|
213
231
|
pause_end == o.pause_end &&
|
|
214
|
-
|
|
232
|
+
pause_start == o.pause_start &&
|
|
215
233
|
portal_url == o.portal_url &&
|
|
216
|
-
|
|
217
|
-
|
|
234
|
+
sis_type == o.sis_type &&
|
|
235
|
+
state == o.state
|
|
218
236
|
end
|
|
219
237
|
|
|
220
238
|
# @see the `==` method
|
|
@@ -224,9 +242,16 @@ module Clever
|
|
|
224
242
|
end
|
|
225
243
|
|
|
226
244
|
# Calculates hash code according to all attributes.
|
|
227
|
-
# @return [
|
|
245
|
+
# @return [Integer] Hash code
|
|
228
246
|
def hash
|
|
229
|
-
[
|
|
247
|
+
[district_contact, error, id, last_sync, launch_date, login_methods, mdr_number, name, nces_id, pause_end, pause_start, portal_url, sis_type, state].hash
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
# Builds the object from hash
|
|
251
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
|
252
|
+
# @return [Object] Returns the model itself
|
|
253
|
+
def self.build_from_hash(attributes)
|
|
254
|
+
new.build_from_hash(attributes)
|
|
230
255
|
end
|
|
231
256
|
|
|
232
257
|
# Builds the object from hash
|
|
@@ -234,7 +259,7 @@ module Clever
|
|
|
234
259
|
# @return [Object] Returns the model itself
|
|
235
260
|
def build_from_hash(attributes)
|
|
236
261
|
return nil unless attributes.is_a?(Hash)
|
|
237
|
-
self.class.
|
|
262
|
+
self.class.openapi_types.each_pair do |key, type|
|
|
238
263
|
if type =~ /\AArray<(.*)>/i
|
|
239
264
|
# check to ensure the input is an array given that the attribute
|
|
240
265
|
# is documented as an array but the input is not
|
|
@@ -243,7 +268,9 @@ module Clever
|
|
|
243
268
|
end
|
|
244
269
|
elsif !attributes[self.class.attribute_map[key]].nil?
|
|
245
270
|
self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
|
|
246
|
-
|
|
271
|
+
elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key)
|
|
272
|
+
self.send("#{key}=", nil)
|
|
273
|
+
end
|
|
247
274
|
end
|
|
248
275
|
|
|
249
276
|
self
|
|
@@ -265,7 +292,7 @@ module Clever
|
|
|
265
292
|
value.to_i
|
|
266
293
|
when :Float
|
|
267
294
|
value.to_f
|
|
268
|
-
when :
|
|
295
|
+
when :Boolean
|
|
269
296
|
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
|
270
297
|
true
|
|
271
298
|
else
|
|
@@ -286,8 +313,7 @@ module Clever
|
|
|
286
313
|
end
|
|
287
314
|
end
|
|
288
315
|
else # model
|
|
289
|
-
|
|
290
|
-
temp_model.build_from_hash(value)
|
|
316
|
+
Clever.const_get(type).build_from_hash(value)
|
|
291
317
|
end
|
|
292
318
|
end
|
|
293
319
|
|
|
@@ -309,7 +335,11 @@ module Clever
|
|
|
309
335
|
hash = {}
|
|
310
336
|
self.class.attribute_map.each_pair do |attr, param|
|
|
311
337
|
value = self.send(attr)
|
|
312
|
-
|
|
338
|
+
if value.nil?
|
|
339
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
|
340
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
|
341
|
+
end
|
|
342
|
+
|
|
313
343
|
hash[param] = _to_hash(value)
|
|
314
344
|
end
|
|
315
345
|
hash
|
|
@@ -331,7 +361,5 @@ module Clever
|
|
|
331
361
|
else
|
|
332
362
|
value
|
|
333
363
|
end
|
|
334
|
-
end
|
|
335
|
-
|
|
336
|
-
end
|
|
364
|
+
end end
|
|
337
365
|
end
|