From 59c871674945b3aed8c4461320f63b9d030d0bd1 Mon Sep 17 00:00:00 2001 From: Geoff Harcourt Date: Thu, 30 Nov 2023 15:38:24 -0500 Subject: [PATCH] Use Swagger Codegen v2 Swagger Codegen v3 has too many changes to the data API, so we're going to keep using v2 for now. --- .swagger-codegen/VERSION | 2 +- Gemfile | 4 +- Gemfile.lock | 60 +- README.md | 949 +----------------- clever-ruby.gemspec | 11 +- docs/AdminName.md | 1 + docs/BadRequest.md | 1 + docs/Contact.md | 1 + docs/ContactObject.md | 1 + docs/ContactResponse.md | 1 + docs/ContactsApi.md | 8 +- docs/ContactsCreated.md | 1 + docs/ContactsDeleted.md | 1 + docs/ContactsResponse.md | 1 + docs/ContactsUpdated.md | 1 + docs/Course.md | 1 + docs/CourseObject.md | 1 + docs/CourseResponse.md | 1 + docs/CoursesApi.md | 8 +- docs/CoursesCreated.md | 1 + docs/CoursesDeleted.md | 1 + docs/CoursesResponse.md | 1 + docs/CoursesUpdated.md | 1 + docs/Credentials.md | 1 + docs/District.md | 1 + docs/DistrictAdmin.md | 1 + docs/DistrictAdminObject.md | 1 + docs/DistrictAdminResponse.md | 1 + docs/DistrictAdminsApi.md | 6 +- docs/DistrictAdminsResponse.md | 1 + docs/DistrictObject.md | 1 + docs/DistrictResponse.md | 1 + docs/DistrictadminsCreated.md | 1 + docs/DistrictadminsDeleted.md | 1 + docs/DistrictadminsUpdated.md | 1 + docs/DistrictsApi.md | 5 +- docs/DistrictsCreated.md | 1 + docs/DistrictsDeleted.md | 1 + docs/DistrictsResponse.md | 1 + docs/DistrictsUpdated.md | 1 + docs/Event.md | 1 + docs/EventResponse.md | 1 + docs/EventsApi.md | 5 +- docs/EventsResponse.md | 1 + docs/InternalError.md | 1 + docs/Link.md | 1 + docs/Location.md | 1 + docs/Name.md | 1 + docs/NotFound.md | 1 + docs/Principal.md | 1 + docs/School.md | 1 + docs/SchoolAdmin.md | 1 + docs/SchoolAdminObject.md | 1 + docs/SchoolAdminResponse.md | 1 + docs/SchoolAdminsApi.md | 8 +- docs/SchoolAdminsResponse.md | 1 + docs/SchoolEnrollment.md | 1 + docs/SchoolObject.md | 1 + docs/SchoolResponse.md | 1 + docs/SchooladminsCreated.md | 1 + docs/SchooladminsDeleted.md | 1 + docs/SchooladminsUpdated.md | 1 + docs/SchoolsApi.md | 12 +- docs/SchoolsCreated.md | 1 + docs/SchoolsDeleted.md | 1 + docs/SchoolsResponse.md | 1 + docs/SchoolsUpdated.md | 1 + docs/Section.md | 1 + docs/SectionObject.md | 1 + docs/SectionResponse.md | 1 + docs/SectionsApi.md | 14 +- docs/SectionsCreated.md | 1 + docs/SectionsDeleted.md | 1 + docs/SectionsResponse.md | 1 + docs/SectionsUpdated.md | 1 + docs/Student.md | 1 + docs/StudentObject.md | 1 + docs/StudentResponse.md | 1 + docs/StudentsApi.md | 15 +- docs/StudentsCreated.md | 1 + docs/StudentsDeleted.md | 1 + docs/StudentsResponse.md | 1 + docs/StudentsUpdated.md | 1 + docs/Teacher.md | 1 + docs/TeacherObject.md | 1 + docs/TeacherResponse.md | 1 + docs/TeachersApi.md | 13 +- docs/TeachersCreated.md | 1 + docs/TeachersDeleted.md | 1 + docs/TeachersResponse.md | 1 + docs/TeachersUpdated.md | 1 + docs/Term.md | 1 + docs/TermObject.md | 1 + docs/TermResponse.md | 1 + docs/TermsApi.md | 8 +- docs/TermsCreated.md | 1 + docs/TermsDeleted.md | 1 + docs/TermsResponse.md | 1 + docs/TermsUpdated.md | 1 + lib/clever-ruby.rb | 3 +- lib/clever-ruby/api/contacts_api.rb | 77 +- lib/clever-ruby/api/courses_api.rb | 77 +- lib/clever-ruby/api/district_admins_api.rb | 59 +- lib/clever-ruby/api/districts_api.rb | 41 +- lib/clever-ruby/api/events_api.rb | 41 +- lib/clever-ruby/api/school_admins_api.rb | 77 +- lib/clever-ruby/api/schools_api.rb | 113 +-- lib/clever-ruby/api/sections_api.rb | 167 ++- lib/clever-ruby/api/students_api.rb | 149 ++- lib/clever-ruby/api/teachers_api.rb | 131 +-- lib/clever-ruby/api/terms_api.rb | 77 +- lib/clever-ruby/api_error.rb | 23 +- lib/clever-ruby/configuration.rb | 10 +- lib/clever-ruby/models/admin_name.rb | 64 +- lib/clever-ruby/models/bad_request.rb | 58 +- lib/clever-ruby/models/contact.rb | 118 +-- lib/clever-ruby/models/contact_object.rb | 58 +- lib/clever-ruby/models/contact_response.rb | 58 +- lib/clever-ruby/models/contacts_response.rb | 62 +- lib/clever-ruby/models/course.rb | 72 +- lib/clever-ruby/models/course_object.rb | 58 +- lib/clever-ruby/models/course_response.rb | 58 +- lib/clever-ruby/models/courses_response.rb | 62 +- lib/clever-ruby/models/credentials.rb | 58 +- lib/clever-ruby/models/district.rb | 122 +-- lib/clever-ruby/models/district_admin.rb | 75 +- .../models/district_admin_object.rb | 58 +- .../models/district_admin_response.rb | 58 +- .../models/district_admins_response.rb | 62 +- lib/clever-ruby/models/district_object.rb | 58 +- lib/clever-ruby/models/district_response.rb | 58 +- lib/clever-ruby/models/districts_response.rb | 62 +- lib/clever-ruby/models/event.rb | 71 +- lib/clever-ruby/models/event_response.rb | 58 +- lib/clever-ruby/models/events_response.rb | 62 +- lib/clever-ruby/models/internal_error.rb | 58 +- lib/clever-ruby/models/link.rb | 68 +- lib/clever-ruby/models/location.rb | 84 +- lib/clever-ruby/models/name.rb | 69 +- lib/clever-ruby/models/not_found.rb | 58 +- lib/clever-ruby/models/principal.rb | 64 +- lib/clever-ruby/models/school.rb | 134 +-- lib/clever-ruby/models/school_admin.rb | 94 +- lib/clever-ruby/models/school_admin_object.rb | 58 +- .../models/school_admin_response.rb | 58 +- .../models/school_admins_response.rb | 62 +- lib/clever-ruby/models/school_enrollment.rb | 66 +- lib/clever-ruby/models/school_object.rb | 58 +- lib/clever-ruby/models/school_response.rb | 58 +- lib/clever-ruby/models/schools_response.rb | 62 +- lib/clever-ruby/models/section.rb | 139 +-- lib/clever-ruby/models/section_object.rb | 58 +- lib/clever-ruby/models/section_response.rb | 58 +- lib/clever-ruby/models/sections_response.rb | 62 +- lib/clever-ruby/models/student.rb | 221 ++-- lib/clever-ruby/models/student_object.rb | 58 +- lib/clever-ruby/models/student_response.rb | 58 +- lib/clever-ruby/models/students_response.rb | 62 +- lib/clever-ruby/models/teacher.rb | 112 +-- lib/clever-ruby/models/teacher_object.rb | 58 +- lib/clever-ruby/models/teacher_response.rb | 58 +- lib/clever-ruby/models/teachers_response.rb | 62 +- lib/clever-ruby/models/term.rb | 77 +- lib/clever-ruby/models/term_object.rb | 58 +- lib/clever-ruby/models/term_response.rb | 58 +- lib/clever-ruby/models/terms_response.rb | 62 +- lib/clever-ruby/version.rb | 5 +- override/override.sh | 3 - 168 files changed, 1929 insertions(+), 4117 deletions(-) diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION index b262b4de..cdda05bc 100644 --- a/.swagger-codegen/VERSION +++ b/.swagger-codegen/VERSION @@ -1 +1 @@ -3.0.51 \ No newline at end of file +2.4.37 \ No newline at end of file diff --git a/Gemfile b/Gemfile index c2e3127c..f58bec06 100644 --- a/Gemfile +++ b/Gemfile @@ -3,7 +3,5 @@ source 'https://rubygems.org' gemspec group :development, :test do - gem 'rake', '~> 13.0.1' - gem 'pry-byebug' - gem 'rubocop', '~> 0.66.0' + gem 'rake', '~> 12.3.3' end diff --git a/Gemfile.lock b/Gemfile.lock index 618a77b7..ad32f4fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,34 +9,26 @@ PATH GEM remote: https://rubygems.org/ specs: + ZenTest (4.12.1) addressable (2.8.5) public_suffix (>= 2.0.2, < 6.0) - ast (2.4.2) - byebug (11.1.3) - coderay (1.1.3) + autotest (4.4.6) + ZenTest (>= 4.4.1) + autotest-fsevent (0.2.20) + sys-uname + autotest-growl (0.2.16) + autotest-rails-pure (4.1.2) + crack (0.4.5) + rexml diff-lcs (1.3) ethon (0.16.0) ffi (>= 1.15.0) ffi (1.16.3) - jaro_winkler (1.5.6) + hashdiff (1.0.1) json (2.6.3) - method_source (1.0.0) - parallel (1.23.0) - parser (3.2.2.4) - ast (~> 2.4.1) - racc - pry (0.14.2) - coderay (~> 1.1) - method_source (~> 1.0) - pry-byebug (3.10.1) - byebug (~> 11.0) - pry (>= 0.13, < 0.15) - psych (5.1.1.1) - stringio public_suffix (5.0.4) - racc (1.7.3) - rainbow (3.1.1) - rake (13.0.6) + rake (12.3.3) + rexml (3.2.6) rspec (3.9.0) rspec-core (~> 3.9.0) rspec-expectations (~> 3.9.0) @@ -50,29 +42,29 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.9.0) rspec-support (3.9.3) - rubocop (0.66.0) - jaro_winkler (~> 1.5.1) - parallel (~> 1.10) - parser (>= 2.5, != 2.5.1.1) - psych (>= 3.1.0) - rainbow (>= 2.2.2, < 4.0) - ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 1.6) - ruby-progressbar (1.13.0) - stringio (3.1.0) + sys-uname (1.2.3) + ffi (~> 1.1) typhoeus (1.4.1) ethon (>= 0.9.0) - unicode-display_width (1.5.0) + vcr (3.0.3) + webmock (1.24.6) + addressable (>= 2.3.6) + crack (>= 0.3.2) + hashdiff PLATFORMS ruby DEPENDENCIES + autotest (~> 4.4, >= 4.4.6) + autotest-fsevent (~> 0.2, >= 0.2.12) + autotest-growl (~> 0.2, >= 0.2.16) + autotest-rails-pure (~> 4.1, >= 4.1.2) commonlit-clever-ruby! - pry-byebug - rake (~> 13.0.1) + rake (~> 12.3.3) rspec (~> 3.6, >= 3.6.0) - rubocop (~> 0.66.0) + vcr (~> 3.0, >= 3.0.1) + webmock (~> 1.24, >= 1.24.3) BUNDLED WITH 2.4.12 diff --git a/README.md b/README.md index 4c3d892b..07d3396e 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ This SDK is automatically generated by the [Swagger Codegen](https://github.com/ - API version: 2.1.0 - Package version: 2.1.4 -- Build package: io.swagger.codegen.v3.generators.ruby.RubyClientCodegen +- Build package: io.swagger.codegen.languages.RubyClientCodegen ## Installation @@ -53,965 +53,30 @@ Please follow the [installation](#installation) procedure and then run the follo ```ruby # Load the gem require 'clever-ruby' -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::ContactsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_contact(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling ContactsApi->get_contact: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::ContactsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_contacts(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling ContactsApi->get_contacts: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::ContactsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_contact(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling ContactsApi->get_district_for_contact: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::ContactsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_students_for_contact(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling ContactsApi->get_students_for_contact: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::CoursesApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_course(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling CoursesApi->get_course: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::CoursesApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_courses(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling CoursesApi->get_courses: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::CoursesApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_course(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling CoursesApi->get_district_for_course: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::CoursesApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_sections_for_course(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling CoursesApi->get_sections_for_course: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::DistrictAdminsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_admin(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling DistrictAdminsApi->get_district_admin: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::DistrictAdminsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_district_admins(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling DistrictAdminsApi->get_district_admins: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::DistrictAdminsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_district_admin(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling DistrictAdminsApi->get_district_for_district_admin: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::DistrictsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling DistrictsApi->get_district: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::DistrictsApi.new -opts = { - count: 'count_example' # String | -} - -begin - result = api_instance.get_districts(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling DistrictsApi->get_districts: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::EventsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_event(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling EventsApi->get_event: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::EventsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - school: 'school_example', # String | - record_type: ['record_type_example'] # Array | -} - -begin - result = api_instance.get_events(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling EventsApi->get_events: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolAdminsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_school_admin(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolAdminsApi->get_district_for_school_admin: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolAdminsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_school_admin(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolAdminsApi->get_school_admin: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolAdminsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_school_admins(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolAdminsApi->get_school_admins: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolAdminsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_schools_for_school_admin(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolAdminsApi->get_schools_for_school_admin: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_school(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolsApi->get_district_for_school: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_school(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolsApi->get_school: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_schools(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolsApi->get_schools: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_sections_for_school(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolsApi->get_sections_for_school: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_students_for_school(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolsApi->get_students_for_school: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SchoolsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_teachers_for_school(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SchoolsApi->get_teachers_for_school: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_course_for_section(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_course_for_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_section(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_district_for_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_school_for_section(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_school_for_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_section(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_sections(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_sections: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_students_for_section(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_students_for_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_teacher_for_section(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_teacher_for_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_teachers_for_section(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_teachers_for_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::SectionsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_term_for_section(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling SectionsApi->get_term_for_section: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_contacts_for_student(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_contacts_for_student: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_student(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_district_for_student: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_school_for_student(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_school_for_student: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_schools_for_student(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_schools_for_student: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_sections_for_student(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_sections_for_student: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_student(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_student: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_students(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_students: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::StudentsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_teachers_for_student(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling StudentsApi->get_teachers_for_student: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TeachersApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_district_for_teacher(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling TeachersApi->get_district_for_teacher: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TeachersApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_school_for_teacher(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling TeachersApi->get_school_for_teacher: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TeachersApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_schools_for_teacher(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling TeachersApi->get_schools_for_teacher: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TeachersApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_sections_for_teacher(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling TeachersApi->get_sections_for_teacher: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TeachersApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_students_for_teacher(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling TeachersApi->get_students_for_teacher: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TeachersApi.new -id = 'id_example' # String | - - -begin - result = api_instance.get_teacher(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling TeachersApi->get_teacher: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TeachersApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_teachers(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling TeachersApi->get_teachers: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end - -api_instance = Clever::TermsApi.new -id = 'id_example' # String | - -begin - result = api_instance.get_district_for_term(id) - p result -rescue Clever::ApiError => e - puts "Exception when calling TermsApi->get_district_for_term: #{e}" -end # Setup authorization Clever.configure do |config| # Configure OAuth2 access token for authorization: oauth config.access_token = 'YOUR ACCESS TOKEN' end -api_instance = Clever::TermsApi.new -id = 'id_example' # String | -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example' # String | -} - -begin - result = api_instance.get_sections_for_term(id, opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling TermsApi->get_sections_for_term: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' -end +api_instance = Clever::ContactsApi.new -api_instance = Clever::TermsApi.new id = 'id_example' # String | begin - result = api_instance.get_term(id) + result = api_instance.get_contact(id) p result rescue Clever::ApiError => e - puts "Exception when calling TermsApi->get_term: #{e}" -end -# Setup authorization -Clever.configure do |config| - # Configure OAuth2 access token for authorization: oauth - config.access_token = 'YOUR ACCESS TOKEN' + puts "Exception when calling ContactsApi->get_contact: #{e}" end -api_instance = Clever::TermsApi.new -opts = { - limit: 56, # Integer | - starting_after: 'starting_after_example', # String | - ending_before: 'ending_before_example', # String | - count: 'count_example' # String | -} - -begin - result = api_instance.get_terms(opts) - p result -rescue Clever::ApiError => e - puts "Exception when calling TermsApi->get_terms: #{e}" -end ``` ## Documentation for API Endpoints -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- @@ -1069,6 +134,7 @@ Class | Method | HTTP request | Description *Clever::TermsApi* | [**get_term**](docs/TermsApi.md#get_term) | **GET** /terms/{id} | *Clever::TermsApi* | [**get_terms**](docs/TermsApi.md#get_terms) | **GET** /terms | + ## Documentation for Models - [Clever::AdminName](docs/AdminName.md) @@ -1155,6 +221,7 @@ Class | Method | HTTP request | Description - [Clever::TermsResponse](docs/TermsResponse.md) - [Clever::TermsUpdated](docs/TermsUpdated.md) + ## Documentation for Authorization @@ -1163,7 +230,7 @@ Class | Method | HTTP request | Description - **Type**: OAuth - **Flow**: accessCode - **Authorization URL**: https://clever.com/oauth/authorize -- **Scopes**: +- **Scopes**: N/A ## Previous Versions diff --git a/clever-ruby.gemspec b/clever-ruby.gemspec index 22330238..998159a8 100644 --- a/clever-ruby.gemspec +++ b/clever-ruby.gemspec @@ -8,7 +8,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end $:.push File.expand_path("../lib", __FILE__) @@ -25,12 +26,18 @@ Gem::Specification.new do |s| s.description = "Serves the Clever Data API" s.license = "Unlicense" s.required_ruby_version = ">= 1.9" - s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0' s.add_runtime_dependency 'typhoeus', '~> 1.0', '>= 1.0.1' s.add_runtime_dependency 'json', '~> 2.1', '>= 2.1.0' + s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0' s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0' + s.add_development_dependency 'vcr', '~> 3.0', '>= 3.0.1' + s.add_development_dependency 'webmock', '~> 1.24', '>= 1.24.3' + s.add_development_dependency 'autotest', '~> 4.4', '>= 4.4.6' + s.add_development_dependency 'autotest-rails-pure', '~> 4.1', '>= 4.1.2' + s.add_development_dependency 'autotest-growl', '~> 0.2', '>= 0.2.16' + s.add_development_dependency 'autotest-fsevent', '~> 0.2', '>= 0.2.12' s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? } s.test_files = `find spec/*`.split("\n") diff --git a/docs/AdminName.md b/docs/AdminName.md index c0bce213..e6a6aa7f 100644 --- a/docs/AdminName.md +++ b/docs/AdminName.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **first** | **String** | | [optional] **last** | **String** | | [optional] + diff --git a/docs/BadRequest.md b/docs/BadRequest.md index b95fe579..537d9f46 100644 --- a/docs/BadRequest.md +++ b/docs/BadRequest.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **String** | | [optional] + diff --git a/docs/Contact.md b/docs/Contact.md index 6ce58764..9e7ffe68 100644 --- a/docs/Contact.md +++ b/docs/Contact.md @@ -14,3 +14,4 @@ Name | Type | Description | Notes **students** | **Array<String>** | | [optional] **type** | **String** | | [optional] + diff --git a/docs/ContactObject.md b/docs/ContactObject.md index 7781fbf4..982fed28 100644 --- a/docs/ContactObject.md +++ b/docs/ContactObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**Contact**](Contact.md) | | [optional] + diff --git a/docs/ContactResponse.md b/docs/ContactResponse.md index c16dd976..d2245fdb 100644 --- a/docs/ContactResponse.md +++ b/docs/ContactResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Contact**](Contact.md) | | [optional] + diff --git a/docs/ContactsApi.md b/docs/ContactsApi.md index 4758e9aa..de6d9db5 100644 --- a/docs/ContactsApi.md +++ b/docs/ContactsApi.md @@ -1,6 +1,6 @@ # Clever::ContactsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -9,6 +9,7 @@ Method | HTTP request | Description [**get_district_for_contact**](ContactsApi.md#get_district_for_contact) | **GET** /contacts/{id}/district | [**get_students_for_contact**](ContactsApi.md#get_students_for_contact) | **GET** /contacts/{id}/students | + # **get_contact** > ContactResponse get_contact(id) @@ -27,6 +28,7 @@ Clever.configure do |config| end api_instance = Clever::ContactsApi.new + id = 'id_example' # String | @@ -77,6 +79,7 @@ Clever.configure do |config| end api_instance = Clever::ContactsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -134,6 +137,7 @@ Clever.configure do |config| end api_instance = Clever::ContactsApi.new + id = 'id_example' # String | @@ -184,7 +188,9 @@ Clever.configure do |config| end api_instance = Clever::ContactsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/ContactsCreated.md b/docs/ContactsCreated.md index 0387c9a8..8c5e32be 100644 --- a/docs/ContactsCreated.md +++ b/docs/ContactsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**ContactObject**](ContactObject.md) | | [optional] + diff --git a/docs/ContactsDeleted.md b/docs/ContactsDeleted.md index 92c79804..4ec2d3db 100644 --- a/docs/ContactsDeleted.md +++ b/docs/ContactsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**ContactObject**](ContactObject.md) | | [optional] + diff --git a/docs/ContactsResponse.md b/docs/ContactsResponse.md index 8fd4e11f..3e60aeb9 100644 --- a/docs/ContactsResponse.md +++ b/docs/ContactsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<ContactResponse>**](ContactResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/ContactsUpdated.md b/docs/ContactsUpdated.md index eddb5c5c..023f2f57 100644 --- a/docs/ContactsUpdated.md +++ b/docs/ContactsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**ContactObject**](ContactObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/Course.md b/docs/Course.md index 3a651ec9..b540253a 100644 --- a/docs/Course.md +++ b/docs/Course.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **number** | **String** | | [optional] **district** | **String** | | [optional] + diff --git a/docs/CourseObject.md b/docs/CourseObject.md index 10259912..08990559 100644 --- a/docs/CourseObject.md +++ b/docs/CourseObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**Course**](Course.md) | | [optional] + diff --git a/docs/CourseResponse.md b/docs/CourseResponse.md index 559335da..0bd3cdd8 100644 --- a/docs/CourseResponse.md +++ b/docs/CourseResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Course**](Course.md) | | [optional] + diff --git a/docs/CoursesApi.md b/docs/CoursesApi.md index 33e22dce..32ddf1d4 100644 --- a/docs/CoursesApi.md +++ b/docs/CoursesApi.md @@ -1,6 +1,6 @@ # Clever::CoursesApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -9,6 +9,7 @@ Method | HTTP request | Description [**get_district_for_course**](CoursesApi.md#get_district_for_course) | **GET** /courses/{id}/district | [**get_sections_for_course**](CoursesApi.md#get_sections_for_course) | **GET** /courses/{id}/sections | + # **get_course** > CourseResponse get_course(id) @@ -27,6 +28,7 @@ Clever.configure do |config| end api_instance = Clever::CoursesApi.new + id = 'id_example' # String | @@ -77,6 +79,7 @@ Clever.configure do |config| end api_instance = Clever::CoursesApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -134,6 +137,7 @@ Clever.configure do |config| end api_instance = Clever::CoursesApi.new + id = 'id_example' # String | @@ -184,7 +188,9 @@ Clever.configure do |config| end api_instance = Clever::CoursesApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/CoursesCreated.md b/docs/CoursesCreated.md index b676d37f..a70c7f07 100644 --- a/docs/CoursesCreated.md +++ b/docs/CoursesCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**CourseObject**](CourseObject.md) | | [optional] + diff --git a/docs/CoursesDeleted.md b/docs/CoursesDeleted.md index 0f7fe755..8b15f4c6 100644 --- a/docs/CoursesDeleted.md +++ b/docs/CoursesDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**CourseObject**](CourseObject.md) | | [optional] + diff --git a/docs/CoursesResponse.md b/docs/CoursesResponse.md index 26d45e97..0b342aa1 100644 --- a/docs/CoursesResponse.md +++ b/docs/CoursesResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<CourseResponse>**](CourseResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/CoursesUpdated.md b/docs/CoursesUpdated.md index 486bc846..1683a636 100644 --- a/docs/CoursesUpdated.md +++ b/docs/CoursesUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**CourseObject**](CourseObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/Credentials.md b/docs/Credentials.md index 08dd88d0..cf9fbf3a 100644 --- a/docs/Credentials.md +++ b/docs/Credentials.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **district_username** | **String** | | [optional] + diff --git a/docs/District.md b/docs/District.md index 549eda16..534bec38 100644 --- a/docs/District.md +++ b/docs/District.md @@ -18,3 +18,4 @@ Name | Type | Description | Notes **login_methods** | **Array<String>** | | [optional] **district_contact** | [**DistrictAdmin**](DistrictAdmin.md) | | [optional] + diff --git a/docs/DistrictAdmin.md b/docs/DistrictAdmin.md index 2870d78b..68b37436 100644 --- a/docs/DistrictAdmin.md +++ b/docs/DistrictAdmin.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **title** | **String** | | [optional] **district** | **String** | | [optional] + diff --git a/docs/DistrictAdminObject.md b/docs/DistrictAdminObject.md index e9f93ecf..a2ce8df0 100644 --- a/docs/DistrictAdminObject.md +++ b/docs/DistrictAdminObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**DistrictAdmin**](DistrictAdmin.md) | | [optional] + diff --git a/docs/DistrictAdminResponse.md b/docs/DistrictAdminResponse.md index f313a86d..ba0ec51f 100644 --- a/docs/DistrictAdminResponse.md +++ b/docs/DistrictAdminResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**DistrictAdmin**](DistrictAdmin.md) | | [optional] + diff --git a/docs/DistrictAdminsApi.md b/docs/DistrictAdminsApi.md index 99b6103a..36e5d4a3 100644 --- a/docs/DistrictAdminsApi.md +++ b/docs/DistrictAdminsApi.md @@ -1,6 +1,6 @@ # Clever::DistrictAdminsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -8,6 +8,7 @@ Method | HTTP request | Description [**get_district_admins**](DistrictAdminsApi.md#get_district_admins) | **GET** /district_admins | [**get_district_for_district_admin**](DistrictAdminsApi.md#get_district_for_district_admin) | **GET** /district_admins/{id}/district | + # **get_district_admin** > DistrictAdminResponse get_district_admin(id) @@ -26,6 +27,7 @@ Clever.configure do |config| end api_instance = Clever::DistrictAdminsApi.new + id = 'id_example' # String | @@ -76,6 +78,7 @@ Clever.configure do |config| end api_instance = Clever::DistrictAdminsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -133,6 +136,7 @@ Clever.configure do |config| end api_instance = Clever::DistrictAdminsApi.new + id = 'id_example' # String | diff --git a/docs/DistrictAdminsResponse.md b/docs/DistrictAdminsResponse.md index abc52655..cf2da6e6 100644 --- a/docs/DistrictAdminsResponse.md +++ b/docs/DistrictAdminsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<DistrictAdminResponse>**](DistrictAdminResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/DistrictObject.md b/docs/DistrictObject.md index 76e3f55d..2ca508ea 100644 --- a/docs/DistrictObject.md +++ b/docs/DistrictObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**District**](District.md) | | [optional] + diff --git a/docs/DistrictResponse.md b/docs/DistrictResponse.md index abf10910..ab2452f4 100644 --- a/docs/DistrictResponse.md +++ b/docs/DistrictResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**District**](District.md) | | [optional] + diff --git a/docs/DistrictadminsCreated.md b/docs/DistrictadminsCreated.md index d9f26ea9..c6569463 100644 --- a/docs/DistrictadminsCreated.md +++ b/docs/DistrictadminsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**DistrictAdminObject**](DistrictAdminObject.md) | | [optional] + diff --git a/docs/DistrictadminsDeleted.md b/docs/DistrictadminsDeleted.md index 865f61c6..8c42217e 100644 --- a/docs/DistrictadminsDeleted.md +++ b/docs/DistrictadminsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**DistrictAdminObject**](DistrictAdminObject.md) | | [optional] + diff --git a/docs/DistrictadminsUpdated.md b/docs/DistrictadminsUpdated.md index 266200d1..62287e6c 100644 --- a/docs/DistrictadminsUpdated.md +++ b/docs/DistrictadminsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**DistrictAdminObject**](DistrictAdminObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/DistrictsApi.md b/docs/DistrictsApi.md index 0afd8587..2289f04d 100644 --- a/docs/DistrictsApi.md +++ b/docs/DistrictsApi.md @@ -1,12 +1,13 @@ # Clever::DistrictsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_district**](DistrictsApi.md#get_district) | **GET** /districts/{id} | [**get_districts**](DistrictsApi.md#get_districts) | **GET** /districts | + # **get_district** > DistrictResponse get_district(id) @@ -25,6 +26,7 @@ Clever.configure do |config| end api_instance = Clever::DistrictsApi.new + id = 'id_example' # String | @@ -75,6 +77,7 @@ Clever.configure do |config| end api_instance = Clever::DistrictsApi.new + opts = { count: 'count_example' # String | } diff --git a/docs/DistrictsCreated.md b/docs/DistrictsCreated.md index 61067725..0c51b3cd 100644 --- a/docs/DistrictsCreated.md +++ b/docs/DistrictsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**DistrictObject**](DistrictObject.md) | | [optional] + diff --git a/docs/DistrictsDeleted.md b/docs/DistrictsDeleted.md index f012f58d..e567cbd7 100644 --- a/docs/DistrictsDeleted.md +++ b/docs/DistrictsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**DistrictObject**](DistrictObject.md) | | [optional] + diff --git a/docs/DistrictsResponse.md b/docs/DistrictsResponse.md index d7b33806..b4002067 100644 --- a/docs/DistrictsResponse.md +++ b/docs/DistrictsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<DistrictResponse>**](DistrictResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/DistrictsUpdated.md b/docs/DistrictsUpdated.md index 0973c46e..3efa6c23 100644 --- a/docs/DistrictsUpdated.md +++ b/docs/DistrictsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**DistrictObject**](DistrictObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/Event.md b/docs/Event.md index a1f0e9cd..127c7fe7 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes **id** | **String** | | [optional] **created** | **String** | | [optional] + diff --git a/docs/EventResponse.md b/docs/EventResponse.md index 877ff74a..54b4541a 100644 --- a/docs/EventResponse.md +++ b/docs/EventResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Event**](Event.md) | | [optional] + diff --git a/docs/EventsApi.md b/docs/EventsApi.md index 99433495..5091e8ad 100644 --- a/docs/EventsApi.md +++ b/docs/EventsApi.md @@ -1,12 +1,13 @@ # Clever::EventsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- [**get_event**](EventsApi.md#get_event) | **GET** /events/{id} | [**get_events**](EventsApi.md#get_events) | **GET** /events | + # **get_event** > EventResponse get_event(id) @@ -25,6 +26,7 @@ Clever.configure do |config| end api_instance = Clever::EventsApi.new + id = 'id_example' # String | @@ -75,6 +77,7 @@ Clever.configure do |config| end api_instance = Clever::EventsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/EventsResponse.md b/docs/EventsResponse.md index 6e7b8ce2..059cbaec 100644 --- a/docs/EventsResponse.md +++ b/docs/EventsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<EventResponse>**](EventResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/InternalError.md b/docs/InternalError.md index 1d582b54..ddd9320e 100644 --- a/docs/InternalError.md +++ b/docs/InternalError.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **String** | | [optional] + diff --git a/docs/Link.md b/docs/Link.md index 86596c11..df6cdbaa 100644 --- a/docs/Link.md +++ b/docs/Link.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **rel** | **String** | | [optional] **uri** | **String** | | [optional] + diff --git a/docs/Location.md b/docs/Location.md index f045579a..af54d4ef 100644 --- a/docs/Location.md +++ b/docs/Location.md @@ -10,3 +10,4 @@ Name | Type | Description | Notes **lat** | **String** | | [optional] **lon** | **String** | | [optional] + diff --git a/docs/Name.md b/docs/Name.md index 0e2ac954..25a94bcd 100644 --- a/docs/Name.md +++ b/docs/Name.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes **middle** | **String** | | [optional] **last** | **String** | | [optional] + diff --git a/docs/NotFound.md b/docs/NotFound.md index 24f3a221..66375622 100644 --- a/docs/NotFound.md +++ b/docs/NotFound.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **String** | | [optional] + diff --git a/docs/Principal.md b/docs/Principal.md index 35907819..f799a5dd 100644 --- a/docs/Principal.md +++ b/docs/Principal.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **name** | **String** | | [optional] **email** | **String** | | [optional] + diff --git a/docs/School.md b/docs/School.md index a960d1d4..24eeeeb2 100644 --- a/docs/School.md +++ b/docs/School.md @@ -20,3 +20,4 @@ Name | Type | Description | Notes **mdr_number** | **String** | | [optional] **ext** | **Object** | | [optional] + diff --git a/docs/SchoolAdmin.md b/docs/SchoolAdmin.md index 67e41fa8..9deef624 100644 --- a/docs/SchoolAdmin.md +++ b/docs/SchoolAdmin.md @@ -14,3 +14,4 @@ Name | Type | Description | Notes **department** | **String** | | [optional] **ext** | **Object** | | [optional] + diff --git a/docs/SchoolAdminObject.md b/docs/SchoolAdminObject.md index 442f1745..b0c99b0b 100644 --- a/docs/SchoolAdminObject.md +++ b/docs/SchoolAdminObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**SchoolAdmin**](SchoolAdmin.md) | | [optional] + diff --git a/docs/SchoolAdminResponse.md b/docs/SchoolAdminResponse.md index e7af5818..17b6e86d 100644 --- a/docs/SchoolAdminResponse.md +++ b/docs/SchoolAdminResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**SchoolAdmin**](SchoolAdmin.md) | | [optional] + diff --git a/docs/SchoolAdminsApi.md b/docs/SchoolAdminsApi.md index 92ba55df..e511b37e 100644 --- a/docs/SchoolAdminsApi.md +++ b/docs/SchoolAdminsApi.md @@ -1,6 +1,6 @@ # Clever::SchoolAdminsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -9,6 +9,7 @@ Method | HTTP request | Description [**get_school_admins**](SchoolAdminsApi.md#get_school_admins) | **GET** /school_admins | [**get_schools_for_school_admin**](SchoolAdminsApi.md#get_schools_for_school_admin) | **GET** /school_admins/{id}/schools | + # **get_district_for_school_admin** > DistrictResponse get_district_for_school_admin(id) @@ -27,6 +28,7 @@ Clever.configure do |config| end api_instance = Clever::SchoolAdminsApi.new + id = 'id_example' # String | @@ -77,6 +79,7 @@ Clever.configure do |config| end api_instance = Clever::SchoolAdminsApi.new + id = 'id_example' # String | @@ -127,6 +130,7 @@ Clever.configure do |config| end api_instance = Clever::SchoolAdminsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -184,7 +188,9 @@ Clever.configure do |config| end api_instance = Clever::SchoolAdminsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/SchoolAdminsResponse.md b/docs/SchoolAdminsResponse.md index b0445775..3d7aeda7 100644 --- a/docs/SchoolAdminsResponse.md +++ b/docs/SchoolAdminsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<SchoolAdminResponse>**](SchoolAdminResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/SchoolEnrollment.md b/docs/SchoolEnrollment.md index eb359e7c..c1c1a1d3 100644 --- a/docs/SchoolEnrollment.md +++ b/docs/SchoolEnrollment.md @@ -7,3 +7,4 @@ Name | Type | Description | Notes **start_date** | **String** | | [optional] **end_date** | **String** | | [optional] + diff --git a/docs/SchoolObject.md b/docs/SchoolObject.md index dd09a904..d9e08f7f 100644 --- a/docs/SchoolObject.md +++ b/docs/SchoolObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**School**](School.md) | | [optional] + diff --git a/docs/SchoolResponse.md b/docs/SchoolResponse.md index 1be26017..b22abbb1 100644 --- a/docs/SchoolResponse.md +++ b/docs/SchoolResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**School**](School.md) | | [optional] + diff --git a/docs/SchooladminsCreated.md b/docs/SchooladminsCreated.md index 0dcb73aa..6d968746 100644 --- a/docs/SchooladminsCreated.md +++ b/docs/SchooladminsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**SchoolAdminObject**](SchoolAdminObject.md) | | [optional] + diff --git a/docs/SchooladminsDeleted.md b/docs/SchooladminsDeleted.md index 60e57757..6f890f35 100644 --- a/docs/SchooladminsDeleted.md +++ b/docs/SchooladminsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**SchoolAdminObject**](SchoolAdminObject.md) | | [optional] + diff --git a/docs/SchooladminsUpdated.md b/docs/SchooladminsUpdated.md index ccbd282e..c5b54d03 100644 --- a/docs/SchooladminsUpdated.md +++ b/docs/SchooladminsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**SchoolAdminObject**](SchoolAdminObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/SchoolsApi.md b/docs/SchoolsApi.md index d8a99c0c..0f403eb2 100644 --- a/docs/SchoolsApi.md +++ b/docs/SchoolsApi.md @@ -1,6 +1,6 @@ # Clever::SchoolsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -11,6 +11,7 @@ Method | HTTP request | Description [**get_students_for_school**](SchoolsApi.md#get_students_for_school) | **GET** /schools/{id}/students | [**get_teachers_for_school**](SchoolsApi.md#get_teachers_for_school) | **GET** /schools/{id}/teachers | + # **get_district_for_school** > DistrictResponse get_district_for_school(id) @@ -29,6 +30,7 @@ Clever.configure do |config| end api_instance = Clever::SchoolsApi.new + id = 'id_example' # String | @@ -79,6 +81,7 @@ Clever.configure do |config| end api_instance = Clever::SchoolsApi.new + id = 'id_example' # String | @@ -129,6 +132,7 @@ Clever.configure do |config| end api_instance = Clever::SchoolsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -186,7 +190,9 @@ Clever.configure do |config| end api_instance = Clever::SchoolsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -243,7 +249,9 @@ Clever.configure do |config| end api_instance = Clever::SchoolsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -300,7 +308,9 @@ Clever.configure do |config| end api_instance = Clever::SchoolsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/SchoolsCreated.md b/docs/SchoolsCreated.md index 83bf06e2..41e0c644 100644 --- a/docs/SchoolsCreated.md +++ b/docs/SchoolsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**SchoolObject**](SchoolObject.md) | | [optional] + diff --git a/docs/SchoolsDeleted.md b/docs/SchoolsDeleted.md index ea86d4b2..e9f5bdac 100644 --- a/docs/SchoolsDeleted.md +++ b/docs/SchoolsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**SchoolObject**](SchoolObject.md) | | [optional] + diff --git a/docs/SchoolsResponse.md b/docs/SchoolsResponse.md index c59125f1..ae016246 100644 --- a/docs/SchoolsResponse.md +++ b/docs/SchoolsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<SchoolResponse>**](SchoolResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/SchoolsUpdated.md b/docs/SchoolsUpdated.md index 75ba8975..5adad0dc 100644 --- a/docs/SchoolsUpdated.md +++ b/docs/SchoolsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**SchoolObject**](SchoolObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/Section.md b/docs/Section.md index fa630828..aa19e1e0 100644 --- a/docs/Section.md +++ b/docs/Section.md @@ -21,3 +21,4 @@ Name | Type | Description | Notes **term_id** | **String** | | [optional] **ext** | **Object** | | [optional] + diff --git a/docs/SectionObject.md b/docs/SectionObject.md index d2bca382..9907279a 100644 --- a/docs/SectionObject.md +++ b/docs/SectionObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**Section**](Section.md) | | [optional] + diff --git a/docs/SectionResponse.md b/docs/SectionResponse.md index 1859c6da..02f7a230 100644 --- a/docs/SectionResponse.md +++ b/docs/SectionResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Section**](Section.md) | | [optional] + diff --git a/docs/SectionsApi.md b/docs/SectionsApi.md index 5008f2be..9578f324 100644 --- a/docs/SectionsApi.md +++ b/docs/SectionsApi.md @@ -1,6 +1,6 @@ # Clever::SectionsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -14,6 +14,7 @@ Method | HTTP request | Description [**get_teachers_for_section**](SectionsApi.md#get_teachers_for_section) | **GET** /sections/{id}/teachers | [**get_term_for_section**](SectionsApi.md#get_term_for_section) | **GET** /sections/{id}/term | + # **get_course_for_section** > CourseResponse get_course_for_section(id) @@ -32,6 +33,7 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | @@ -82,6 +84,7 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | @@ -132,6 +135,7 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | @@ -182,6 +186,7 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | @@ -232,6 +237,7 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -289,7 +295,9 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -346,6 +354,7 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | @@ -396,7 +405,9 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -453,6 +464,7 @@ Clever.configure do |config| end api_instance = Clever::SectionsApi.new + id = 'id_example' # String | diff --git a/docs/SectionsCreated.md b/docs/SectionsCreated.md index 47f7b790..23890692 100644 --- a/docs/SectionsCreated.md +++ b/docs/SectionsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**SectionObject**](SectionObject.md) | | [optional] + diff --git a/docs/SectionsDeleted.md b/docs/SectionsDeleted.md index 3ee8a258..bebf5b0a 100644 --- a/docs/SectionsDeleted.md +++ b/docs/SectionsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**SectionObject**](SectionObject.md) | | [optional] + diff --git a/docs/SectionsResponse.md b/docs/SectionsResponse.md index 72bd772a..e6cae893 100644 --- a/docs/SectionsResponse.md +++ b/docs/SectionsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<SectionResponse>**](SectionResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/SectionsUpdated.md b/docs/SectionsUpdated.md index dc684d6a..f44200af 100644 --- a/docs/SectionsUpdated.md +++ b/docs/SectionsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**SectionObject**](SectionObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/Student.md b/docs/Student.md index e7a66cb8..5989e61b 100644 --- a/docs/Student.md +++ b/docs/Student.md @@ -30,3 +30,4 @@ Name | Type | Description | Notes **weighted_gpa** | **String** | | [optional] **ext** | **Object** | | [optional] + diff --git a/docs/StudentObject.md b/docs/StudentObject.md index fbfd43ad..e13f468c 100644 --- a/docs/StudentObject.md +++ b/docs/StudentObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**Student**](Student.md) | | [optional] + diff --git a/docs/StudentResponse.md b/docs/StudentResponse.md index aa8cf7b0..8a59ccff 100644 --- a/docs/StudentResponse.md +++ b/docs/StudentResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Student**](Student.md) | | [optional] + diff --git a/docs/StudentsApi.md b/docs/StudentsApi.md index 79cae967..4f5eb8d1 100644 --- a/docs/StudentsApi.md +++ b/docs/StudentsApi.md @@ -1,6 +1,6 @@ # Clever::StudentsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -13,6 +13,7 @@ Method | HTTP request | Description [**get_students**](StudentsApi.md#get_students) | **GET** /students | [**get_teachers_for_student**](StudentsApi.md#get_teachers_for_student) | **GET** /students/{id}/teachers | + # **get_contacts_for_student** > ContactsResponse get_contacts_for_student(id, opts) @@ -31,7 +32,9 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -88,6 +91,7 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + id = 'id_example' # String | @@ -138,6 +142,7 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + id = 'id_example' # String | @@ -188,7 +193,9 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -245,7 +252,9 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -302,6 +311,7 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + id = 'id_example' # String | @@ -352,6 +362,7 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -409,7 +420,9 @@ Clever.configure do |config| end api_instance = Clever::StudentsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/StudentsCreated.md b/docs/StudentsCreated.md index 82ecd327..59105d1d 100644 --- a/docs/StudentsCreated.md +++ b/docs/StudentsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**StudentObject**](StudentObject.md) | | [optional] + diff --git a/docs/StudentsDeleted.md b/docs/StudentsDeleted.md index 412950fa..27e9eb12 100644 --- a/docs/StudentsDeleted.md +++ b/docs/StudentsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**StudentObject**](StudentObject.md) | | [optional] + diff --git a/docs/StudentsResponse.md b/docs/StudentsResponse.md index d66d3bec..6ea2f628 100644 --- a/docs/StudentsResponse.md +++ b/docs/StudentsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<StudentResponse>**](StudentResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/StudentsUpdated.md b/docs/StudentsUpdated.md index cb0a10d4..36d98eaf 100644 --- a/docs/StudentsUpdated.md +++ b/docs/StudentsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**StudentObject**](StudentObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/Teacher.md b/docs/Teacher.md index 7467efb9..a9e7f9dc 100644 --- a/docs/Teacher.md +++ b/docs/Teacher.md @@ -18,3 +18,4 @@ Name | Type | Description | Notes **title** | **String** | | [optional] **ext** | **Object** | | [optional] + diff --git a/docs/TeacherObject.md b/docs/TeacherObject.md index 9f39eea7..df03b48a 100644 --- a/docs/TeacherObject.md +++ b/docs/TeacherObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**Teacher**](Teacher.md) | | [optional] + diff --git a/docs/TeacherResponse.md b/docs/TeacherResponse.md index b95853e9..21843d0b 100644 --- a/docs/TeacherResponse.md +++ b/docs/TeacherResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Teacher**](Teacher.md) | | [optional] + diff --git a/docs/TeachersApi.md b/docs/TeachersApi.md index 3b526786..d56c5bbe 100644 --- a/docs/TeachersApi.md +++ b/docs/TeachersApi.md @@ -1,6 +1,6 @@ # Clever::TeachersApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -12,6 +12,7 @@ Method | HTTP request | Description [**get_teacher**](TeachersApi.md#get_teacher) | **GET** /teachers/{id} | [**get_teachers**](TeachersApi.md#get_teachers) | **GET** /teachers | + # **get_district_for_teacher** > DistrictResponse get_district_for_teacher(id) @@ -30,6 +31,7 @@ Clever.configure do |config| end api_instance = Clever::TeachersApi.new + id = 'id_example' # String | @@ -80,6 +82,7 @@ Clever.configure do |config| end api_instance = Clever::TeachersApi.new + id = 'id_example' # String | @@ -130,7 +133,9 @@ Clever.configure do |config| end api_instance = Clever::TeachersApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -187,7 +192,9 @@ Clever.configure do |config| end api_instance = Clever::TeachersApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -244,7 +251,9 @@ Clever.configure do |config| end api_instance = Clever::TeachersApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -301,6 +310,7 @@ Clever.configure do |config| end api_instance = Clever::TeachersApi.new + id = 'id_example' # String | @@ -351,6 +361,7 @@ Clever.configure do |config| end api_instance = Clever::TeachersApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/TeachersCreated.md b/docs/TeachersCreated.md index 3f0ae274..7592005c 100644 --- a/docs/TeachersCreated.md +++ b/docs/TeachersCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**TeacherObject**](TeacherObject.md) | | [optional] + diff --git a/docs/TeachersDeleted.md b/docs/TeachersDeleted.md index d9504f5d..288ff952 100644 --- a/docs/TeachersDeleted.md +++ b/docs/TeachersDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**TeacherObject**](TeacherObject.md) | | [optional] + diff --git a/docs/TeachersResponse.md b/docs/TeachersResponse.md index a912a5d0..ed97d5e9 100644 --- a/docs/TeachersResponse.md +++ b/docs/TeachersResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<TeacherResponse>**](TeacherResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/TeachersUpdated.md b/docs/TeachersUpdated.md index 2c27cb30..a813e545 100644 --- a/docs/TeachersUpdated.md +++ b/docs/TeachersUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**TeacherObject**](TeacherObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/docs/Term.md b/docs/Term.md index 01ea786f..2bf50f65 100644 --- a/docs/Term.md +++ b/docs/Term.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **end_date** | **String** | | [optional] **district** | **String** | | [optional] + diff --git a/docs/TermObject.md b/docs/TermObject.md index 70f7f210..47c355bd 100644 --- a/docs/TermObject.md +++ b/docs/TermObject.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **object** | [**Term**](Term.md) | | [optional] + diff --git a/docs/TermResponse.md b/docs/TermResponse.md index 9b8c50ec..29c18861 100644 --- a/docs/TermResponse.md +++ b/docs/TermResponse.md @@ -5,3 +5,4 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**Term**](Term.md) | | [optional] + diff --git a/docs/TermsApi.md b/docs/TermsApi.md index 0d9cc78f..1e988b34 100644 --- a/docs/TermsApi.md +++ b/docs/TermsApi.md @@ -1,6 +1,6 @@ # Clever::TermsApi -All URIs are relative to *https://api.clever.com/* +All URIs are relative to *https://api.clever.com* Method | HTTP request | Description ------------- | ------------- | ------------- @@ -9,6 +9,7 @@ Method | HTTP request | Description [**get_term**](TermsApi.md#get_term) | **GET** /terms/{id} | [**get_terms**](TermsApi.md#get_terms) | **GET** /terms | + # **get_district_for_term** > DistrictResponse get_district_for_term(id) @@ -27,6 +28,7 @@ Clever.configure do |config| end api_instance = Clever::TermsApi.new + id = 'id_example' # String | @@ -77,7 +79,9 @@ Clever.configure do |config| end api_instance = Clever::TermsApi.new + id = 'id_example' # String | + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | @@ -134,6 +138,7 @@ Clever.configure do |config| end api_instance = Clever::TermsApi.new + id = 'id_example' # String | @@ -184,6 +189,7 @@ Clever.configure do |config| end api_instance = Clever::TermsApi.new + opts = { limit: 56, # Integer | starting_after: 'starting_after_example', # String | diff --git a/docs/TermsCreated.md b/docs/TermsCreated.md index 73fab704..67959998 100644 --- a/docs/TermsCreated.md +++ b/docs/TermsCreated.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**TermObject**](TermObject.md) | | [optional] + diff --git a/docs/TermsDeleted.md b/docs/TermsDeleted.md index 3a940a86..c20b41f0 100644 --- a/docs/TermsDeleted.md +++ b/docs/TermsDeleted.md @@ -8,3 +8,4 @@ Name | Type | Description | Notes **created** | **String** | | [optional] **data** | [**TermObject**](TermObject.md) | | [optional] + diff --git a/docs/TermsResponse.md b/docs/TermsResponse.md index 3f33482c..4c7004c6 100644 --- a/docs/TermsResponse.md +++ b/docs/TermsResponse.md @@ -6,3 +6,4 @@ Name | Type | Description | Notes **data** | [**Array<TermResponse>**](TermResponse.md) | | [optional] **links** | [**Array<Link>**](Link.md) | | [optional] + diff --git a/docs/TermsUpdated.md b/docs/TermsUpdated.md index ddc3b67b..6cd597b2 100644 --- a/docs/TermsUpdated.md +++ b/docs/TermsUpdated.md @@ -9,3 +9,4 @@ Name | Type | Description | Notes **data** | [**TermObject**](TermObject.md) | | [optional] **previous_attributes** | **Object** | | [optional] + diff --git a/lib/clever-ruby.rb b/lib/clever-ruby.rb index 12233cc6..baac8434 100644 --- a/lib/clever-ruby.rb +++ b/lib/clever-ruby.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end # Common files diff --git a/lib/clever-ruby/api/contacts_api.rb b/lib/clever-ruby/api/contacts_api.rb index 277f0289..b53210fe 100644 --- a/lib/clever-ruby/api/contacts_api.rb +++ b/lib/clever-ruby/api/contacts_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class ContactsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_contact(id, opts = {}) # Returns a specific student contact # @param id # @param [Hash] opts the optional parameters - # @return [Array<(ContactResponse, Integer, Hash)>] ContactResponse data, response status code and response headers + # @return [Array<(ContactResponse, Fixnum, Hash)>] ContactResponse data, response status code and response headers def get_contact_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contact ...' @@ -41,30 +44,26 @@ def get_contact_with_http_info(id, opts = {}) local_var_path = '/contacts/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'ContactResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'ContactResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -88,7 +87,7 @@ def get_contacts(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(ContactsResponse, Integer, Hash)>] ContactsResponse data, response status code and response headers + # @return [Array<(ContactsResponse, Fixnum, Hash)>] ContactsResponse data, response status code and response headers def get_contacts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_contacts ...' @@ -100,34 +99,30 @@ def get_contacts_with_http_info(opts = {}) local_var_path = '/contacts' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'ContactsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'ContactsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_contacts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -145,7 +140,7 @@ def get_district_for_contact(id, opts = {}) # Returns the district for a student contact # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_contact_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_district_for_contact ...' @@ -158,30 +153,26 @@ def get_district_for_contact_with_http_info(id, opts = {}) local_var_path = '/contacts/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_district_for_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -205,7 +196,7 @@ def get_students_for_contact(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(StudentsResponse, Integer, Hash)>] StudentsResponse data, response status code and response headers + # @return [Array<(StudentsResponse, Fixnum, Hash)>] StudentsResponse data, response status code and response headers def get_students_for_contact_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContactsApi.get_students_for_contact ...' @@ -218,33 +209,29 @@ def get_students_for_contact_with_http_info(id, opts = {}) local_var_path = '/contacts/{id}/students'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'StudentsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'StudentsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: ContactsApi#get_students_for_contact\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/courses_api.rb b/lib/clever-ruby/api/courses_api.rb index 3e9d2e25..8097e8bf 100644 --- a/lib/clever-ruby/api/courses_api.rb +++ b/lib/clever-ruby/api/courses_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class CoursesApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_course(id, opts = {}) # Returns a specific course # @param id # @param [Hash] opts the optional parameters - # @return [Array<(CourseResponse, Integer, Hash)>] CourseResponse data, response status code and response headers + # @return [Array<(CourseResponse, Fixnum, Hash)>] CourseResponse data, response status code and response headers def get_course_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CoursesApi.get_course ...' @@ -41,30 +44,26 @@ def get_course_with_http_info(id, opts = {}) local_var_path = '/courses/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'CourseResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'CourseResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CoursesApi#get_course\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -88,7 +87,7 @@ def get_courses(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(CoursesResponse, Integer, Hash)>] CoursesResponse data, response status code and response headers + # @return [Array<(CoursesResponse, Fixnum, Hash)>] CoursesResponse data, response status code and response headers def get_courses_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CoursesApi.get_courses ...' @@ -100,34 +99,30 @@ def get_courses_with_http_info(opts = {}) local_var_path = '/courses' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'CoursesResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'CoursesResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CoursesApi#get_courses\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -145,7 +140,7 @@ def get_district_for_course(id, opts = {}) # Returns the district for a course # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_course_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CoursesApi.get_district_for_course ...' @@ -158,30 +153,26 @@ def get_district_for_course_with_http_info(id, opts = {}) local_var_path = '/courses/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CoursesApi#get_district_for_course\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -205,7 +196,7 @@ def get_sections_for_course(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SectionsResponse, Integer, Hash)>] SectionsResponse data, response status code and response headers + # @return [Array<(SectionsResponse, Fixnum, Hash)>] SectionsResponse data, response status code and response headers def get_sections_for_course_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: CoursesApi.get_sections_for_course ...' @@ -218,33 +209,29 @@ def get_sections_for_course_with_http_info(id, opts = {}) local_var_path = '/courses/{id}/sections'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SectionsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SectionsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: CoursesApi#get_sections_for_course\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/district_admins_api.rb b/lib/clever-ruby/api/district_admins_api.rb index 49493a61..86145a7d 100644 --- a/lib/clever-ruby/api/district_admins_api.rb +++ b/lib/clever-ruby/api/district_admins_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class DistrictAdminsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_district_admin(id, opts = {}) # Returns a specific district admin # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictAdminResponse, Integer, Hash)>] DistrictAdminResponse data, response status code and response headers + # @return [Array<(DistrictAdminResponse, Fixnum, Hash)>] DistrictAdminResponse data, response status code and response headers def get_district_admin_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DistrictAdminsApi.get_district_admin ...' @@ -41,30 +44,26 @@ def get_district_admin_with_http_info(id, opts = {}) local_var_path = '/district_admins/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictAdminResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictAdminResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DistrictAdminsApi#get_district_admin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -88,7 +87,7 @@ def get_district_admins(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(DistrictAdminsResponse, Integer, Hash)>] DistrictAdminsResponse data, response status code and response headers + # @return [Array<(DistrictAdminsResponse, Fixnum, Hash)>] DistrictAdminsResponse data, response status code and response headers def get_district_admins_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DistrictAdminsApi.get_district_admins ...' @@ -100,34 +99,30 @@ def get_district_admins_with_http_info(opts = {}) local_var_path = '/district_admins' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictAdminsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictAdminsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DistrictAdminsApi#get_district_admins\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -145,7 +140,7 @@ def get_district_for_district_admin(id, opts = {}) # Returns the district for a district admin # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_district_admin_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DistrictAdminsApi.get_district_for_district_admin ...' @@ -158,30 +153,26 @@ def get_district_for_district_admin_with_http_info(id, opts = {}) local_var_path = '/district_admins/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DistrictAdminsApi#get_district_for_district_admin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/districts_api.rb b/lib/clever-ruby/api/districts_api.rb index 3db65863..a391cf41 100644 --- a/lib/clever-ruby/api/districts_api.rb +++ b/lib/clever-ruby/api/districts_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class DistrictsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_district(id, opts = {}) # Returns a specific district # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DistrictsApi.get_district ...' @@ -41,30 +44,26 @@ def get_district_with_http_info(id, opts = {}) local_var_path = '/districts/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DistrictsApi#get_district\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -82,7 +81,7 @@ def get_districts(opts = {}) # Returns a list of districts. In practice this will only return the one district associated with the bearer token # @param [Hash] opts the optional parameters # @option opts [String] :count - # @return [Array<(DistrictsResponse, Integer, Hash)>] DistrictsResponse data, response status code and response headers + # @return [Array<(DistrictsResponse, Fixnum, Hash)>] DistrictsResponse data, response status code and response headers def get_districts_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: DistrictsApi.get_districts ...' @@ -94,31 +93,27 @@ def get_districts_with_http_info(opts = {}) local_var_path = '/districts' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: DistrictsApi#get_districts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/events_api.rb b/lib/clever-ruby/api/events_api.rb index 4ff3d15c..691129fc 100644 --- a/lib/clever-ruby/api/events_api.rb +++ b/lib/clever-ruby/api/events_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class EventsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_event(id, opts = {}) # Returns the specific event # @param id # @param [Hash] opts the optional parameters - # @return [Array<(EventResponse, Integer, Hash)>] EventResponse data, response status code and response headers + # @return [Array<(EventResponse, Fixnum, Hash)>] EventResponse data, response status code and response headers def get_event_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventsApi.get_event ...' @@ -41,30 +44,26 @@ def get_event_with_http_info(id, opts = {}) local_var_path = '/events/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'EventResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'EventResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: EventsApi#get_event\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -90,7 +89,7 @@ def get_events(opts = {}) # @option opts [String] :ending_before # @option opts [String] :school # @option opts [Array] :record_type - # @return [Array<(EventsResponse, Integer, Hash)>] EventsResponse data, response status code and response headers + # @return [Array<(EventsResponse, Fixnum, Hash)>] EventsResponse data, response status code and response headers def get_events_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: EventsApi.get_events ...' @@ -99,7 +98,7 @@ def get_events_with_http_info(opts = {}) local_var_path = '/events' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? @@ -107,27 +106,23 @@ def get_events_with_http_info(opts = {}) query_params[:'record_type'] = @api_client.build_collection_param(opts[:'record_type'], :multi) if !opts[:'record_type'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'EventsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'EventsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: EventsApi#get_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/school_admins_api.rb b/lib/clever-ruby/api/school_admins_api.rb index b1dba1eb..e282f60f 100644 --- a/lib/clever-ruby/api/school_admins_api.rb +++ b/lib/clever-ruby/api/school_admins_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class SchoolAdminsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_district_for_school_admin(id, opts = {}) # Returns the district for a school admin # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_school_admin_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolAdminsApi.get_district_for_school_admin ...' @@ -41,30 +44,26 @@ def get_district_for_school_admin_with_http_info(id, opts = {}) local_var_path = '/school_admins/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolAdminsApi#get_district_for_school_admin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -82,7 +81,7 @@ def get_school_admin(id, opts = {}) # Returns a specific school admin # @param id # @param [Hash] opts the optional parameters - # @return [Array<(SchoolAdminResponse, Integer, Hash)>] SchoolAdminResponse data, response status code and response headers + # @return [Array<(SchoolAdminResponse, Fixnum, Hash)>] SchoolAdminResponse data, response status code and response headers def get_school_admin_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolAdminsApi.get_school_admin ...' @@ -95,30 +94,26 @@ def get_school_admin_with_http_info(id, opts = {}) local_var_path = '/school_admins/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolAdminResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolAdminResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolAdminsApi#get_school_admin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -142,7 +137,7 @@ def get_school_admins(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(SchoolAdminsResponse, Integer, Hash)>] SchoolAdminsResponse data, response status code and response headers + # @return [Array<(SchoolAdminsResponse, Fixnum, Hash)>] SchoolAdminsResponse data, response status code and response headers def get_school_admins_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolAdminsApi.get_school_admins ...' @@ -154,34 +149,30 @@ def get_school_admins_with_http_info(opts = {}) local_var_path = '/school_admins' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolAdminsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolAdminsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolAdminsApi#get_school_admins\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -205,7 +196,7 @@ def get_schools_for_school_admin(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SchoolsResponse, Integer, Hash)>] SchoolsResponse data, response status code and response headers + # @return [Array<(SchoolsResponse, Fixnum, Hash)>] SchoolsResponse data, response status code and response headers def get_schools_for_school_admin_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolAdminsApi.get_schools_for_school_admin ...' @@ -218,33 +209,29 @@ def get_schools_for_school_admin_with_http_info(id, opts = {}) local_var_path = '/school_admins/{id}/schools'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolAdminsApi#get_schools_for_school_admin\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/schools_api.rb b/lib/clever-ruby/api/schools_api.rb index 9557d57a..0c98cfd4 100644 --- a/lib/clever-ruby/api/schools_api.rb +++ b/lib/clever-ruby/api/schools_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class SchoolsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_district_for_school(id, opts = {}) # Returns the district for a school # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_school_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolsApi.get_district_for_school ...' @@ -41,30 +44,26 @@ def get_district_for_school_with_http_info(id, opts = {}) local_var_path = '/schools/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolsApi#get_district_for_school\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -82,7 +81,7 @@ def get_school(id, opts = {}) # Returns a specific school # @param id # @param [Hash] opts the optional parameters - # @return [Array<(SchoolResponse, Integer, Hash)>] SchoolResponse data, response status code and response headers + # @return [Array<(SchoolResponse, Fixnum, Hash)>] SchoolResponse data, response status code and response headers def get_school_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolsApi.get_school ...' @@ -95,30 +94,26 @@ def get_school_with_http_info(id, opts = {}) local_var_path = '/schools/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolsApi#get_school\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -142,7 +137,7 @@ def get_schools(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(SchoolsResponse, Integer, Hash)>] SchoolsResponse data, response status code and response headers + # @return [Array<(SchoolsResponse, Fixnum, Hash)>] SchoolsResponse data, response status code and response headers def get_schools_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolsApi.get_schools ...' @@ -154,34 +149,30 @@ def get_schools_with_http_info(opts = {}) local_var_path = '/schools' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolsApi#get_schools\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -205,7 +196,7 @@ def get_sections_for_school(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SectionsResponse, Integer, Hash)>] SectionsResponse data, response status code and response headers + # @return [Array<(SectionsResponse, Fixnum, Hash)>] SectionsResponse data, response status code and response headers def get_sections_for_school_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolsApi.get_sections_for_school ...' @@ -218,33 +209,29 @@ def get_sections_for_school_with_http_info(id, opts = {}) local_var_path = '/schools/{id}/sections'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SectionsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SectionsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolsApi#get_sections_for_school\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -268,7 +255,7 @@ def get_students_for_school(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(StudentsResponse, Integer, Hash)>] StudentsResponse data, response status code and response headers + # @return [Array<(StudentsResponse, Fixnum, Hash)>] StudentsResponse data, response status code and response headers def get_students_for_school_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolsApi.get_students_for_school ...' @@ -281,33 +268,29 @@ def get_students_for_school_with_http_info(id, opts = {}) local_var_path = '/schools/{id}/students'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'StudentsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'StudentsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolsApi#get_students_for_school\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -331,7 +314,7 @@ def get_teachers_for_school(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(TeachersResponse, Integer, Hash)>] TeachersResponse data, response status code and response headers + # @return [Array<(TeachersResponse, Fixnum, Hash)>] TeachersResponse data, response status code and response headers def get_teachers_for_school_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SchoolsApi.get_teachers_for_school ...' @@ -344,33 +327,29 @@ def get_teachers_for_school_with_http_info(id, opts = {}) local_var_path = '/schools/{id}/teachers'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TeachersResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TeachersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SchoolsApi#get_teachers_for_school\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/sections_api.rb b/lib/clever-ruby/api/sections_api.rb index 4d1f5a50..7c98e83d 100644 --- a/lib/clever-ruby/api/sections_api.rb +++ b/lib/clever-ruby/api/sections_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class SectionsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_course_for_section(id, opts = {}) # Returns the course for a section # @param id # @param [Hash] opts the optional parameters - # @return [Array<(CourseResponse, Integer, Hash)>] CourseResponse data, response status code and response headers + # @return [Array<(CourseResponse, Fixnum, Hash)>] CourseResponse data, response status code and response headers def get_course_for_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_course_for_section ...' @@ -41,30 +44,26 @@ def get_course_for_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}/course'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'CourseResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'CourseResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_course_for_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -82,7 +81,7 @@ def get_district_for_section(id, opts = {}) # Returns the district for a section # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_district_for_section ...' @@ -95,30 +94,26 @@ def get_district_for_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_district_for_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -136,7 +131,7 @@ def get_school_for_section(id, opts = {}) # Returns the school for a section # @param id # @param [Hash] opts the optional parameters - # @return [Array<(SchoolResponse, Integer, Hash)>] SchoolResponse data, response status code and response headers + # @return [Array<(SchoolResponse, Fixnum, Hash)>] SchoolResponse data, response status code and response headers def get_school_for_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_school_for_section ...' @@ -149,30 +144,26 @@ def get_school_for_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}/school'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_school_for_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -190,7 +181,7 @@ def get_section(id, opts = {}) # Returns a specific section # @param id # @param [Hash] opts the optional parameters - # @return [Array<(SectionResponse, Integer, Hash)>] SectionResponse data, response status code and response headers + # @return [Array<(SectionResponse, Fixnum, Hash)>] SectionResponse data, response status code and response headers def get_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_section ...' @@ -203,30 +194,26 @@ def get_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SectionResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SectionResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -250,7 +237,7 @@ def get_sections(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(SectionsResponse, Integer, Hash)>] SectionsResponse data, response status code and response headers + # @return [Array<(SectionsResponse, Fixnum, Hash)>] SectionsResponse data, response status code and response headers def get_sections_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_sections ...' @@ -262,34 +249,30 @@ def get_sections_with_http_info(opts = {}) local_var_path = '/sections' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SectionsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SectionsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_sections\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -313,7 +296,7 @@ def get_students_for_section(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(StudentsResponse, Integer, Hash)>] StudentsResponse data, response status code and response headers + # @return [Array<(StudentsResponse, Fixnum, Hash)>] StudentsResponse data, response status code and response headers def get_students_for_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_students_for_section ...' @@ -326,33 +309,29 @@ def get_students_for_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}/students'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'StudentsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'StudentsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_students_for_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -370,7 +349,7 @@ def get_teacher_for_section(id, opts = {}) # Returns the primary teacher for a section # @param id # @param [Hash] opts the optional parameters - # @return [Array<(TeacherResponse, Integer, Hash)>] TeacherResponse data, response status code and response headers + # @return [Array<(TeacherResponse, Fixnum, Hash)>] TeacherResponse data, response status code and response headers def get_teacher_for_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_teacher_for_section ...' @@ -383,30 +362,26 @@ def get_teacher_for_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}/teacher'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TeacherResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TeacherResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_teacher_for_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -430,7 +405,7 @@ def get_teachers_for_section(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(TeachersResponse, Integer, Hash)>] TeachersResponse data, response status code and response headers + # @return [Array<(TeachersResponse, Fixnum, Hash)>] TeachersResponse data, response status code and response headers def get_teachers_for_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_teachers_for_section ...' @@ -443,33 +418,29 @@ def get_teachers_for_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}/teachers'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TeachersResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TeachersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_teachers_for_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -487,7 +458,7 @@ def get_term_for_section(id, opts = {}) # Returns the term for a section # @param id # @param [Hash] opts the optional parameters - # @return [Array<(TermResponse, Integer, Hash)>] TermResponse data, response status code and response headers + # @return [Array<(TermResponse, Fixnum, Hash)>] TermResponse data, response status code and response headers def get_term_for_section_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: SectionsApi.get_term_for_section ...' @@ -500,30 +471,26 @@ def get_term_for_section_with_http_info(id, opts = {}) local_var_path = '/sections/{id}/term'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TermResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TermResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: SectionsApi#get_term_for_section\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/students_api.rb b/lib/clever-ruby/api/students_api.rb index dc50b5cc..0b86c111 100644 --- a/lib/clever-ruby/api/students_api.rb +++ b/lib/clever-ruby/api/students_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class StudentsApi attr_accessor :api_client @@ -34,7 +37,7 @@ def get_contacts_for_student(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(ContactsResponse, Integer, Hash)>] ContactsResponse data, response status code and response headers + # @return [Array<(ContactsResponse, Fixnum, Hash)>] ContactsResponse data, response status code and response headers def get_contacts_for_student_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_contacts_for_student ...' @@ -47,33 +50,29 @@ def get_contacts_for_student_with_http_info(id, opts = {}) local_var_path = '/students/{id}/contacts'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'ContactsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'ContactsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_contacts_for_student\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -91,7 +90,7 @@ def get_district_for_student(id, opts = {}) # Returns the district for a student # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_student_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_district_for_student ...' @@ -104,30 +103,26 @@ def get_district_for_student_with_http_info(id, opts = {}) local_var_path = '/students/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_district_for_student\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -145,7 +140,7 @@ def get_school_for_student(id, opts = {}) # Returns the primary school for a student # @param id # @param [Hash] opts the optional parameters - # @return [Array<(SchoolResponse, Integer, Hash)>] SchoolResponse data, response status code and response headers + # @return [Array<(SchoolResponse, Fixnum, Hash)>] SchoolResponse data, response status code and response headers def get_school_for_student_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_school_for_student ...' @@ -158,30 +153,26 @@ def get_school_for_student_with_http_info(id, opts = {}) local_var_path = '/students/{id}/school'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_school_for_student\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -205,7 +196,7 @@ def get_schools_for_student(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SchoolsResponse, Integer, Hash)>] SchoolsResponse data, response status code and response headers + # @return [Array<(SchoolsResponse, Fixnum, Hash)>] SchoolsResponse data, response status code and response headers def get_schools_for_student_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_schools_for_student ...' @@ -218,33 +209,29 @@ def get_schools_for_student_with_http_info(id, opts = {}) local_var_path = '/students/{id}/schools'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_schools_for_student\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -268,7 +255,7 @@ def get_sections_for_student(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SectionsResponse, Integer, Hash)>] SectionsResponse data, response status code and response headers + # @return [Array<(SectionsResponse, Fixnum, Hash)>] SectionsResponse data, response status code and response headers def get_sections_for_student_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_sections_for_student ...' @@ -281,33 +268,29 @@ def get_sections_for_student_with_http_info(id, opts = {}) local_var_path = '/students/{id}/sections'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SectionsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SectionsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_sections_for_student\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -325,7 +308,7 @@ def get_student(id, opts = {}) # Returns a specific student # @param id # @param [Hash] opts the optional parameters - # @return [Array<(StudentResponse, Integer, Hash)>] StudentResponse data, response status code and response headers + # @return [Array<(StudentResponse, Fixnum, Hash)>] StudentResponse data, response status code and response headers def get_student_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_student ...' @@ -338,30 +321,26 @@ def get_student_with_http_info(id, opts = {}) local_var_path = '/students/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'StudentResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'StudentResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_student\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -385,7 +364,7 @@ def get_students(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(StudentsResponse, Integer, Hash)>] StudentsResponse data, response status code and response headers + # @return [Array<(StudentsResponse, Fixnum, Hash)>] StudentsResponse data, response status code and response headers def get_students_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_students ...' @@ -397,34 +376,30 @@ def get_students_with_http_info(opts = {}) local_var_path = '/students' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'StudentsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'StudentsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_students\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -448,7 +423,7 @@ def get_teachers_for_student(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(TeachersResponse, Integer, Hash)>] TeachersResponse data, response status code and response headers + # @return [Array<(TeachersResponse, Fixnum, Hash)>] TeachersResponse data, response status code and response headers def get_teachers_for_student_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: StudentsApi.get_teachers_for_student ...' @@ -461,33 +436,29 @@ def get_teachers_for_student_with_http_info(id, opts = {}) local_var_path = '/students/{id}/teachers'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TeachersResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TeachersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: StudentsApi#get_teachers_for_student\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/teachers_api.rb b/lib/clever-ruby/api/teachers_api.rb index 5cc3c04e..874ee8c1 100644 --- a/lib/clever-ruby/api/teachers_api.rb +++ b/lib/clever-ruby/api/teachers_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class TeachersApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_district_for_teacher(id, opts = {}) # Returns the district for a teacher # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_teacher_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeachersApi.get_district_for_teacher ...' @@ -41,30 +44,26 @@ def get_district_for_teacher_with_http_info(id, opts = {}) local_var_path = '/teachers/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeachersApi#get_district_for_teacher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -82,7 +81,7 @@ def get_school_for_teacher(id, opts = {}) # Retrieves school info for a teacher. # @param id # @param [Hash] opts the optional parameters - # @return [Array<(SchoolResponse, Integer, Hash)>] SchoolResponse data, response status code and response headers + # @return [Array<(SchoolResponse, Fixnum, Hash)>] SchoolResponse data, response status code and response headers def get_school_for_teacher_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeachersApi.get_school_for_teacher ...' @@ -95,30 +94,26 @@ def get_school_for_teacher_with_http_info(id, opts = {}) local_var_path = '/teachers/{id}/school'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeachersApi#get_school_for_teacher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -142,7 +137,7 @@ def get_schools_for_teacher(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SchoolsResponse, Integer, Hash)>] SchoolsResponse data, response status code and response headers + # @return [Array<(SchoolsResponse, Fixnum, Hash)>] SchoolsResponse data, response status code and response headers def get_schools_for_teacher_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeachersApi.get_schools_for_teacher ...' @@ -155,33 +150,29 @@ def get_schools_for_teacher_with_http_info(id, opts = {}) local_var_path = '/teachers/{id}/schools'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SchoolsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SchoolsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeachersApi#get_schools_for_teacher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -205,7 +196,7 @@ def get_sections_for_teacher(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SectionsResponse, Integer, Hash)>] SectionsResponse data, response status code and response headers + # @return [Array<(SectionsResponse, Fixnum, Hash)>] SectionsResponse data, response status code and response headers def get_sections_for_teacher_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeachersApi.get_sections_for_teacher ...' @@ -218,33 +209,29 @@ def get_sections_for_teacher_with_http_info(id, opts = {}) local_var_path = '/teachers/{id}/sections'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SectionsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SectionsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeachersApi#get_sections_for_teacher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -268,7 +255,7 @@ def get_students_for_teacher(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(StudentsResponse, Integer, Hash)>] StudentsResponse data, response status code and response headers + # @return [Array<(StudentsResponse, Fixnum, Hash)>] StudentsResponse data, response status code and response headers def get_students_for_teacher_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeachersApi.get_students_for_teacher ...' @@ -281,33 +268,29 @@ def get_students_for_teacher_with_http_info(id, opts = {}) local_var_path = '/teachers/{id}/students'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'StudentsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'StudentsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeachersApi#get_students_for_teacher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -325,7 +308,7 @@ def get_teacher(id, opts = {}) # Returns a specific teacher # @param id # @param [Hash] opts the optional parameters - # @return [Array<(TeacherResponse, Integer, Hash)>] TeacherResponse data, response status code and response headers + # @return [Array<(TeacherResponse, Fixnum, Hash)>] TeacherResponse data, response status code and response headers def get_teacher_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeachersApi.get_teacher ...' @@ -338,30 +321,26 @@ def get_teacher_with_http_info(id, opts = {}) local_var_path = '/teachers/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TeacherResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TeacherResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeachersApi#get_teacher\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -385,7 +364,7 @@ def get_teachers(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(TeachersResponse, Integer, Hash)>] TeachersResponse data, response status code and response headers + # @return [Array<(TeachersResponse, Fixnum, Hash)>] TeachersResponse data, response status code and response headers def get_teachers_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TeachersApi.get_teachers ...' @@ -397,34 +376,30 @@ def get_teachers_with_http_info(opts = {}) local_var_path = '/teachers' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TeachersResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TeachersResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TeachersApi#get_teachers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api/terms_api.rb b/lib/clever-ruby/api/terms_api.rb index 9fd6689a..7fdb579d 100644 --- a/lib/clever-ruby/api/terms_api.rb +++ b/lib/clever-ruby/api/terms_api.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'uri' + module Clever class TermsApi attr_accessor :api_client @@ -28,7 +31,7 @@ def get_district_for_term(id, opts = {}) # Returns the district for a term # @param id # @param [Hash] opts the optional parameters - # @return [Array<(DistrictResponse, Integer, Hash)>] DistrictResponse data, response status code and response headers + # @return [Array<(DistrictResponse, Fixnum, Hash)>] DistrictResponse data, response status code and response headers def get_district_for_term_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TermsApi.get_district_for_term ...' @@ -41,30 +44,26 @@ def get_district_for_term_with_http_info(id, opts = {}) local_var_path = '/terms/{id}/district'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'DistrictResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'DistrictResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TermsApi#get_district_for_term\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -88,7 +87,7 @@ def get_sections_for_term(id, opts = {}) # @option opts [Integer] :limit # @option opts [String] :starting_after # @option opts [String] :ending_before - # @return [Array<(SectionsResponse, Integer, Hash)>] SectionsResponse data, response status code and response headers + # @return [Array<(SectionsResponse, Fixnum, Hash)>] SectionsResponse data, response status code and response headers def get_sections_for_term_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TermsApi.get_sections_for_term ...' @@ -101,33 +100,29 @@ def get_sections_for_term_with_http_info(id, opts = {}) local_var_path = '/terms/{id}/sections'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'SectionsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'SectionsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TermsApi#get_sections_for_term\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -145,7 +140,7 @@ def get_term(id, opts = {}) # Returns a specific term # @param id # @param [Hash] opts the optional parameters - # @return [Array<(TermResponse, Integer, Hash)>] TermResponse data, response status code and response headers + # @return [Array<(TermResponse, Fixnum, Hash)>] TermResponse data, response status code and response headers def get_term_with_http_info(id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TermsApi.get_term ...' @@ -158,30 +153,26 @@ def get_term_with_http_info(id, opts = {}) local_var_path = '/terms/{id}'.sub('{' + 'id' + '}', id.to_s) # query parameters - query_params = opts[:query_params] || {} + query_params = {} # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TermResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TermResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TermsApi#get_term\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end @@ -205,7 +196,7 @@ def get_terms(opts = {}) # @option opts [String] :starting_after # @option opts [String] :ending_before # @option opts [String] :count - # @return [Array<(TermsResponse, Integer, Hash)>] TermsResponse data, response status code and response headers + # @return [Array<(TermsResponse, Fixnum, Hash)>] TermsResponse data, response status code and response headers def get_terms_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TermsApi.get_terms ...' @@ -217,34 +208,30 @@ def get_terms_with_http_info(opts = {}) local_var_path = '/terms' # query parameters - query_params = opts[:query_params] || {} + query_params = {} query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil? query_params[:'starting_after'] = opts[:'starting_after'] if !opts[:'starting_after'].nil? query_params[:'ending_before'] = opts[:'ending_before'] if !opts[:'ending_before'].nil? query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil? # header parameters - header_params = opts[:header_params] || {} + header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters - form_params = opts[:form_params] || {} + form_params = {} # http body (model) - post_body = opts[:body] - - return_type = opts[:return_type] || 'TermsResponse' - - auth_names = opts[:auth_names] || ['oauth'] + post_body = nil + auth_names = ['oauth'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, - :return_type => return_type) - + :return_type => 'TermsResponse') if @api_client.config.debugging @api_client.config.logger.debug "API called: TermsApi#get_terms\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end diff --git a/lib/clever-ruby/api_error.rb b/lib/clever-ruby/api_error.rb index 728f63d7..db5c24ef 100644 --- a/lib/clever-ruby/api_error.rb +++ b/lib/clever-ruby/api_error.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end module Clever @@ -33,25 +34,5 @@ def initialize(arg = nil) super arg end end - - # Override to_s to display a friendly error message - def to_s - message - end - - def message - if @message.nil? - msg = "Error message: the server returns an error" - else - msg = @message - end - - msg += "\nHTTP status code: #{code}" if code - msg += "\nResponse headers: #{response_headers}" if response_headers - msg += "\nResponse body: #{response_body}" if response_body - - msg - end - end end diff --git a/lib/clever-ruby/configuration.rb b/lib/clever-ruby/configuration.rb index f4e8a257..ab79913e 100644 --- a/lib/clever-ruby/configuration.rb +++ b/lib/clever-ruby/configuration.rb @@ -6,9 +6,12 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end +require 'addressable/uri' + module Clever class Configuration # Defines url scheme @@ -127,7 +130,7 @@ class Configuration def initialize @scheme = 'https' @host = 'api.clever.com' - @base_path = 'https://api.clever.com/' + @base_path = '' @api_key = {} @api_key_prefix = {} @timeout = 0 @@ -171,7 +174,8 @@ def base_path=(base_path) end def base_url - "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + url = "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') + Addressable::URI.encode(url) end # Gets API key (with prefix if set). diff --git a/lib/clever-ruby/models/admin_name.rb b/lib/clever-ruby/models/admin_name.rb index fec4fad8..db136bff 100644 --- a/lib/clever-ruby/models/admin_name.rb +++ b/lib/clever-ruby/models/admin_name.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,26 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'first' => :'Object', - :'last' => :'Object' + :'first' => :'String', + :'last' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'first', - :'last' - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::AdminName` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::AdminName`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'first') + if attributes.has_key?(:'first') self.first = attributes[:'first'] end - if attributes.key?(:'last') + if attributes.has_key?(:'last') self.last = attributes[:'last'] end end @@ -94,24 +80,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [first, last].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -120,9 +99,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -144,7 +121,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -165,7 +142,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -187,11 +165,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -213,5 +187,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/bad_request.rb b/lib/clever-ruby/models/bad_request.rb index c7919f72..5b8b1d16 100644 --- a/lib/clever-ruby/models/bad_request.rb +++ b/lib/clever-ruby/models/bad_request.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'message' => :'Object' + :'message' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::BadRequest` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::BadRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'message') + if attributes.has_key?(:'message') self.message = attributes[:'message'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [message].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/contact.rb b/lib/clever-ruby/models/contact.rb index f7a63c73..a352a1a5 100644 --- a/lib/clever-ruby/models/contact.rb +++ b/lib/clever-ruby/models/contact.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -72,87 +73,68 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'district' => :'Object', - :'email' => :'Object', - :'name' => :'Object', - :'phone' => :'Object', - :'phone_type' => :'Object', - :'relationship' => :'Object', - :'sis_id' => :'Object', - :'students' => :'Object', - :'type' => :'Object' + :'id' => :'String', + :'district' => :'String', + :'email' => :'String', + :'name' => :'String', + :'phone' => :'String', + :'phone_type' => :'String', + :'relationship' => :'String', + :'sis_id' => :'String', + :'students' => :'Array', + :'type' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email', - :'phone', - :'phone_type', - :'relationship', - :'sis_id', - :'type' - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Contact` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Contact`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end - if attributes.key?(:'email') + if attributes.has_key?(:'email') self.email = attributes[:'email'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'phone') + if attributes.has_key?(:'phone') self.phone = attributes[:'phone'] end - if attributes.key?(:'phone_type') + if attributes.has_key?(:'phone_type') self.phone_type = attributes[:'phone_type'] end - if attributes.key?(:'relationship') + if attributes.has_key?(:'relationship') self.relationship = attributes[:'relationship'] end - if attributes.key?(:'sis_id') + if attributes.has_key?(:'sis_id') self.sis_id = attributes[:'sis_id'] end - if attributes.key?(:'students') + if attributes.has_key?(:'students') if (value = attributes[:'students']).is_a?(Array) self.students = value end end - if attributes.key?(:'type') + if attributes.has_key?(:'type') self.type = attributes[:'type'] end end @@ -167,11 +149,11 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - phone_type_validator = EnumAttributeValidator.new('Object', ['Cell', 'Home', 'Work', 'Other', '']) + phone_type_validator = EnumAttributeValidator.new('String', ['Cell', 'Home', 'Work', 'Other', '']) return false unless phone_type_validator.valid?(@phone_type) - relationship_validator = EnumAttributeValidator.new('Object', ['Parent', 'Grandparent', 'Self', 'Aunt/Uncle', 'Sibling', 'Other', '']) + relationship_validator = EnumAttributeValidator.new('String', ['Parent', 'Grandparent', 'Self', 'Aunt/Uncle', 'Sibling', 'Other', '']) return false unless relationship_validator.valid?(@relationship) - type_validator = EnumAttributeValidator.new('Object', ['Parent/Guardian', 'Emergency', 'Primary', 'Secondary', 'Family', 'Other', '']) + type_validator = EnumAttributeValidator.new('String', ['Parent/Guardian', 'Emergency', 'Primary', 'Secondary', 'Family', 'Other', '']) return false unless type_validator.valid?(@type) true end @@ -179,9 +161,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] phone_type Object to be assigned def phone_type=(phone_type) - validator = EnumAttributeValidator.new('Object', ['Cell', 'Home', 'Work', 'Other', '']) + validator = EnumAttributeValidator.new('String', ['Cell', 'Home', 'Work', 'Other', '']) unless validator.valid?(phone_type) - fail ArgumentError, "invalid value for \"phone_type\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "phone_type", must be one of #{validator.allowable_values}.' end @phone_type = phone_type end @@ -189,9 +171,9 @@ def phone_type=(phone_type) # Custom attribute writer method checking allowed values (enum). # @param [Object] relationship Object to be assigned def relationship=(relationship) - validator = EnumAttributeValidator.new('Object', ['Parent', 'Grandparent', 'Self', 'Aunt/Uncle', 'Sibling', 'Other', '']) + validator = EnumAttributeValidator.new('String', ['Parent', 'Grandparent', 'Self', 'Aunt/Uncle', 'Sibling', 'Other', '']) unless validator.valid?(relationship) - fail ArgumentError, "invalid value for \"relationship\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "relationship", must be one of #{validator.allowable_values}.' end @relationship = relationship end @@ -199,9 +181,9 @@ def relationship=(relationship) # Custom attribute writer method checking allowed values (enum). # @param [Object] type Object to be assigned def type=(type) - validator = EnumAttributeValidator.new('Object', ['Parent/Guardian', 'Emergency', 'Primary', 'Secondary', 'Family', 'Other', '']) + validator = EnumAttributeValidator.new('String', ['Parent/Guardian', 'Emergency', 'Primary', 'Secondary', 'Family', 'Other', '']) unless validator.valid?(type) - fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "type", must be one of #{validator.allowable_values}.' end @type = type end @@ -230,24 +212,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, district, email, name, phone, phone_type, relationship, sis_id, students, type].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -256,9 +231,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -280,7 +253,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -301,7 +274,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -323,11 +297,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -349,5 +319,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/contact_object.rb b/lib/clever-ruby/models/contact_object.rb index da223bef..0b40b5ff 100644 --- a/lib/clever-ruby/models/contact_object.rb +++ b/lib/clever-ruby/models/contact_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'Contact' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::ContactObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::ContactObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/contact_response.rb b/lib/clever-ruby/models/contact_response.rb index c67eb79a..18ab08c8 100644 --- a/lib/clever-ruby/models/contact_response.rb +++ b/lib/clever-ruby/models/contact_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'Contact' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::ContactResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::ContactResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/contacts_response.rb b/lib/clever-ruby/models/contacts_response.rb index e89805ab..c8b87bc2 100644 --- a/lib/clever-ruby/models/contacts_response.rb +++ b/lib/clever-ruby/models/contacts_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::ContactsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::ContactsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/course.rb b/lib/clever-ruby/models/course.rb index 00934ccf..1d683d22 100644 --- a/lib/clever-ruby/models/course.rb +++ b/lib/clever-ruby/models/course.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -32,51 +33,36 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'name' => :'Object', - :'number' => :'Object', - :'district' => :'Object' + :'id' => :'String', + :'name' => :'String', + :'number' => :'String', + :'district' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'number', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Course` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Course`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'number') + if attributes.has_key?(:'number') self.number = attributes[:'number'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end end @@ -112,24 +98,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, name, number, district].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -138,9 +117,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -162,7 +139,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -183,7 +160,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -205,11 +183,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -231,5 +205,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/course_object.rb b/lib/clever-ruby/models/course_object.rb index a8df0280..647c67c1 100644 --- a/lib/clever-ruby/models/course_object.rb +++ b/lib/clever-ruby/models/course_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'Course' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::CourseObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::CourseObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/course_response.rb b/lib/clever-ruby/models/course_response.rb index a6eada5c..ab62e95f 100644 --- a/lib/clever-ruby/models/course_response.rb +++ b/lib/clever-ruby/models/course_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'Course' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::CourseResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::CourseResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/courses_response.rb b/lib/clever-ruby/models/courses_response.rb index ba788aa9..1f1eaa8e 100644 --- a/lib/clever-ruby/models/courses_response.rb +++ b/lib/clever-ruby/models/courses_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::CoursesResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - 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 - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/credentials.rb b/lib/clever-ruby/models/credentials.rb index e58479bf..7344aef6 100644 --- a/lib/clever-ruby/models/credentials.rb +++ b/lib/clever-ruby/models/credentials.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'district_username' => :'Object' + :'district_username' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Credentials` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - 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 - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'district_username') + if attributes.has_key?(:'district_username') self.district_username = attributes[:'district_username'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [district_username].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/district.rb b/lib/clever-ruby/models/district.rb index 810ac973..8f587e74 100644 --- a/lib/clever-ruby/models/district.rb +++ b/lib/clever-ruby/models/district.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -84,107 +85,88 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'name' => :'Object', - :'mdr_number' => :'Object', - :'nces_id' => :'Object', - :'sis_type' => :'Object', - :'state' => :'Object', - :'last_sync' => :'Object', - :'error' => :'Object', - :'pause_start' => :'Object', - :'pause_end' => :'Object', - :'launch_date' => :'Object', - :'portal_url' => :'Object', - :'login_methods' => :'Object', - :'district_contact' => :'Object' + :'id' => :'String', + :'name' => :'String', + :'mdr_number' => :'String', + :'nces_id' => :'String', + :'sis_type' => :'String', + :'state' => :'String', + :'last_sync' => :'String', + :'error' => :'String', + :'pause_start' => :'String', + :'pause_end' => :'String', + :'launch_date' => :'String', + :'portal_url' => :'String', + :'login_methods' => :'Array', + :'district_contact' => :'DistrictAdmin' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'mdr_number', - :'nces_id', - :'state', - :'last_sync', - :'pause_start', - :'pause_end', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::District` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - 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 - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'mdr_number') + if attributes.has_key?(:'mdr_number') self.mdr_number = attributes[:'mdr_number'] end - if attributes.key?(:'nces_id') + if attributes.has_key?(:'nces_id') self.nces_id = attributes[:'nces_id'] end - if attributes.key?(:'sis_type') + if attributes.has_key?(:'sis_type') self.sis_type = attributes[:'sis_type'] end - if attributes.key?(:'state') + if attributes.has_key?(:'state') self.state = attributes[:'state'] end - if attributes.key?(:'last_sync') + if attributes.has_key?(:'last_sync') self.last_sync = attributes[:'last_sync'] end - if attributes.key?(:'error') + if attributes.has_key?(:'error') self.error = attributes[:'error'] end - if attributes.key?(:'pause_start') + if attributes.has_key?(:'pause_start') self.pause_start = attributes[:'pause_start'] end - if attributes.key?(:'pause_end') + if attributes.has_key?(:'pause_end') self.pause_end = attributes[:'pause_end'] end - if attributes.key?(:'launch_date') + if attributes.has_key?(:'launch_date') self.launch_date = attributes[:'launch_date'] end - if attributes.key?(:'portal_url') + if attributes.has_key?(:'portal_url') self.portal_url = attributes[:'portal_url'] end - if attributes.key?(:'login_methods') + if attributes.has_key?(:'login_methods') if (value = attributes[:'login_methods']).is_a?(Array) self.login_methods = value end end - if attributes.key?(:'district_contact') + if attributes.has_key?(:'district_contact') self.district_contact = attributes[:'district_contact'] end end @@ -199,7 +181,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - state_validator = EnumAttributeValidator.new('Object', ['running', 'pending', 'error', 'paused', '', 'success']) + state_validator = EnumAttributeValidator.new('String', ['running', 'pending', 'error', 'paused', '', 'success']) return false unless state_validator.valid?(@state) true end @@ -207,9 +189,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] state Object to be assigned def state=(state) - validator = EnumAttributeValidator.new('Object', ['running', 'pending', 'error', 'paused', '', 'success']) + validator = EnumAttributeValidator.new('String', ['running', 'pending', 'error', 'paused', '', 'success']) unless validator.valid?(state) - fail ArgumentError, "invalid value for \"state\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "state", must be one of #{validator.allowable_values}.' end @state = state end @@ -242,24 +224,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, name, mdr_number, nces_id, sis_type, state, last_sync, error, pause_start, pause_end, launch_date, portal_url, login_methods, district_contact].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -268,9 +243,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -292,7 +265,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -313,7 +286,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -335,11 +309,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -361,5 +331,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/district_admin.rb b/lib/clever-ruby/models/district_admin.rb index 60d87021..50724b29 100644 --- a/lib/clever-ruby/models/district_admin.rb +++ b/lib/clever-ruby/models/district_admin.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -35,55 +36,41 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'name' => :'Object', - :'email' => :'Object', - :'title' => :'Object', - :'district' => :'Object' + :'id' => :'String', + :'name' => :'AdminName', + :'email' => :'String', + :'title' => :'String', + :'district' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'title', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::DistrictAdmin` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::DistrictAdmin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'email') + if attributes.has_key?(:'email') self.email = attributes[:'email'] end - if attributes.key?(:'title') + if attributes.has_key?(:'title') self.title = attributes[:'title'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end end @@ -120,24 +107,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, name, email, title, district].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -146,9 +126,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -170,7 +148,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -191,7 +169,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -213,11 +192,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -239,5 +214,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/district_admin_object.rb b/lib/clever-ruby/models/district_admin_object.rb index 2d2f6fa2..aa953545 100644 --- a/lib/clever-ruby/models/district_admin_object.rb +++ b/lib/clever-ruby/models/district_admin_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'DistrictAdmin' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::DistrictAdminObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::DistrictAdminObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/district_admin_response.rb b/lib/clever-ruby/models/district_admin_response.rb index 766bf2b7..c573f465 100644 --- a/lib/clever-ruby/models/district_admin_response.rb +++ b/lib/clever-ruby/models/district_admin_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'DistrictAdmin' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::DistrictAdminResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::DistrictAdminResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/district_admins_response.rb b/lib/clever-ruby/models/district_admins_response.rb index 93ec43e0..3e3dbee2 100644 --- a/lib/clever-ruby/models/district_admins_response.rb +++ b/lib/clever-ruby/models/district_admins_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::DistrictAdminsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::DistrictAdminsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/district_object.rb b/lib/clever-ruby/models/district_object.rb index 3be211fa..1ba0c550 100644 --- a/lib/clever-ruby/models/district_object.rb +++ b/lib/clever-ruby/models/district_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'District' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::DistrictObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::DistrictObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/district_response.rb b/lib/clever-ruby/models/district_response.rb index ff0f7bff..c66eb913 100644 --- a/lib/clever-ruby/models/district_response.rb +++ b/lib/clever-ruby/models/district_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'District' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::DistrictResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::DistrictResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/districts_response.rb b/lib/clever-ruby/models/districts_response.rb index bafe6203..491cf87d 100644 --- a/lib/clever-ruby/models/districts_response.rb +++ b/lib/clever-ruby/models/districts_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::DistrictsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::DistrictsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/event.rb b/lib/clever-ruby/models/event.rb index d170065d..d6317e92 100644 --- a/lib/clever-ruby/models/event.rb +++ b/lib/clever-ruby/models/event.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -29,49 +30,31 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'type' => :'Object', - :'id' => :'Object', - :'created' => :'Object' + :'type' => :'String', + :'id' => :'String', + :'created' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - - # discriminator's property name in OpenAPI v3 - def self.openapi_discriminator_name - :'type' - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Event` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Event`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'type') + if attributes.has_key?(:'type') self.type = attributes[:'type'] end - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'created') + if attributes.has_key?(:'created') self.created = attributes[:'created'] end end @@ -111,24 +94,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [type, id, created].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -137,9 +113,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -161,7 +135,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -182,7 +156,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -204,11 +179,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -230,5 +201,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/event_response.rb b/lib/clever-ruby/models/event_response.rb index e6e48a8f..76630f8a 100644 --- a/lib/clever-ruby/models/event_response.rb +++ b/lib/clever-ruby/models/event_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'Event' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::EventResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::EventResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/events_response.rb b/lib/clever-ruby/models/events_response.rb index f9df35ac..2610a3c5 100644 --- a/lib/clever-ruby/models/events_response.rb +++ b/lib/clever-ruby/models/events_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::EventsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::EventsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/internal_error.rb b/lib/clever-ruby/models/internal_error.rb index 9469c73b..4c00ee03 100644 --- a/lib/clever-ruby/models/internal_error.rb +++ b/lib/clever-ruby/models/internal_error.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'message' => :'Object' + :'message' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::InternalError` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::InternalError`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'message') + if attributes.has_key?(:'message') self.message = attributes[:'message'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [message].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/link.rb b/lib/clever-ruby/models/link.rb index 150602eb..77161f7f 100644 --- a/lib/clever-ruby/models/link.rb +++ b/lib/clever-ruby/models/link.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -48,39 +49,26 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'rel' => :'Object', - :'uri' => :'Object' + :'rel' => :'String', + :'uri' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Link` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Link`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'rel') + if attributes.has_key?(:'rel') self.rel = attributes[:'rel'] end - if attributes.key?(:'uri') + if attributes.has_key?(:'uri') self.uri = attributes[:'uri'] end end @@ -95,7 +83,7 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - rel_validator = EnumAttributeValidator.new('Object', ['next', 'prev', 'self']) + rel_validator = EnumAttributeValidator.new('String', ['next', 'prev', 'self']) return false unless rel_validator.valid?(@rel) true end @@ -103,9 +91,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] rel Object to be assigned def rel=(rel) - validator = EnumAttributeValidator.new('Object', ['next', 'prev', 'self']) + validator = EnumAttributeValidator.new('String', ['next', 'prev', 'self']) unless validator.valid?(rel) - fail ArgumentError, "invalid value for \"rel\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "rel", must be one of #{validator.allowable_values}.' end @rel = rel end @@ -126,24 +114,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [rel, uri].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -152,9 +133,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -176,7 +155,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -197,7 +176,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -219,11 +199,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -245,5 +221,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/location.rb b/lib/clever-ruby/models/location.rb index 39a4a9d3..04d8b811 100644 --- a/lib/clever-ruby/models/location.rb +++ b/lib/clever-ruby/models/location.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -38,65 +39,46 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'address' => :'Object', - :'city' => :'Object', - :'state' => :'Object', - :'zip' => :'Object', - :'lat' => :'Object', - :'lon' => :'Object' + :'address' => :'String', + :'city' => :'String', + :'state' => :'String', + :'zip' => :'String', + :'lat' => :'String', + :'lon' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'address', - :'city', - :'state', - :'zip', - :'lat', - :'lon' - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Location` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Location`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'address') + if attributes.has_key?(:'address') self.address = attributes[:'address'] end - if attributes.key?(:'city') + if attributes.has_key?(:'city') self.city = attributes[:'city'] end - if attributes.key?(:'state') + if attributes.has_key?(:'state') self.state = attributes[:'state'] end - if attributes.key?(:'zip') + if attributes.has_key?(:'zip') self.zip = attributes[:'zip'] end - if attributes.key?(:'lat') + if attributes.has_key?(:'lat') self.lat = attributes[:'lat'] end - if attributes.key?(:'lon') + if attributes.has_key?(:'lon') self.lon = attributes[:'lon'] end end @@ -134,24 +116,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [address, city, state, zip, lat, lon].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -160,9 +135,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -184,7 +157,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -205,7 +178,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -227,11 +201,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -253,5 +223,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/name.rb b/lib/clever-ruby/models/name.rb index 3f136249..23addc4b 100644 --- a/lib/clever-ruby/models/name.rb +++ b/lib/clever-ruby/models/name.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -29,47 +30,31 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'first' => :'Object', - :'middle' => :'Object', - :'last' => :'Object' + :'first' => :'String', + :'middle' => :'String', + :'last' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'first', - :'middle', - :'last' - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Name` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Name`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'first') + if attributes.has_key?(:'first') self.first = attributes[:'first'] end - if attributes.key?(:'middle') + if attributes.has_key?(:'middle') self.middle = attributes[:'middle'] end - if attributes.key?(:'last') + if attributes.has_key?(:'last') self.last = attributes[:'last'] end end @@ -104,24 +89,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [first, middle, last].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -130,9 +108,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -154,7 +130,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -175,7 +151,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -197,11 +174,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -223,5 +196,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/not_found.rb b/lib/clever-ruby/models/not_found.rb index 53477c9a..c007c656 100644 --- a/lib/clever-ruby/models/not_found.rb +++ b/lib/clever-ruby/models/not_found.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'message' => :'Object' + :'message' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::NotFound` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::NotFound`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'message') + if attributes.has_key?(:'message') self.message = attributes[:'message'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [message].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/principal.rb b/lib/clever-ruby/models/principal.rb index 8b5fa200..5c0b62ad 100644 --- a/lib/clever-ruby/models/principal.rb +++ b/lib/clever-ruby/models/principal.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,26 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'name' => :'Object', - :'email' => :'Object' + :'name' => :'String', + :'email' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'email' - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Principal` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - 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 - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'email') + if attributes.has_key?(:'email') self.email = attributes[:'email'] end end @@ -94,24 +80,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [name, email].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -120,9 +99,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -144,7 +121,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -165,7 +142,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -187,11 +165,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -213,5 +187,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school.rb b/lib/clever-ruby/models/school.rb index 23a0969a..625ebf90 100644 --- a/lib/clever-ruby/models/school.rb +++ b/lib/clever-ruby/models/school.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -90,115 +91,96 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'created' => :'Object', - :'district' => :'Object', - :'high_grade' => :'Object', - :'last_modified' => :'Object', - :'location' => :'Object', - :'low_grade' => :'Object', - :'name' => :'Object', - :'nces_id' => :'Object', - :'phone' => :'Object', - :'principal' => :'Object', - :'school_number' => :'Object', - :'sis_id' => :'Object', - :'state_id' => :'Object', - :'mdr_number' => :'Object', + :'id' => :'String', + :'created' => :'String', + :'district' => :'String', + :'high_grade' => :'String', + :'last_modified' => :'String', + :'location' => :'Location', + :'low_grade' => :'String', + :'name' => :'String', + :'nces_id' => :'String', + :'phone' => :'String', + :'principal' => :'Principal', + :'school_number' => :'String', + :'sis_id' => :'String', + :'state_id' => :'String', + :'mdr_number' => :'String', :'ext' => :'Object' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'high_grade', - :'low_grade', - :'nces_id', - :'phone', - :'state_id', - :'mdr_number', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::School` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - 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 - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'created') + if attributes.has_key?(:'created') self.created = attributes[:'created'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end - if attributes.key?(:'high_grade') + if attributes.has_key?(:'high_grade') self.high_grade = attributes[:'high_grade'] end - if attributes.key?(:'last_modified') + if attributes.has_key?(:'last_modified') self.last_modified = attributes[:'last_modified'] end - if attributes.key?(:'location') + if attributes.has_key?(:'location') self.location = attributes[:'location'] end - if attributes.key?(:'low_grade') + if attributes.has_key?(:'low_grade') self.low_grade = attributes[:'low_grade'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'nces_id') + if attributes.has_key?(:'nces_id') self.nces_id = attributes[:'nces_id'] end - if attributes.key?(:'phone') + if attributes.has_key?(:'phone') self.phone = attributes[:'phone'] end - if attributes.key?(:'principal') + if attributes.has_key?(:'principal') self.principal = attributes[:'principal'] end - if attributes.key?(:'school_number') + if attributes.has_key?(:'school_number') self.school_number = attributes[:'school_number'] end - if attributes.key?(:'sis_id') + if attributes.has_key?(:'sis_id') self.sis_id = attributes[:'sis_id'] end - if attributes.key?(:'state_id') + if attributes.has_key?(:'state_id') self.state_id = attributes[:'state_id'] end - if attributes.key?(:'mdr_number') + if attributes.has_key?(:'mdr_number') self.mdr_number = attributes[:'mdr_number'] end - if attributes.key?(:'ext') + if attributes.has_key?(:'ext') self.ext = attributes[:'ext'] end end @@ -213,9 +195,9 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - 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', '']) + high_grade_validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) return false unless high_grade_validator.valid?(@high_grade) - 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', '']) + low_grade_validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) return false unless low_grade_validator.valid?(@low_grade) true end @@ -223,9 +205,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] high_grade Object to be assigned def high_grade=(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', '']) + validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) unless validator.valid?(high_grade) - fail ArgumentError, "invalid value for \"high_grade\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "high_grade", must be one of #{validator.allowable_values}.' end @high_grade = high_grade end @@ -233,9 +215,9 @@ def high_grade=(high_grade) # Custom attribute writer method checking allowed values (enum). # @param [Object] low_grade Object to be assigned def low_grade=(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', '']) + validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) unless validator.valid?(low_grade) - fail ArgumentError, "invalid value for \"low_grade\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "low_grade", must be one of #{validator.allowable_values}.' end @low_grade = low_grade end @@ -270,24 +252,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, created, district, high_grade, last_modified, location, low_grade, name, nces_id, phone, principal, school_number, sis_id, state_id, mdr_number, ext].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -296,9 +271,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -320,7 +293,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -341,7 +314,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -363,11 +337,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -389,5 +359,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school_admin.rb b/lib/clever-ruby/models/school_admin.rb index 6a397b04..f8acc19f 100644 --- a/lib/clever-ruby/models/school_admin.rb +++ b/lib/clever-ruby/models/school_admin.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -50,83 +51,68 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'credentials' => :'Object', - :'district' => :'Object', - :'email' => :'Object', - :'name' => :'Object', - :'schools' => :'Object', - :'staff_id' => :'Object', - :'title' => :'Object', - :'department' => :'Object', + :'id' => :'String', + :'credentials' => :'Credentials', + :'district' => :'String', + :'email' => :'String', + :'name' => :'AdminName', + :'schools' => :'Array', + :'staff_id' => :'String', + :'title' => :'String', + :'department' => :'String', :'ext' => :'Object' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'title', - :'department', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolAdmin` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolAdmin`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'credentials') + if attributes.has_key?(:'credentials') self.credentials = attributes[:'credentials'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end - if attributes.key?(:'email') + if attributes.has_key?(:'email') self.email = attributes[:'email'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'schools') + if attributes.has_key?(:'schools') if (value = attributes[:'schools']).is_a?(Array) self.schools = value end end - if attributes.key?(:'staff_id') + if attributes.has_key?(:'staff_id') self.staff_id = attributes[:'staff_id'] end - if attributes.key?(:'title') + if attributes.has_key?(:'title') self.title = attributes[:'title'] end - if attributes.key?(:'department') + if attributes.has_key?(:'department') self.department = attributes[:'department'] end - if attributes.key?(:'ext') + if attributes.has_key?(:'ext') self.ext = attributes[:'ext'] end end @@ -168,24 +154,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, credentials, district, email, name, schools, staff_id, title, department, ext].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -194,9 +173,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -218,7 +195,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -239,7 +216,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -261,11 +239,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -287,5 +261,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school_admin_object.rb b/lib/clever-ruby/models/school_admin_object.rb index 23eebfc9..0dcfac77 100644 --- a/lib/clever-ruby/models/school_admin_object.rb +++ b/lib/clever-ruby/models/school_admin_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'SchoolAdmin' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolAdminObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolAdminObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school_admin_response.rb b/lib/clever-ruby/models/school_admin_response.rb index f7d3489c..e2f19149 100644 --- a/lib/clever-ruby/models/school_admin_response.rb +++ b/lib/clever-ruby/models/school_admin_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'SchoolAdmin' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolAdminResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolAdminResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school_admins_response.rb b/lib/clever-ruby/models/school_admins_response.rb index b3cbc74c..16383ea0 100644 --- a/lib/clever-ruby/models/school_admins_response.rb +++ b/lib/clever-ruby/models/school_admins_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolAdminsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolAdminsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school_enrollment.rb b/lib/clever-ruby/models/school_enrollment.rb index 13f66823..21d2015e 100644 --- a/lib/clever-ruby/models/school_enrollment.rb +++ b/lib/clever-ruby/models/school_enrollment.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -29,44 +30,31 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'school' => :'Object', - :'start_date' => :'Object', - :'end_date' => :'Object' + :'school' => :'String', + :'start_date' => :'String', + :'end_date' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolEnrollment` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolEnrollment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'school') + if attributes.has_key?(:'school') self.school = attributes[:'school'] end - if attributes.key?(:'start_date') + if attributes.has_key?(:'start_date') self.start_date = attributes[:'start_date'] end - if attributes.key?(:'end_date') + if attributes.has_key?(:'end_date') self.end_date = attributes[:'end_date'] end end @@ -101,24 +89,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [school, start_date, end_date].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -127,9 +108,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -151,7 +130,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -172,7 +151,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -194,11 +174,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -220,5 +196,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school_object.rb b/lib/clever-ruby/models/school_object.rb index 3a3b513f..f400333f 100644 --- a/lib/clever-ruby/models/school_object.rb +++ b/lib/clever-ruby/models/school_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'School' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/school_response.rb b/lib/clever-ruby/models/school_response.rb index d078d26e..2407416a 100644 --- a/lib/clever-ruby/models/school_response.rb +++ b/lib/clever-ruby/models/school_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'School' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/schools_response.rb b/lib/clever-ruby/models/schools_response.rb index 0e89bd57..f12dad2f 100644 --- a/lib/clever-ruby/models/schools_response.rb +++ b/lib/clever-ruby/models/schools_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SchoolsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SchoolsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/section.rb b/lib/clever-ruby/models/section.rb index 95b609cb..cb2f0b82 100644 --- a/lib/clever-ruby/models/section.rb +++ b/lib/clever-ruby/models/section.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -93,125 +94,105 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'course' => :'Object', - :'created' => :'Object', - :'district' => :'Object', - :'grade' => :'Object', - :'last_modified' => :'Object', - :'name' => :'Object', - :'period' => :'Object', - :'school' => :'Object', - :'section_number' => :'Object', - :'sis_id' => :'Object', - :'students' => :'Object', - :'subject' => :'Object', - :'teacher' => :'Object', - :'teachers' => :'Object', - :'term_id' => :'Object', + :'id' => :'String', + :'course' => :'String', + :'created' => :'String', + :'district' => :'String', + :'grade' => :'String', + :'last_modified' => :'String', + :'name' => :'String', + :'period' => :'String', + :'school' => :'String', + :'section_number' => :'String', + :'sis_id' => :'String', + :'students' => :'Array', + :'subject' => :'String', + :'teacher' => :'String', + :'teachers' => :'Array', + :'term_id' => :'String', :'ext' => :'Object' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'course', - :'grade', - :'period', - :'section_number', - :'subject', - :'teacher', - :'term_id', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Section` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Section`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'course') + if attributes.has_key?(:'course') self.course = attributes[:'course'] end - if attributes.key?(:'created') + if attributes.has_key?(:'created') self.created = attributes[:'created'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end - if attributes.key?(:'grade') + if attributes.has_key?(:'grade') self.grade = attributes[:'grade'] end - if attributes.key?(:'last_modified') + if attributes.has_key?(:'last_modified') self.last_modified = attributes[:'last_modified'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'period') + if attributes.has_key?(:'period') self.period = attributes[:'period'] end - if attributes.key?(:'school') + if attributes.has_key?(:'school') self.school = attributes[:'school'] end - if attributes.key?(:'section_number') + if attributes.has_key?(:'section_number') self.section_number = attributes[:'section_number'] end - if attributes.key?(:'sis_id') + if attributes.has_key?(:'sis_id') self.sis_id = attributes[:'sis_id'] end - if attributes.key?(:'students') + if attributes.has_key?(:'students') if (value = attributes[:'students']).is_a?(Array) self.students = value end end - if attributes.key?(:'subject') + if attributes.has_key?(:'subject') self.subject = attributes[:'subject'] end - if attributes.key?(:'teacher') + if attributes.has_key?(:'teacher') self.teacher = attributes[:'teacher'] end - if attributes.key?(:'teachers') + if attributes.has_key?(:'teachers') if (value = attributes[:'teachers']).is_a?(Array) self.teachers = value end end - if attributes.key?(:'term_id') + if attributes.has_key?(:'term_id') self.term_id = attributes[:'term_id'] end - if attributes.key?(:'ext') + if attributes.has_key?(:'ext') self.ext = attributes[:'ext'] end end @@ -226,9 +207,9 @@ def list_invalid_properties # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - 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', '']) + grade_validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) return false unless grade_validator.valid?(@grade) - subject_validator = EnumAttributeValidator.new('Object', ['english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other', '']) + subject_validator = EnumAttributeValidator.new('String', ['english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other', '']) return false unless subject_validator.valid?(@subject) true end @@ -236,9 +217,9 @@ def valid? # Custom attribute writer method checking allowed values (enum). # @param [Object] grade Object to be assigned def grade=(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', '']) + validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) unless validator.valid?(grade) - fail ArgumentError, "invalid value for \"grade\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "grade", must be one of #{validator.allowable_values}.' end @grade = grade end @@ -246,9 +227,9 @@ def grade=(grade) # Custom attribute writer method checking allowed values (enum). # @param [Object] subject Object to be assigned def subject=(subject) - validator = EnumAttributeValidator.new('Object', ['english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other', '']) + validator = EnumAttributeValidator.new('String', ['english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other', '']) unless validator.valid?(subject) - fail ArgumentError, "invalid value for \"subject\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "subject", must be one of #{validator.allowable_values}.' end @subject = subject end @@ -284,24 +265,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, course, created, district, grade, last_modified, name, period, school, section_number, sis_id, students, subject, teacher, teachers, term_id, ext].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -310,9 +284,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -334,7 +306,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -355,7 +327,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -377,11 +350,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -403,5 +372,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/section_object.rb b/lib/clever-ruby/models/section_object.rb index 95b9027f..6d1d5b37 100644 --- a/lib/clever-ruby/models/section_object.rb +++ b/lib/clever-ruby/models/section_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'Section' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SectionObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SectionObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/section_response.rb b/lib/clever-ruby/models/section_response.rb index 42499d7f..398af0f9 100644 --- a/lib/clever-ruby/models/section_response.rb +++ b/lib/clever-ruby/models/section_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'Section' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SectionResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SectionResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/sections_response.rb b/lib/clever-ruby/models/sections_response.rb index 39ce83dd..8e46e129 100644 --- a/lib/clever-ruby/models/sections_response.rb +++ b/lib/clever-ruby/models/sections_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::SectionsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::SectionsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/student.rb b/lib/clever-ruby/models/student.rb index 504a8e82..4312f738 100644 --- a/lib/clever-ruby/models/student.rb +++ b/lib/clever-ruby/models/student.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -120,177 +121,150 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'created' => :'Object', - :'credentials' => :'Object', - :'district' => :'Object', - :'dob' => :'Object', - :'ell_status' => :'Object', - :'email' => :'Object', - :'enrollments' => :'Object', - :'gender' => :'Object', - :'graduation_year' => :'Object', - :'grade' => :'Object', - :'hispanic_ethnicity' => :'Object', - :'home_language' => :'Object', - :'iep_status' => :'Object', - :'last_modified' => :'Object', - :'location' => :'Object', - :'name' => :'Object', - :'race' => :'Object', - :'school' => :'Object', - :'schools' => :'Object', - :'sis_id' => :'Object', - :'state_id' => :'Object', - :'student_number' => :'Object', - :'unweighted_gpa' => :'Object', - :'weighted_gpa' => :'Object', + :'id' => :'String', + :'created' => :'String', + :'credentials' => :'Credentials', + :'district' => :'String', + :'dob' => :'String', + :'ell_status' => :'String', + :'email' => :'String', + :'enrollments' => :'Array', + :'gender' => :'String', + :'graduation_year' => :'String', + :'grade' => :'String', + :'hispanic_ethnicity' => :'String', + :'home_language' => :'String', + :'iep_status' => :'String', + :'last_modified' => :'String', + :'location' => :'Location', + :'name' => :'Name', + :'race' => :'String', + :'school' => :'String', + :'schools' => :'Array', + :'sis_id' => :'String', + :'state_id' => :'String', + :'student_number' => :'String', + :'unweighted_gpa' => :'String', + :'weighted_gpa' => :'String', :'ext' => :'Object' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'dob', - :'ell_status', - :'email', - :'gender', - :'graduation_year', - :'grade', - :'hispanic_ethnicity', - :'home_language', - :'iep_status', - :'race', - :'state_id', - :'student_number', - :'unweighted_gpa', - :'weighted_gpa', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Student` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Student`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'created') + if attributes.has_key?(:'created') self.created = attributes[:'created'] end - if attributes.key?(:'credentials') + if attributes.has_key?(:'credentials') self.credentials = attributes[:'credentials'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end - if attributes.key?(:'dob') + if attributes.has_key?(:'dob') self.dob = attributes[:'dob'] end - if attributes.key?(:'ell_status') + if attributes.has_key?(:'ell_status') self.ell_status = attributes[:'ell_status'] end - if attributes.key?(:'email') + if attributes.has_key?(:'email') self.email = attributes[:'email'] end - if attributes.key?(:'enrollments') + if attributes.has_key?(:'enrollments') if (value = attributes[:'enrollments']).is_a?(Array) self.enrollments = value end end - if attributes.key?(:'gender') + if attributes.has_key?(:'gender') self.gender = attributes[:'gender'] end - if attributes.key?(:'graduation_year') + if attributes.has_key?(:'graduation_year') self.graduation_year = attributes[:'graduation_year'] end - if attributes.key?(:'grade') + if attributes.has_key?(:'grade') self.grade = attributes[:'grade'] end - if attributes.key?(:'hispanic_ethnicity') + if attributes.has_key?(:'hispanic_ethnicity') self.hispanic_ethnicity = attributes[:'hispanic_ethnicity'] end - if attributes.key?(:'home_language') + if attributes.has_key?(:'home_language') self.home_language = attributes[:'home_language'] end - if attributes.key?(:'iep_status') + if attributes.has_key?(:'iep_status') self.iep_status = attributes[:'iep_status'] end - if attributes.key?(:'last_modified') + if attributes.has_key?(:'last_modified') self.last_modified = attributes[:'last_modified'] end - if attributes.key?(:'location') + if attributes.has_key?(:'location') self.location = attributes[:'location'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'race') + if attributes.has_key?(:'race') self.race = attributes[:'race'] end - if attributes.key?(:'school') + if attributes.has_key?(:'school') self.school = attributes[:'school'] end - if attributes.key?(:'schools') + if attributes.has_key?(:'schools') if (value = attributes[:'schools']).is_a?(Array) self.schools = value end end - if attributes.key?(:'sis_id') + if attributes.has_key?(:'sis_id') self.sis_id = attributes[:'sis_id'] end - if attributes.key?(:'state_id') + if attributes.has_key?(:'state_id') self.state_id = attributes[:'state_id'] end - if attributes.key?(:'student_number') + if attributes.has_key?(:'student_number') self.student_number = attributes[:'student_number'] end - if attributes.key?(:'unweighted_gpa') + if attributes.has_key?(:'unweighted_gpa') self.unweighted_gpa = attributes[:'unweighted_gpa'] end - if attributes.key?(:'weighted_gpa') + if attributes.has_key?(:'weighted_gpa') self.weighted_gpa = attributes[:'weighted_gpa'] end - if attributes.key?(:'ext') + if attributes.has_key?(:'ext') self.ext = attributes[:'ext'] end end @@ -299,33 +273,48 @@ def initialize(attributes = {}) # @return Array for valid properties with the reasons def list_invalid_properties invalid_properties = Array.new + if !@dob.nil? && @dob !~ Regexp.new(/(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/) + invalid_properties.push('invalid value for "dob", must conform to the pattern /(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/.') + end + invalid_properties end # Check to see if the all the properties in the model are valid # @return true if the model is valid def valid? - ell_status_validator = EnumAttributeValidator.new('Object', ['Y', 'N', '']) + return false if !@dob.nil? && @dob !~ Regexp.new(/(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/) + ell_status_validator = EnumAttributeValidator.new('String', ['Y', 'N', '']) return false unless ell_status_validator.valid?(@ell_status) - gender_validator = EnumAttributeValidator.new('Object', ['M', 'F', 'X', '']) + gender_validator = EnumAttributeValidator.new('String', ['M', 'F', 'X', '']) return false unless gender_validator.valid?(@gender) - 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', '']) + grade_validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) return false unless grade_validator.valid?(@grade) - hispanic_ethnicity_validator = EnumAttributeValidator.new('Object', ['Y', 'N', '']) + hispanic_ethnicity_validator = EnumAttributeValidator.new('String', ['Y', 'N', '']) return false unless hispanic_ethnicity_validator.valid?(@hispanic_ethnicity) - home_language_validator = EnumAttributeValidator.new('Object', ['English', 'Albanian', 'Amharic', 'Arabic', 'Bengali', 'Bosnian', 'Burmese', 'Cantonese', 'Chinese', 'Dutch', 'Farsi', 'French', 'German', 'Hebrew', 'Hindi', 'Hmong', 'Ilocano', 'Japanese', 'Javanese', 'Karen', 'Khmer', 'Korean', 'Laotian', 'Latvian', 'Malay', 'Mandarin', 'Nepali', 'Oromo', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Somali', 'Spanish', 'Swahili', 'Tagalog', 'Tamil', 'Telugu', 'Thai', 'Tigrinya', 'Turkish', 'Ukrainian', 'Urdu', 'Vietnamese', '']) + home_language_validator = EnumAttributeValidator.new('String', ['English', 'Albanian', 'Amharic', 'Arabic', 'Bengali', 'Bosnian', 'Burmese', 'Cantonese', 'Chinese', 'Dutch', 'Farsi', 'French', 'German', 'Hebrew', 'Hindi', 'Hmong', 'Ilocano', 'Japanese', 'Javanese', 'Karen', 'Khmer', 'Korean', 'Laotian', 'Latvian', 'Malay', 'Mandarin', 'Nepali', 'Oromo', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Somali', 'Spanish', 'Swahili', 'Tagalog', 'Tamil', 'Telugu', 'Thai', 'Tigrinya', 'Turkish', 'Ukrainian', 'Urdu', 'Vietnamese', '']) return false unless home_language_validator.valid?(@home_language) - race_validator = EnumAttributeValidator.new('Object', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', '']) + race_validator = EnumAttributeValidator.new('String', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', '']) return false unless race_validator.valid?(@race) true end + # Custom attribute writer method with validation + # @param [Object] dob Value to be assigned + def dob=(dob) + if !dob.nil? && dob !~ Regexp.new(/(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/) + fail ArgumentError, 'invalid value for "dob", must conform to the pattern /(?:[0-9]{1,2})\/([0-9]{1,2})\/([0-9]{4})/.' + end + + @dob = dob + end + # Custom attribute writer method checking allowed values (enum). # @param [Object] ell_status Object to be assigned def ell_status=(ell_status) - validator = EnumAttributeValidator.new('Object', ['Y', 'N', '']) + validator = EnumAttributeValidator.new('String', ['Y', 'N', '']) unless validator.valid?(ell_status) - fail ArgumentError, "invalid value for \"ell_status\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "ell_status", must be one of #{validator.allowable_values}.' end @ell_status = ell_status end @@ -333,9 +322,9 @@ def ell_status=(ell_status) # Custom attribute writer method checking allowed values (enum). # @param [Object] gender Object to be assigned def gender=(gender) - validator = EnumAttributeValidator.new('Object', ['M', 'F', 'X', '']) + validator = EnumAttributeValidator.new('String', ['M', 'F', 'X', '']) unless validator.valid?(gender) - fail ArgumentError, "invalid value for \"gender\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "gender", must be one of #{validator.allowable_values}.' end @gender = gender end @@ -343,9 +332,9 @@ def gender=(gender) # Custom attribute writer method checking allowed values (enum). # @param [Object] grade Object to be assigned def grade=(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', '']) + validator = EnumAttributeValidator.new('String', ['InfantToddler', 'Preschool', 'PreKindergarten', 'TransitionalKindergarten', 'Kindergarten', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12', '13', 'PostGraduate', 'Ungraded', 'Other', '']) unless validator.valid?(grade) - fail ArgumentError, "invalid value for \"grade\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "grade", must be one of #{validator.allowable_values}.' end @grade = grade end @@ -353,9 +342,9 @@ def grade=(grade) # Custom attribute writer method checking allowed values (enum). # @param [Object] hispanic_ethnicity Object to be assigned def hispanic_ethnicity=(hispanic_ethnicity) - validator = EnumAttributeValidator.new('Object', ['Y', 'N', '']) + validator = EnumAttributeValidator.new('String', ['Y', 'N', '']) unless validator.valid?(hispanic_ethnicity) - fail ArgumentError, "invalid value for \"hispanic_ethnicity\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "hispanic_ethnicity", must be one of #{validator.allowable_values}.' end @hispanic_ethnicity = hispanic_ethnicity end @@ -363,9 +352,9 @@ def hispanic_ethnicity=(hispanic_ethnicity) # Custom attribute writer method checking allowed values (enum). # @param [Object] home_language Object to be assigned def home_language=(home_language) - validator = EnumAttributeValidator.new('Object', ['English', 'Albanian', 'Amharic', 'Arabic', 'Bengali', 'Bosnian', 'Burmese', 'Cantonese', 'Chinese', 'Dutch', 'Farsi', 'French', 'German', 'Hebrew', 'Hindi', 'Hmong', 'Ilocano', 'Japanese', 'Javanese', 'Karen', 'Khmer', 'Korean', 'Laotian', 'Latvian', 'Malay', 'Mandarin', 'Nepali', 'Oromo', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Somali', 'Spanish', 'Swahili', 'Tagalog', 'Tamil', 'Telugu', 'Thai', 'Tigrinya', 'Turkish', 'Ukrainian', 'Urdu', 'Vietnamese', '']) + validator = EnumAttributeValidator.new('String', ['English', 'Albanian', 'Amharic', 'Arabic', 'Bengali', 'Bosnian', 'Burmese', 'Cantonese', 'Chinese', 'Dutch', 'Farsi', 'French', 'German', 'Hebrew', 'Hindi', 'Hmong', 'Ilocano', 'Japanese', 'Javanese', 'Karen', 'Khmer', 'Korean', 'Laotian', 'Latvian', 'Malay', 'Mandarin', 'Nepali', 'Oromo', 'Polish', 'Portuguese', 'Punjabi', 'Romanian', 'Russian', 'Samoan', 'Serbian', 'Somali', 'Spanish', 'Swahili', 'Tagalog', 'Tamil', 'Telugu', 'Thai', 'Tigrinya', 'Turkish', 'Ukrainian', 'Urdu', 'Vietnamese', '']) unless validator.valid?(home_language) - fail ArgumentError, "invalid value for \"home_language\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "home_language", must be one of #{validator.allowable_values}.' end @home_language = home_language end @@ -373,9 +362,9 @@ def home_language=(home_language) # Custom attribute writer method checking allowed values (enum). # @param [Object] race Object to be assigned def race=(race) - validator = EnumAttributeValidator.new('Object', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', '']) + validator = EnumAttributeValidator.new('String', ['Caucasian', 'Asian', 'Black or African American', 'American Indian', 'Hawaiian or Other Pacific Islander', 'Two or More Races', 'Unknown', '']) unless validator.valid?(race) - fail ArgumentError, "invalid value for \"race\", must be one of #{validator.allowable_values}." + fail ArgumentError, 'invalid value for "race", must be one of #{validator.allowable_values}.' end @race = race end @@ -420,24 +409,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, created, credentials, district, dob, ell_status, email, enrollments, gender, graduation_year, grade, hispanic_ethnicity, home_language, iep_status, last_modified, location, name, race, school, schools, sis_id, state_id, student_number, unweighted_gpa, weighted_gpa, ext].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -446,9 +428,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -470,7 +450,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -491,7 +471,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -513,11 +494,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -539,5 +516,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/student_object.rb b/lib/clever-ruby/models/student_object.rb index fadee996..4bc610b6 100644 --- a/lib/clever-ruby/models/student_object.rb +++ b/lib/clever-ruby/models/student_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'Student' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::StudentObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::StudentObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/student_response.rb b/lib/clever-ruby/models/student_response.rb index 2c9ae1cb..65891e2b 100644 --- a/lib/clever-ruby/models/student_response.rb +++ b/lib/clever-ruby/models/student_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'Student' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::StudentResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::StudentResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/students_response.rb b/lib/clever-ruby/models/students_response.rb index 9ebb7fd1..c1f2e9e2 100644 --- a/lib/clever-ruby/models/students_response.rb +++ b/lib/clever-ruby/models/students_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::StudentsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::StudentsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/teacher.rb b/lib/clever-ruby/models/teacher.rb index 6ffb6d70..54b3d014 100644 --- a/lib/clever-ruby/models/teacher.rb +++ b/lib/clever-ruby/models/teacher.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -62,105 +63,88 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'created' => :'Object', - :'credentials' => :'Object', - :'district' => :'Object', - :'email' => :'Object', - :'last_modified' => :'Object', - :'name' => :'Object', - :'school' => :'Object', - :'schools' => :'Object', - :'sis_id' => :'Object', - :'state_id' => :'Object', - :'teacher_number' => :'Object', - :'title' => :'Object', + :'id' => :'String', + :'created' => :'String', + :'credentials' => :'Credentials', + :'district' => :'String', + :'email' => :'String', + :'last_modified' => :'String', + :'name' => :'Name', + :'school' => :'String', + :'schools' => :'Array', + :'sis_id' => :'String', + :'state_id' => :'String', + :'teacher_number' => :'String', + :'title' => :'String', :'ext' => :'Object' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'email', - :'state_id', - :'teacher_number', - :'title', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Teacher` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Teacher`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'created') + if attributes.has_key?(:'created') self.created = attributes[:'created'] end - if attributes.key?(:'credentials') + if attributes.has_key?(:'credentials') self.credentials = attributes[:'credentials'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end - if attributes.key?(:'email') + if attributes.has_key?(:'email') self.email = attributes[:'email'] end - if attributes.key?(:'last_modified') + if attributes.has_key?(:'last_modified') self.last_modified = attributes[:'last_modified'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'school') + if attributes.has_key?(:'school') self.school = attributes[:'school'] end - if attributes.key?(:'schools') + if attributes.has_key?(:'schools') if (value = attributes[:'schools']).is_a?(Array) self.schools = value end end - if attributes.key?(:'sis_id') + if attributes.has_key?(:'sis_id') self.sis_id = attributes[:'sis_id'] end - if attributes.key?(:'state_id') + if attributes.has_key?(:'state_id') self.state_id = attributes[:'state_id'] end - if attributes.key?(:'teacher_number') + if attributes.has_key?(:'teacher_number') self.teacher_number = attributes[:'teacher_number'] end - if attributes.key?(:'title') + if attributes.has_key?(:'title') self.title = attributes[:'title'] end - if attributes.key?(:'ext') + if attributes.has_key?(:'ext') self.ext = attributes[:'ext'] end end @@ -206,24 +190,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, created, credentials, district, email, last_modified, name, school, schools, sis_id, state_id, teacher_number, title, ext].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -232,9 +209,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -256,7 +231,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -277,7 +252,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -299,11 +275,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -325,5 +297,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/teacher_object.rb b/lib/clever-ruby/models/teacher_object.rb index 068cda88..09683dd0 100644 --- a/lib/clever-ruby/models/teacher_object.rb +++ b/lib/clever-ruby/models/teacher_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'Teacher' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::TeacherObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::TeacherObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/teacher_response.rb b/lib/clever-ruby/models/teacher_response.rb index 81c67361..0abee2a2 100644 --- a/lib/clever-ruby/models/teacher_response.rb +++ b/lib/clever-ruby/models/teacher_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'Teacher' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::TeacherResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::TeacherResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/teachers_response.rb b/lib/clever-ruby/models/teachers_response.rb index ac9a5939..0fbb6bc7 100644 --- a/lib/clever-ruby/models/teachers_response.rb +++ b/lib/clever-ruby/models/teachers_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::TeachersResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::TeachersResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/term.rb b/lib/clever-ruby/models/term.rb index 05694ec8..f8d9c042 100644 --- a/lib/clever-ruby/models/term.rb +++ b/lib/clever-ruby/models/term.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -35,57 +36,41 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'id' => :'Object', - :'name' => :'Object', - :'start_date' => :'Object', - :'end_date' => :'Object', - :'district' => :'Object' + :'id' => :'String', + :'name' => :'String', + :'start_date' => :'String', + :'end_date' => :'String', + :'district' => :'String' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - :'name', - :'start_date', - :'end_date', - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::Term` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::Term`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'id') + if attributes.has_key?(:'id') self.id = attributes[:'id'] end - if attributes.key?(:'name') + if attributes.has_key?(:'name') self.name = attributes[:'name'] end - if attributes.key?(:'start_date') + if attributes.has_key?(:'start_date') self.start_date = attributes[:'start_date'] end - if attributes.key?(:'end_date') + if attributes.has_key?(:'end_date') self.end_date = attributes[:'end_date'] end - if attributes.key?(:'district') + if attributes.has_key?(:'district') self.district = attributes[:'district'] end end @@ -122,24 +107,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [id, name, start_date, end_date, district].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -148,9 +126,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -172,7 +148,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -193,7 +169,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -215,11 +192,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -241,5 +214,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/term_object.rb b/lib/clever-ruby/models/term_object.rb index 8e2e703d..665bdab6 100644 --- a/lib/clever-ruby/models/term_object.rb +++ b/lib/clever-ruby/models/term_object.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'object' => :'Object' + :'object' => :'Term' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::TermObject` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::TermObject`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'object') + if attributes.has_key?(:'object') self.object = attributes[:'object'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [object].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/term_response.rb b/lib/clever-ruby/models/term_response.rb index 55ca5b22..12e0d6e4 100644 --- a/lib/clever-ruby/models/term_response.rb +++ b/lib/clever-ruby/models/term_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -23,34 +24,21 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object' + :'data' => :'Term' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::TermResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::TermResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') self.data = attributes[:'data'] end end @@ -83,24 +71,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -109,9 +90,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -133,7 +112,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -154,7 +133,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -176,11 +156,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -202,5 +178,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/models/terms_response.rb b/lib/clever-ruby/models/terms_response.rb index 8147cc47..e9115dcf 100644 --- a/lib/clever-ruby/models/terms_response.rb +++ b/lib/clever-ruby/models/terms_response.rb @@ -6,7 +6,8 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end require 'date' @@ -26,41 +27,28 @@ def self.attribute_map end # Attribute type mapping. - def self.openapi_types + def self.swagger_types { - :'data' => :'Object', - :'links' => :'Object' + :'data' => :'Array', + :'links' => :'Array' } end - # List of attributes with nullable: true - def self.openapi_nullable - Set.new([ - ]) - end - # Initializes the object # @param [Hash] attributes Model attributes in the form of hash def initialize(attributes = {}) - if (!attributes.is_a?(Hash)) - fail ArgumentError, "The input argument (attributes) must be a hash in `Clever::TermsResponse` initialize method" - end + return unless attributes.is_a?(Hash) - # check to see if the attribute exists and convert string to symbol for hash key - attributes = attributes.each_with_object({}) { |(k, v), h| - if (!self.class.attribute_map.key?(k.to_sym)) - fail ArgumentError, "`#{k}` is not a valid attribute in `Clever::TermsResponse`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect - end - h[k.to_sym] = v - } + # convert string to symbol for hash key + attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } - if attributes.key?(:'data') + if attributes.has_key?(:'data') if (value = attributes[:'data']).is_a?(Array) self.data = value end end - if attributes.key?(:'links') + if attributes.has_key?(:'links') if (value = attributes[:'links']).is_a?(Array) self.links = value end @@ -96,24 +84,17 @@ def eql?(o) end # Calculates hash code according to all attributes. - # @return [Integer] Hash code + # @return [Fixnum] Hash code def hash [data, links].hash end - # Builds the object from hash - # @param [Hash] attributes Model attributes in the form of hash - # @return [Object] Returns the model itself - def self.build_from_hash(attributes) - new.build_from_hash(attributes) - end - # Builds the object from hash # @param [Hash] attributes Model attributes in the form of hash # @return [Object] Returns the model itself def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) - self.class.openapi_types.each_pair do |key, type| + self.class.swagger_types.each_pair do |key, type| if type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not @@ -122,9 +103,7 @@ def build_from_hash(attributes) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) - elsif attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) - self.send("#{key}=", nil) - end + end # or else data not found in attributes(hash), not an issue as the data can be optional end self @@ -146,7 +125,7 @@ def _deserialize(type, value) value.to_i when :Float value.to_f - when :Boolean + when :BOOLEAN if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else @@ -167,7 +146,8 @@ def _deserialize(type, value) end end else # model - Clever.const_get(type).build_from_hash(value) + temp_model = Clever.const_get(type).new + temp_model.build_from_hash(value) end end @@ -189,11 +169,7 @@ def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) - if value.nil? - is_nullable = self.class.openapi_nullable.include?(attr) - next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) - end - + next if value.nil? hash[param] = _to_hash(value) end hash @@ -215,5 +191,7 @@ def _to_hash(value) else value end - end end + end + + end end diff --git a/lib/clever-ruby/version.rb b/lib/clever-ruby/version.rb index 74212883..2affac53 100644 --- a/lib/clever-ruby/version.rb +++ b/lib/clever-ruby/version.rb @@ -6,9 +6,10 @@ OpenAPI spec version: 2.1.0 Generated by: https://github.com/swagger-api/swagger-codegen.git -Swagger Codegen version: 3.0.51 +Swagger Codegen version: 2.4.37 + =end module Clever - VERSION = '2.1.4' + VERSION = '2.1.6.beta1' end diff --git a/override/override.sh b/override/override.sh index e7d90759..933d9711 100755 --- a/override/override.sh +++ b/override/override.sh @@ -11,9 +11,6 @@ cp override/models/* lib/clever-ruby/models/ # Override the parsing library with one that's aware of the inheritence cp override/api_client.rb lib/clever-ruby/ -# Add Addressable to the gem manifest as a dependency -sed -i '' "28s/^/ s.add_runtime_dependency 'addressable', '~> 2.3', '>= 2.3.0'\n/" ./clever-ruby.gemspec - # Rename references of SwaggerClient to Clever git grep -l 'SwaggerClient' -- './*' ':(exclude)override/override.sh' | xargs sed -i "" 's/SwaggerClient/Clever/g' git grep -l 'swagger_client' -- './*' ':(exclude)override/override.sh' | xargs sed -i "" 's/swagger_client/clever-ruby/g'