clever-ruby 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/README.md +78 -46
  4. data/clever-ruby-1.0.0.gem +0 -0
  5. data/docs/Credentials.md +8 -0
  6. data/docs/DataApi.md +130 -127
  7. data/docs/District.md +1 -1
  8. data/docs/DistrictAdmin.md +2 -2
  9. data/docs/DistrictStatus.md +5 -5
  10. data/docs/DistrictsCreated.md +2 -1
  11. data/docs/DistrictsDeleted.md +2 -1
  12. data/docs/DistrictsUpdated.md +2 -1
  13. data/docs/Event.md +2 -1
  14. data/docs/EventsApi.md +14 -21
  15. data/docs/Location.md +2 -2
  16. data/docs/Name.md +1 -1
  17. data/docs/Principal.md +1 -1
  18. data/docs/School.md +2 -2
  19. data/docs/SchoolAdmin.md +2 -1
  20. data/docs/SchooladminsCreated.md +2 -1
  21. data/docs/SchooladminsDeleted.md +2 -1
  22. data/docs/SchooladminsUpdated.md +2 -1
  23. data/docs/SchoolsCreated.md +2 -1
  24. data/docs/SchoolsDeleted.md +2 -1
  25. data/docs/SchoolsUpdated.md +2 -1
  26. data/docs/Section.md +1 -1
  27. data/docs/SectionsCreated.md +2 -1
  28. data/docs/SectionsDeleted.md +2 -1
  29. data/docs/SectionsUpdated.md +2 -1
  30. data/docs/Student.md +2 -2
  31. data/docs/StudentContact.md +1 -1
  32. data/docs/StudentcontactsCreated.md +2 -1
  33. data/docs/StudentcontactsDeleted.md +2 -1
  34. data/docs/StudentcontactsUpdated.md +2 -1
  35. data/docs/StudentsCreated.md +2 -1
  36. data/docs/StudentsDeleted.md +2 -1
  37. data/docs/StudentsUpdated.md +2 -1
  38. data/docs/Teacher.md +2 -1
  39. data/docs/TeachersCreated.md +2 -1
  40. data/docs/TeachersDeleted.md +2 -1
  41. data/docs/TeachersUpdated.md +2 -1
  42. data/docs/Term.md +1 -1
  43. data/lib/clever-ruby.rb +1 -0
  44. data/lib/clever-ruby/api/data_api.rb +127 -85
  45. data/lib/clever-ruby/api/events_api.rb +14 -14
  46. data/lib/clever-ruby/models/credentials.rb +187 -0
  47. data/lib/clever-ruby/models/district.rb +13 -13
  48. data/lib/clever-ruby/models/district_admin.rb +22 -22
  49. data/lib/clever-ruby/models/district_status.rb +70 -37
  50. data/lib/clever-ruby/models/event.rb +19 -10
  51. data/lib/clever-ruby/models/location.rb +22 -22
  52. data/lib/clever-ruby/models/name.rb +13 -13
  53. data/lib/clever-ruby/models/principal.rb +13 -13
  54. data/lib/clever-ruby/models/school.rb +66 -21
  55. data/lib/clever-ruby/models/school_admin.rb +16 -7
  56. data/lib/clever-ruby/models/section.rb +55 -10
  57. data/lib/clever-ruby/models/student.rb +100 -19
  58. data/lib/clever-ruby/models/student_contact.rb +10 -10
  59. data/lib/clever-ruby/models/teacher.rb +19 -10
  60. data/lib/clever-ruby/models/term.rb +13 -13
  61. data/lib/clever-ruby/version.rb +1 -1
  62. data/override/README-extension.md +31 -0
  63. data/override/config.json +1 -1
  64. data/override/override.sh +5 -0
  65. data/sample/sample.rb +1 -1
  66. metadata +6 -3
  67. data/instructions.md +0 -12
@@ -19,7 +19,7 @@ module Clever
19
19
  @api_client = api_client
20
20
  end
21
21
 
22
- # Retrieves a single event.
22
+ #
23
23
  # Returns the specific event
24
24
  # @param id
25
25
  # @param [Hash] opts the optional parameters
@@ -29,7 +29,7 @@ module Clever
29
29
  return data
30
30
  end
31
31
 
32
- # Retrieves a single event.
32
+ #
33
33
  # Returns the specific event
34
34
  # @param id
35
35
  # @param [Hash] opts the optional parameters
@@ -70,7 +70,7 @@ module Clever
70
70
  return data, status_code, headers
71
71
  end
72
72
 
73
- # Retrieves all events
73
+ #
74
74
  # Returns a list of events
75
75
  # @param [Hash] opts the optional parameters
76
76
  # @option opts [Integer] :limit
@@ -82,7 +82,7 @@ module Clever
82
82
  return data
83
83
  end
84
84
 
85
- # Retrieves all events
85
+ #
86
86
  # Returns a list of events
87
87
  # @param [Hash] opts the optional parameters
88
88
  # @option opts [Integer] :limit
@@ -126,7 +126,7 @@ module Clever
126
126
  return data, status_code, headers
127
127
  end
128
128
 
129
- # Retrieves events for schools.
129
+ #
130
130
  # Returns a list of events for a school
131
131
  # @param id
132
132
  # @param [Hash] opts the optional parameters
@@ -139,7 +139,7 @@ module Clever
139
139
  return data
140
140
  end
141
141
 
142
- # Retrieves events for schools.
142
+ #
143
143
  # Returns a list of events for a school
144
144
  # @param id
145
145
  # @param [Hash] opts the optional parameters
@@ -186,7 +186,7 @@ module Clever
186
186
  return data, status_code, headers
187
187
  end
188
188
 
189
- # Retrieves events for school_admins.
189
+ #
190
190
  # Returns a list of events for a school admin
191
191
  # @param id
192
192
  # @param [Hash] opts the optional parameters
@@ -199,7 +199,7 @@ module Clever
199
199
  return data
200
200
  end
201
201
 
202
- # Retrieves events for school_admins.
202
+ #
203
203
  # Returns a list of events for a school admin
204
204
  # @param id
205
205
  # @param [Hash] opts the optional parameters
@@ -246,7 +246,7 @@ module Clever
246
246
  return data, status_code, headers
247
247
  end
248
248
 
249
- # Retrieves events for sections.
249
+ #
250
250
  # Returns a list of events for a section
251
251
  # @param id
252
252
  # @param [Hash] opts the optional parameters
@@ -259,7 +259,7 @@ module Clever
259
259
  return data
260
260
  end
261
261
 
262
- # Retrieves events for sections.
262
+ #
263
263
  # Returns a list of events for a section
264
264
  # @param id
265
265
  # @param [Hash] opts the optional parameters
@@ -306,7 +306,7 @@ module Clever
306
306
  return data, status_code, headers
307
307
  end
308
308
 
309
- # Retrieves events for students.
309
+ #
310
310
  # Returns a list of events for a student
311
311
  # @param id
312
312
  # @param [Hash] opts the optional parameters
@@ -319,7 +319,7 @@ module Clever
319
319
  return data
320
320
  end
321
321
 
322
- # Retrieves events for students.
322
+ #
323
323
  # Returns a list of events for a student
324
324
  # @param id
325
325
  # @param [Hash] opts the optional parameters
@@ -366,7 +366,7 @@ module Clever
366
366
  return data, status_code, headers
367
367
  end
368
368
 
369
- # Retrieves events for teachers.
369
+ #
370
370
  # Returns a list of events for a teacher
371
371
  # @param id
372
372
  # @param [Hash] opts the optional parameters
@@ -379,7 +379,7 @@ module Clever
379
379
  return data
380
380
  end
381
381
 
382
- # Retrieves events for teachers.
382
+ #
383
383
  # Returns a list of events for a teacher
384
384
  # @param id
385
385
  # @param [Hash] opts the optional parameters
@@ -0,0 +1,187 @@
1
+ =begin
2
+ #Clever API
3
+
4
+ #The Clever API
5
+
6
+ OpenAPI spec version: 1.2.0
7
+
8
+ Generated by: https://github.com/swagger-api/swagger-codegen.git
9
+
10
+ =end
11
+
12
+ require 'date'
13
+
14
+ module Clever
15
+
16
+ class Credentials
17
+ attr_accessor :district_username
18
+
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'district_username' => :'district_username'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'district_username' => :'String'
31
+ }
32
+ end
33
+
34
+ # Initializes the object
35
+ # @param [Hash] attributes Model attributes in the form of hash
36
+ def initialize(attributes = {})
37
+ return unless attributes.is_a?(Hash)
38
+
39
+ # convert string to symbol for hash key
40
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
41
+
42
+ if attributes.has_key?(:'district_username')
43
+ self.district_username = attributes[:'district_username']
44
+ end
45
+
46
+ end
47
+
48
+ # Show invalid properties with the reasons. Usually used together with valid?
49
+ # @return Array for valid properies with the reasons
50
+ def list_invalid_properties
51
+ invalid_properties = Array.new
52
+ return invalid_properties
53
+ end
54
+
55
+ # Check to see if the all the properties in the model are valid
56
+ # @return true if the model is valid
57
+ def valid?
58
+ return true
59
+ end
60
+
61
+ # Checks equality by comparing each attribute.
62
+ # @param [Object] Object to be compared
63
+ def ==(o)
64
+ return true if self.equal?(o)
65
+ self.class == o.class &&
66
+ district_username == o.district_username
67
+ end
68
+
69
+ # @see the `==` method
70
+ # @param [Object] Object to be compared
71
+ def eql?(o)
72
+ self == o
73
+ end
74
+
75
+ # Calculates hash code according to all attributes.
76
+ # @return [Fixnum] Hash code
77
+ def hash
78
+ [district_username].hash
79
+ end
80
+
81
+ # Builds the object from hash
82
+ # @param [Hash] attributes Model attributes in the form of hash
83
+ # @return [Object] Returns the model itself
84
+ def build_from_hash(attributes)
85
+ return nil unless attributes.is_a?(Hash)
86
+ self.class.swagger_types.each_pair do |key, type|
87
+ if type =~ /\AArray<(.*)>/i
88
+ # check to ensure the input is an array given that the the attribute
89
+ # is documented as an array but the input is not
90
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
91
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
92
+ end
93
+ elsif !attributes[self.class.attribute_map[key]].nil?
94
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
95
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
96
+ end
97
+
98
+ self
99
+ end
100
+
101
+ # Deserializes the data based on type
102
+ # @param string type Data type
103
+ # @param string value Value to be deserialized
104
+ # @return [Object] Deserialized data
105
+ def _deserialize(type, value)
106
+ case type.to_sym
107
+ when :DateTime
108
+ DateTime.parse(value)
109
+ when :Date
110
+ Date.parse(value)
111
+ when :String
112
+ value.to_s
113
+ when :Integer
114
+ value.to_i
115
+ when :Float
116
+ value.to_f
117
+ when :BOOLEAN
118
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
119
+ true
120
+ else
121
+ false
122
+ end
123
+ when :Object
124
+ # generic object (usually a Hash), return directly
125
+ value
126
+ when /\AArray<(?<inner_type>.+)>\z/
127
+ inner_type = Regexp.last_match[:inner_type]
128
+ value.map { |v| _deserialize(inner_type, v) }
129
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
130
+ k_type = Regexp.last_match[:k_type]
131
+ v_type = Regexp.last_match[:v_type]
132
+ {}.tap do |hash|
133
+ value.each do |k, v|
134
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
135
+ end
136
+ end
137
+ else # model
138
+ temp_model = Clever.const_get(type).new
139
+ temp_model.build_from_hash(value)
140
+ end
141
+ end
142
+
143
+ # Returns the string representation of the object
144
+ # @return [String] String presentation of the object
145
+ def to_s
146
+ to_hash.to_s
147
+ end
148
+
149
+ # to_body is an alias to to_hash (backward compatibility)
150
+ # @return [Hash] Returns the object in the form of hash
151
+ def to_body
152
+ to_hash
153
+ end
154
+
155
+ # Returns the object in the form of hash
156
+ # @return [Hash] Returns the object in the form of hash
157
+ def to_hash
158
+ hash = {}
159
+ self.class.attribute_map.each_pair do |attr, param|
160
+ value = self.send(attr)
161
+ next if value.nil?
162
+ hash[param] = _to_hash(value)
163
+ end
164
+ hash
165
+ end
166
+
167
+ # Outputs non-array value in the form of hash
168
+ # For object, use to_hash. Otherwise, just return the value
169
+ # @param [Object] value Any valid value
170
+ # @return [Hash] Returns the value in the form of hash
171
+ def _to_hash(value)
172
+ if value.is_a?(Array)
173
+ value.compact.map{ |v| _to_hash(v) }
174
+ elsif value.is_a?(Hash)
175
+ {}.tap do |hash|
176
+ value.each { |k, v| hash[k] = _to_hash(v) }
177
+ end
178
+ elsif value.respond_to? :to_hash
179
+ value.to_hash
180
+ else
181
+ value
182
+ end
183
+ end
184
+
185
+ end
186
+
187
+ end
@@ -16,17 +16,17 @@ module Clever
16
16
  class District
17
17
  attr_accessor :id
18
18
 
19
- attr_accessor :name
20
-
21
19
  attr_accessor :mdr_number
22
20
 
21
+ attr_accessor :name
22
+
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
25
25
  def self.attribute_map
26
26
  {
27
27
  :'id' => :'id',
28
- :'name' => :'name',
29
- :'mdr_number' => :'mdr_number'
28
+ :'mdr_number' => :'mdr_number',
29
+ :'name' => :'name'
30
30
  }
31
31
  end
32
32
 
@@ -34,8 +34,8 @@ module Clever
34
34
  def self.swagger_types
35
35
  {
36
36
  :'id' => :'String',
37
- :'name' => :'String',
38
- :'mdr_number' => :'String'
37
+ :'mdr_number' => :'String',
38
+ :'name' => :'String'
39
39
  }
40
40
  end
41
41
 
@@ -51,14 +51,14 @@ module Clever
51
51
  self.id = attributes[:'id']
52
52
  end
53
53
 
54
- if attributes.has_key?(:'name')
55
- self.name = attributes[:'name']
56
- end
57
-
58
54
  if attributes.has_key?(:'mdr_number')
59
55
  self.mdr_number = attributes[:'mdr_number']
60
56
  end
61
57
 
58
+ if attributes.has_key?(:'name')
59
+ self.name = attributes[:'name']
60
+ end
61
+
62
62
  end
63
63
 
64
64
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -80,8 +80,8 @@ module Clever
80
80
  return true if self.equal?(o)
81
81
  self.class == o.class &&
82
82
  id == o.id &&
83
- name == o.name &&
84
- mdr_number == o.mdr_number
83
+ mdr_number == o.mdr_number &&
84
+ name == o.name
85
85
  end
86
86
 
87
87
  # @see the `==` method
@@ -93,7 +93,7 @@ module Clever
93
93
  # Calculates hash code according to all attributes.
94
94
  # @return [Fixnum] Hash code
95
95
  def hash
96
- [id, name, mdr_number].hash
96
+ [id, mdr_number, name].hash
97
97
  end
98
98
 
99
99
  # Builds the object from hash
@@ -14,36 +14,36 @@ require 'date'
14
14
  module Clever
15
15
 
16
16
  class DistrictAdmin
17
+ attr_accessor :district
18
+
19
+ attr_accessor :email
20
+
17
21
  attr_accessor :id
18
22
 
19
23
  attr_accessor :name
20
24
 
21
- attr_accessor :email
22
-
23
25
  attr_accessor :title
24
26
 
25
- attr_accessor :district
26
-
27
27
 
28
28
  # Attribute mapping from ruby-style variable name to JSON key.
29
29
  def self.attribute_map
30
30
  {
31
+ :'district' => :'district',
32
+ :'email' => :'email',
31
33
  :'id' => :'id',
32
34
  :'name' => :'name',
33
- :'email' => :'email',
34
- :'title' => :'title',
35
- :'district' => :'district'
35
+ :'title' => :'title'
36
36
  }
37
37
  end
38
38
 
39
39
  # Attribute type mapping.
40
40
  def self.swagger_types
41
41
  {
42
+ :'district' => :'String',
43
+ :'email' => :'String',
42
44
  :'id' => :'String',
43
45
  :'name' => :'Name',
44
- :'email' => :'String',
45
- :'title' => :'String',
46
- :'district' => :'String'
46
+ :'title' => :'String'
47
47
  }
48
48
  end
49
49
 
@@ -55,6 +55,14 @@ module Clever
55
55
  # convert string to symbol for hash key
56
56
  attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
57
57
 
58
+ if attributes.has_key?(:'district')
59
+ self.district = attributes[:'district']
60
+ end
61
+
62
+ if attributes.has_key?(:'email')
63
+ self.email = attributes[:'email']
64
+ end
65
+
58
66
  if attributes.has_key?(:'id')
59
67
  self.id = attributes[:'id']
60
68
  end
@@ -63,18 +71,10 @@ module Clever
63
71
  self.name = attributes[:'name']
64
72
  end
65
73
 
66
- if attributes.has_key?(:'email')
67
- self.email = attributes[:'email']
68
- end
69
-
70
74
  if attributes.has_key?(:'title')
71
75
  self.title = attributes[:'title']
72
76
  end
73
77
 
74
- if attributes.has_key?(:'district')
75
- self.district = attributes[:'district']
76
- end
77
-
78
78
  end
79
79
 
80
80
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -95,11 +95,11 @@ module Clever
95
95
  def ==(o)
96
96
  return true if self.equal?(o)
97
97
  self.class == o.class &&
98
+ district == o.district &&
99
+ email == o.email &&
98
100
  id == o.id &&
99
101
  name == o.name &&
100
- email == o.email &&
101
- title == o.title &&
102
- district == o.district
102
+ title == o.title
103
103
  end
104
104
 
105
105
  # @see the `==` method
@@ -111,7 +111,7 @@ module Clever
111
111
  # Calculates hash code according to all attributes.
112
112
  # @return [Fixnum] Hash code
113
113
  def hash
114
- [id, name, email, title, district].hash
114
+ [district, email, id, name, title].hash
115
115
  end
116
116
 
117
117
  # Builds the object from hash