clever-ruby 0.14.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (297) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/Gemfile +4 -1
  4. data/Makefile +10 -0
  5. data/README.md +175 -68
  6. data/Rakefile +6 -36
  7. data/circle.yml +1 -1
  8. data/clever-ruby.gemspec +43 -33
  9. data/docs/BadRequest.md +8 -0
  10. data/docs/DataApi.md +2144 -0
  11. data/docs/District.md +10 -0
  12. data/docs/DistrictAdmin.md +12 -0
  13. data/docs/DistrictAdminResponse.md +8 -0
  14. data/docs/DistrictAdminsResponse.md +8 -0
  15. data/docs/DistrictObject.md +8 -0
  16. data/docs/DistrictResponse.md +8 -0
  17. data/docs/DistrictStatus.md +15 -0
  18. data/docs/DistrictStatusResponse.md +8 -0
  19. data/docs/DistrictsCreated.md +10 -0
  20. data/docs/DistrictsDeleted.md +10 -0
  21. data/docs/DistrictsResponse.md +8 -0
  22. data/docs/DistrictsUpdated.md +10 -0
  23. data/docs/Event.md +9 -0
  24. data/docs/EventResponse.md +8 -0
  25. data/docs/EventsApi.md +424 -0
  26. data/docs/EventsResponse.md +8 -0
  27. data/docs/GradeLevelsResponse.md +8 -0
  28. data/docs/InternalError.md +8 -0
  29. data/docs/Location.md +13 -0
  30. data/docs/Name.md +10 -0
  31. data/docs/NotFound.md +8 -0
  32. data/docs/Principal.md +9 -0
  33. data/docs/School.md +22 -0
  34. data/docs/SchoolAdmin.md +14 -0
  35. data/docs/SchoolAdminObject.md +8 -0
  36. data/docs/SchoolAdminResponse.md +8 -0
  37. data/docs/SchoolAdminsResponse.md +8 -0
  38. data/docs/SchoolObject.md +8 -0
  39. data/docs/SchoolResponse.md +8 -0
  40. data/docs/SchooladminsCreated.md +10 -0
  41. data/docs/SchooladminsDeleted.md +10 -0
  42. data/docs/SchooladminsUpdated.md +10 -0
  43. data/docs/SchoolsCreated.md +10 -0
  44. data/docs/SchoolsDeleted.md +10 -0
  45. data/docs/SchoolsResponse.md +8 -0
  46. data/docs/SchoolsUpdated.md +10 -0
  47. data/docs/Section.md +25 -0
  48. data/docs/SectionObject.md +8 -0
  49. data/docs/SectionResponse.md +8 -0
  50. data/docs/SectionsCreated.md +10 -0
  51. data/docs/SectionsDeleted.md +10 -0
  52. data/docs/SectionsResponse.md +8 -0
  53. data/docs/SectionsUpdated.md +10 -0
  54. data/docs/Student.md +27 -0
  55. data/docs/StudentContact.md +16 -0
  56. data/docs/StudentContactObject.md +8 -0
  57. data/docs/StudentContactResponse.md +8 -0
  58. data/docs/StudentContactsResponse.md +8 -0
  59. data/docs/StudentObject.md +8 -0
  60. data/docs/StudentResponse.md +8 -0
  61. data/docs/StudentcontactsCreated.md +10 -0
  62. data/docs/StudentcontactsDeleted.md +10 -0
  63. data/docs/StudentcontactsUpdated.md +10 -0
  64. data/docs/StudentsCreated.md +10 -0
  65. data/docs/StudentsDeleted.md +10 -0
  66. data/docs/StudentsResponse.md +8 -0
  67. data/docs/StudentsUpdated.md +10 -0
  68. data/docs/Teacher.md +19 -0
  69. data/docs/TeacherObject.md +8 -0
  70. data/docs/TeacherResponse.md +8 -0
  71. data/docs/TeachersCreated.md +10 -0
  72. data/docs/TeachersDeleted.md +10 -0
  73. data/docs/TeachersResponse.md +8 -0
  74. data/docs/TeachersUpdated.md +10 -0
  75. data/docs/Term.md +10 -0
  76. data/git_push.sh +55 -0
  77. data/instructions.md +12 -0
  78. data/lib/clever-ruby.rb +89 -318
  79. data/lib/clever-ruby/api/data_api.rb +2090 -0
  80. data/lib/clever-ruby/api/events_api.rb +429 -0
  81. data/lib/clever-ruby/api_client.rb +401 -0
  82. data/lib/clever-ruby/api_error.rb +37 -0
  83. data/lib/clever-ruby/configuration.rb +187 -25
  84. data/lib/clever-ruby/models/bad_request.rb +187 -0
  85. data/lib/clever-ruby/models/district.rb +205 -0
  86. data/lib/clever-ruby/models/district_admin.rb +223 -0
  87. data/lib/clever-ruby/models/district_admin_response.rb +187 -0
  88. data/lib/clever-ruby/models/district_admins_response.rb +189 -0
  89. data/lib/clever-ruby/models/district_object.rb +187 -0
  90. data/lib/clever-ruby/models/district_response.rb +187 -0
  91. data/lib/clever-ruby/models/district_status.rb +250 -0
  92. data/lib/clever-ruby/models/district_status_response.rb +187 -0
  93. data/lib/clever-ruby/models/districts_created.rb +206 -0
  94. data/lib/clever-ruby/models/districts_deleted.rb +207 -0
  95. data/lib/clever-ruby/models/districts_response.rb +189 -0
  96. data/lib/clever-ruby/models/districts_updated.rb +207 -0
  97. data/lib/clever-ruby/models/event.rb +201 -0
  98. data/lib/clever-ruby/models/event_response.rb +187 -0
  99. data/lib/clever-ruby/models/events_response.rb +189 -0
  100. data/lib/clever-ruby/models/grade_levels_response.rb +189 -0
  101. data/lib/clever-ruby/models/internal_error.rb +187 -0
  102. data/lib/clever-ruby/models/location.rb +232 -0
  103. data/lib/clever-ruby/models/name.rb +205 -0
  104. data/lib/clever-ruby/models/not_found.rb +187 -0
  105. data/lib/clever-ruby/models/principal.rb +196 -0
  106. data/lib/clever-ruby/models/school.rb +313 -0
  107. data/lib/clever-ruby/models/school_admin.rb +243 -0
  108. data/lib/clever-ruby/models/school_admin_object.rb +187 -0
  109. data/lib/clever-ruby/models/school_admin_response.rb +187 -0
  110. data/lib/clever-ruby/models/school_admins_response.rb +189 -0
  111. data/lib/clever-ruby/models/school_object.rb +187 -0
  112. data/lib/clever-ruby/models/school_response.rb +187 -0
  113. data/lib/clever-ruby/models/schooladmins_created.rb +207 -0
  114. data/lib/clever-ruby/models/schooladmins_deleted.rb +207 -0
  115. data/lib/clever-ruby/models/schooladmins_updated.rb +207 -0
  116. data/lib/clever-ruby/models/schools_created.rb +207 -0
  117. data/lib/clever-ruby/models/schools_deleted.rb +207 -0
  118. data/lib/clever-ruby/models/schools_response.rb +189 -0
  119. data/lib/clever-ruby/models/schools_updated.rb +207 -0
  120. data/lib/clever-ruby/models/section.rb +344 -0
  121. data/lib/clever-ruby/models/section_object.rb +187 -0
  122. data/lib/clever-ruby/models/section_response.rb +187 -0
  123. data/lib/clever-ruby/models/sections_created.rb +207 -0
  124. data/lib/clever-ruby/models/sections_deleted.rb +207 -0
  125. data/lib/clever-ruby/models/sections_response.rb +189 -0
  126. data/lib/clever-ruby/models/sections_updated.rb +207 -0
  127. data/lib/clever-ruby/models/student.rb +360 -0
  128. data/lib/clever-ruby/models/student_contact.rb +259 -0
  129. data/lib/clever-ruby/models/student_contact_object.rb +187 -0
  130. data/lib/clever-ruby/models/student_contact_response.rb +187 -0
  131. data/lib/clever-ruby/models/student_contacts_response.rb +189 -0
  132. data/lib/clever-ruby/models/student_object.rb +187 -0
  133. data/lib/clever-ruby/models/student_response.rb +187 -0
  134. data/lib/clever-ruby/models/studentcontacts_created.rb +207 -0
  135. data/lib/clever-ruby/models/studentcontacts_deleted.rb +207 -0
  136. data/lib/clever-ruby/models/studentcontacts_updated.rb +207 -0
  137. data/lib/clever-ruby/models/students_created.rb +196 -0
  138. data/lib/clever-ruby/models/students_deleted.rb +206 -0
  139. data/lib/clever-ruby/models/students_response.rb +189 -0
  140. data/lib/clever-ruby/models/students_updated.rb +207 -0
  141. data/lib/clever-ruby/models/teacher.rb +288 -0
  142. data/lib/clever-ruby/models/teacher_object.rb +187 -0
  143. data/lib/clever-ruby/models/teacher_response.rb +187 -0
  144. data/lib/clever-ruby/models/teachers_created.rb +207 -0
  145. data/lib/clever-ruby/models/teachers_deleted.rb +207 -0
  146. data/lib/clever-ruby/models/teachers_response.rb +189 -0
  147. data/lib/clever-ruby/models/teachers_updated.rb +207 -0
  148. data/lib/clever-ruby/models/term.rb +205 -0
  149. data/lib/clever-ruby/version.rb +12 -4
  150. data/override/api_client.rb +401 -0
  151. data/override/config.json +5 -0
  152. data/override/models/districts_created.rb +206 -0
  153. data/override/models/districts_deleted.rb +207 -0
  154. data/override/models/districts_updated.rb +207 -0
  155. data/override/models/schooladmins_created.rb +207 -0
  156. data/override/models/schooladmins_deleted.rb +207 -0
  157. data/override/models/schooladmins_updated.rb +207 -0
  158. data/override/models/schools_created.rb +207 -0
  159. data/override/models/schools_deleted.rb +207 -0
  160. data/override/models/schools_updated.rb +207 -0
  161. data/override/models/sections_created.rb +207 -0
  162. data/override/models/sections_deleted.rb +207 -0
  163. data/override/models/sections_updated.rb +207 -0
  164. data/override/models/studentcontacts_created.rb +207 -0
  165. data/override/models/studentcontacts_deleted.rb +207 -0
  166. data/override/models/studentcontacts_updated.rb +207 -0
  167. data/override/models/students_created.rb +196 -0
  168. data/override/models/students_deleted.rb +206 -0
  169. data/override/models/students_updated.rb +207 -0
  170. data/override/models/teachers_created.rb +207 -0
  171. data/override/models/teachers_deleted.rb +207 -0
  172. data/override/models/teachers_updated.rb +207 -0
  173. data/override/override.sh +9 -0
  174. data/sample/sample.rb +16 -0
  175. metadata +252 -293
  176. data/.document +0 -5
  177. data/.gitignore +0 -22
  178. data/.rubocop.yml +0 -4
  179. data/.yardopts +0 -2
  180. data/LICENSE.txt +0 -20
  181. data/lib/clever-ruby/api_operations/list.rb +0 -130
  182. data/lib/clever-ruby/api_operations/nested_list.rb +0 -95
  183. data/lib/clever-ruby/api_operations/page.rb +0 -71
  184. data/lib/clever-ruby/api_operations/pagelist.rb +0 -43
  185. data/lib/clever-ruby/api_operations/results_list.rb +0 -31
  186. data/lib/clever-ruby/api_resource.rb +0 -174
  187. data/lib/clever-ruby/clever_object.rb +0 -246
  188. data/lib/clever-ruby/district.rb +0 -75
  189. data/lib/clever-ruby/district_admin.rb +0 -45
  190. data/lib/clever-ruby/errors/api_connection_error.rb +0 -5
  191. data/lib/clever-ruby/errors/api_error.rb +0 -5
  192. data/lib/clever-ruby/errors/authentication_error.rb +0 -5
  193. data/lib/clever-ruby/errors/clever_error.rb +0 -52
  194. data/lib/clever-ruby/errors/invalid_request_error.rb +0 -17
  195. data/lib/clever-ruby/event.rb +0 -61
  196. data/lib/clever-ruby/json.rb +0 -34
  197. data/lib/clever-ruby/nested_resource.rb +0 -41
  198. data/lib/clever-ruby/school.rb +0 -17
  199. data/lib/clever-ruby/school_admin.rb +0 -19
  200. data/lib/clever-ruby/section.rb +0 -17
  201. data/lib/clever-ruby/student.rb +0 -30
  202. data/lib/clever-ruby/teacher.rb +0 -17
  203. data/lib/clever-ruby/util.rb +0 -108
  204. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_district_properly.yml +0 -52
  205. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_event_properly.yml +0 -52
  206. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_school_admin_properly.yml +0 -52
  207. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_school_properly.yml +0 -52
  208. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_section_properly.yml +0 -52
  209. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_student_properly.yml +0 -52
  210. data/test/data/vcr_cassettes/Clever_APIOperations_List/counts_teacher_properly.yml +0 -52
  211. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_district.yml +0 -101
  212. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_district_admin.yml +0 -90
  213. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_event.yml +0 -124
  214. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_school.yml +0 -113
  215. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_school_admin.yml +0 -101
  216. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_section.yml +0 -368
  217. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_student.yml +0 -176
  218. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_a_single_teacher.yml +0 -191
  219. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_districts_by_page.yml +0 -101
  220. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_districts_with_multiple_ids.yml +0 -101
  221. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_events_by_page.yml +0 -122
  222. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_events_with_multiple_ids.yml +0 -131
  223. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_school_admins_by_page.yml +0 -101
  224. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_school_admins_with_multiple_ids.yml +0 -101
  225. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_schools_by_page.yml +0 -110
  226. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_schools_with_multiple_ids.yml +0 -116
  227. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_sections_by_page.yml +0 -1168
  228. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_sections_with_multiple_ids.yml +0 -163
  229. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_students_by_page.yml +0 -1207
  230. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_students_with_multiple_ids.yml +0 -127
  231. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_teachers_by_page.yml +0 -190
  232. data/test/data/vcr_cassettes/Clever_APIOperations_List/finds_teachers_with_multiple_ids.yml +0 -131
  233. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_district.yml +0 -101
  234. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_event.yml +0 -122
  235. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_school.yml +0 -110
  236. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_school_admin.yml +0 -101
  237. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_section.yml +0 -1168
  238. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_student.yml +0 -1207
  239. data/test/data/vcr_cassettes/Clever_APIOperations_List/retrieves_all_teacher.yml +0 -190
  240. data/test/data/vcr_cassettes/Clever_District/pages_methods/pages_a_district_s_events.yml +0 -526
  241. data/test/data/vcr_cassettes/Clever_District/pages_methods/pages_a_district_s_schools.yml +0 -240
  242. data/test/data/vcr_cassettes/Clever_District/pages_methods/pages_a_district_s_sections.yml +0 -3674
  243. data/test/data/vcr_cassettes/Clever_District/pages_methods/pages_a_district_s_students.yml +0 -2387
  244. data/test/data/vcr_cassettes/Clever_District/pages_methods/pages_a_district_s_teachers.yml +0 -717
  245. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_events.yml +0 -152
  246. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_schools.yml +0 -211
  247. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_sections.yml +0 -3649
  248. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_students.yml +0 -2362
  249. data/test/data/vcr_cassettes/Clever_District_without_global_token/pages_methods/pages_a_district_s_teachers.yml +0 -688
  250. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_events.yml +0 -89
  251. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_school_admins.yml +0 -101
  252. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_schools.yml +0 -164
  253. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_sections.yml +0 -1168
  254. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_students.yml +0 -1207
  255. data/test/data/vcr_cassettes/Clever_District_without_global_token/retrieves_a_district_s_teachers.yml +0 -324
  256. data/test/data/vcr_cassettes/Clever_NestedResource/must_include_auth_token_in_linked_resources.yml +0 -197
  257. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_events.yml +0 -237
  258. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_schools.yml +0 -217
  259. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_sections.yml +0 -2333
  260. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_students.yml +0 -2411
  261. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_district_s_teachers.yml +0 -377
  262. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_admin_s_schools.yml +0 -205
  263. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_district.yml +0 -162
  264. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_events.yml +0 -215
  265. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_sections.yml +0 -1153
  266. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_students.yml +0 -1081
  267. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_school_s_teachers.yml +0 -283
  268. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_district.yml +0 -417
  269. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_events.yml +0 -470
  270. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_school.yml +0 -420
  271. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_students.yml +0 -482
  272. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_section_s_teacher.yml +0 -418
  273. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_district.yml +0 -226
  274. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_events.yml +0 -279
  275. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_school.yml +0 -229
  276. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_sections.yml +0 -301
  277. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_student_s_teachers.yml +0 -277
  278. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_district.yml +0 -240
  279. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_events.yml +0 -293
  280. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_school.yml +0 -243
  281. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_sections.yml +0 -321
  282. data/test/data/vcr_cassettes/Clever_NestedResource/retrieves_a_teacher_s_students.yml +0 -323
  283. data/test/data/vcr_cassettes/Error_handling/raises_an_InvalidRequestError_when_given_a_bad_created_since.yml +0 -151
  284. data/test/data/vcr_cassettes/Optional_attributes/has_the_expected_value_for_an_optional_attribute_that_is_present.yml +0 -55
  285. data/test/data/vcr_cassettes/last_method/page/has_working_first_and_last_methods.yml +0 -800
  286. data/test/integration/api_operations/list_test.rb +0 -117
  287. data/test/integration/district_test.rb +0 -53
  288. data/test/integration/district_with_non_global_token_test.rb +0 -88
  289. data/test/integration/error_handling_test.rb +0 -17
  290. data/test/integration/last_test.rb +0 -56
  291. data/test/integration/nested_resource_test.rb +0 -31
  292. data/test/test_helper.rb +0 -18
  293. data/test/unit/api_resource_test.rb +0 -48
  294. data/test/unit/clever_test.rb +0 -65
  295. data/test/unit/configuration_test.rb +0 -37
  296. data/test/unit/event_test.rb +0 -57
  297. data/test/unit/optional_attributes_test.rb +0 -27
@@ -0,0 +1,259 @@
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 StudentContact
17
+ attr_accessor :id
18
+
19
+ attr_accessor :district
20
+
21
+ attr_accessor :email
22
+
23
+ attr_accessor :name
24
+
25
+ attr_accessor :phone
26
+
27
+ attr_accessor :phone_type
28
+
29
+ attr_accessor :relationship
30
+
31
+ attr_accessor :student
32
+
33
+ attr_accessor :type
34
+
35
+
36
+ # Attribute mapping from ruby-style variable name to JSON key.
37
+ def self.attribute_map
38
+ {
39
+ :'id' => :'id',
40
+ :'district' => :'district',
41
+ :'email' => :'email',
42
+ :'name' => :'name',
43
+ :'phone' => :'phone',
44
+ :'phone_type' => :'phone_type',
45
+ :'relationship' => :'relationship',
46
+ :'student' => :'student',
47
+ :'type' => :'type'
48
+ }
49
+ end
50
+
51
+ # Attribute type mapping.
52
+ def self.swagger_types
53
+ {
54
+ :'id' => :'String',
55
+ :'district' => :'String',
56
+ :'email' => :'String',
57
+ :'name' => :'String',
58
+ :'phone' => :'String',
59
+ :'phone_type' => :'String',
60
+ :'relationship' => :'String',
61
+ :'student' => :'String',
62
+ :'type' => :'String'
63
+ }
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ return unless attributes.is_a?(Hash)
70
+
71
+ # convert string to symbol for hash key
72
+ attributes = attributes.each_with_object({}){|(k,v), h| h[k.to_sym] = v}
73
+
74
+ if attributes.has_key?(:'id')
75
+ self.id = attributes[:'id']
76
+ end
77
+
78
+ if attributes.has_key?(:'district')
79
+ self.district = attributes[:'district']
80
+ end
81
+
82
+ if attributes.has_key?(:'email')
83
+ self.email = attributes[:'email']
84
+ end
85
+
86
+ if attributes.has_key?(:'name')
87
+ self.name = attributes[:'name']
88
+ end
89
+
90
+ if attributes.has_key?(:'phone')
91
+ self.phone = attributes[:'phone']
92
+ end
93
+
94
+ if attributes.has_key?(:'phone_type')
95
+ self.phone_type = attributes[:'phone_type']
96
+ end
97
+
98
+ if attributes.has_key?(:'relationship')
99
+ self.relationship = attributes[:'relationship']
100
+ end
101
+
102
+ if attributes.has_key?(:'student')
103
+ self.student = attributes[:'student']
104
+ end
105
+
106
+ if attributes.has_key?(:'type')
107
+ self.type = attributes[:'type']
108
+ end
109
+
110
+ end
111
+
112
+ # Show invalid properties with the reasons. Usually used together with valid?
113
+ # @return Array for valid properies with the reasons
114
+ def list_invalid_properties
115
+ invalid_properties = Array.new
116
+ return invalid_properties
117
+ end
118
+
119
+ # Check to see if the all the properties in the model are valid
120
+ # @return true if the model is valid
121
+ def valid?
122
+ return true
123
+ end
124
+
125
+ # Checks equality by comparing each attribute.
126
+ # @param [Object] Object to be compared
127
+ def ==(o)
128
+ return true if self.equal?(o)
129
+ self.class == o.class &&
130
+ id == o.id &&
131
+ district == o.district &&
132
+ email == o.email &&
133
+ name == o.name &&
134
+ phone == o.phone &&
135
+ phone_type == o.phone_type &&
136
+ relationship == o.relationship &&
137
+ student == o.student &&
138
+ type == o.type
139
+ end
140
+
141
+ # @see the `==` method
142
+ # @param [Object] Object to be compared
143
+ def eql?(o)
144
+ self == o
145
+ end
146
+
147
+ # Calculates hash code according to all attributes.
148
+ # @return [Fixnum] Hash code
149
+ def hash
150
+ [id, district, email, name, phone, phone_type, relationship, student, type].hash
151
+ end
152
+
153
+ # Builds the object from hash
154
+ # @param [Hash] attributes Model attributes in the form of hash
155
+ # @return [Object] Returns the model itself
156
+ def build_from_hash(attributes)
157
+ return nil unless attributes.is_a?(Hash)
158
+ self.class.swagger_types.each_pair do |key, type|
159
+ if type =~ /\AArray<(.*)>/i
160
+ # check to ensure the input is an array given that the the attribute
161
+ # is documented as an array but the input is not
162
+ if attributes[self.class.attribute_map[key]].is_a?(Array)
163
+ self.send("#{key}=", attributes[self.class.attribute_map[key]].map{ |v| _deserialize($1, v) } )
164
+ end
165
+ elsif !attributes[self.class.attribute_map[key]].nil?
166
+ self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]]))
167
+ end # or else data not found in attributes(hash), not an issue as the data can be optional
168
+ end
169
+
170
+ self
171
+ end
172
+
173
+ # Deserializes the data based on type
174
+ # @param string type Data type
175
+ # @param string value Value to be deserialized
176
+ # @return [Object] Deserialized data
177
+ def _deserialize(type, value)
178
+ case type.to_sym
179
+ when :DateTime
180
+ DateTime.parse(value)
181
+ when :Date
182
+ Date.parse(value)
183
+ when :String
184
+ value.to_s
185
+ when :Integer
186
+ value.to_i
187
+ when :Float
188
+ value.to_f
189
+ when :BOOLEAN
190
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
191
+ true
192
+ else
193
+ false
194
+ end
195
+ when :Object
196
+ # generic object (usually a Hash), return directly
197
+ value
198
+ when /\AArray<(?<inner_type>.+)>\z/
199
+ inner_type = Regexp.last_match[:inner_type]
200
+ value.map { |v| _deserialize(inner_type, v) }
201
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
202
+ k_type = Regexp.last_match[:k_type]
203
+ v_type = Regexp.last_match[:v_type]
204
+ {}.tap do |hash|
205
+ value.each do |k, v|
206
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
207
+ end
208
+ end
209
+ else # model
210
+ temp_model = Clever.const_get(type).new
211
+ temp_model.build_from_hash(value)
212
+ end
213
+ end
214
+
215
+ # Returns the string representation of the object
216
+ # @return [String] String presentation of the object
217
+ def to_s
218
+ to_hash.to_s
219
+ end
220
+
221
+ # to_body is an alias to to_hash (backward compatibility)
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_body
224
+ to_hash
225
+ end
226
+
227
+ # Returns the object in the form of hash
228
+ # @return [Hash] Returns the object in the form of hash
229
+ def to_hash
230
+ hash = {}
231
+ self.class.attribute_map.each_pair do |attr, param|
232
+ value = self.send(attr)
233
+ next if value.nil?
234
+ hash[param] = _to_hash(value)
235
+ end
236
+ hash
237
+ end
238
+
239
+ # Outputs non-array value in the form of hash
240
+ # For object, use to_hash. Otherwise, just return the value
241
+ # @param [Object] value Any valid value
242
+ # @return [Hash] Returns the value in the form of hash
243
+ def _to_hash(value)
244
+ if value.is_a?(Array)
245
+ value.compact.map{ |v| _to_hash(v) }
246
+ elsif value.is_a?(Hash)
247
+ {}.tap do |hash|
248
+ value.each { |k, v| hash[k] = _to_hash(v) }
249
+ end
250
+ elsif value.respond_to? :to_hash
251
+ value.to_hash
252
+ else
253
+ value
254
+ end
255
+ end
256
+
257
+ end
258
+
259
+ end
@@ -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 StudentContactObject
17
+ attr_accessor :object
18
+
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'object' => :'object'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'object' => :'StudentContact'
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?(:'object')
43
+ self.object = attributes[:'object']
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
+ object == o.object
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
+ [object].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
@@ -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 StudentContactResponse
17
+ attr_accessor :data
18
+
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'data' => :'data'
24
+ }
25
+ end
26
+
27
+ # Attribute type mapping.
28
+ def self.swagger_types
29
+ {
30
+ :'data' => :'StudentContact'
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?(:'data')
43
+ self.data = attributes[:'data']
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
+ data == o.data
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
+ [data].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