diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 227bb14..ceef11c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -26,6 +26,7 @@ jobs: python -m pip install --upgrade pip pip install flake8 pytest if [ -f requirements.txt ]; then pip install -r requirements.txt; fi + if [ -f test-requirements.txt ]; then pip install -r test-requirements.txt; fi - name: Lint with flake8 run: | # stop the build if there are Python syntax errors or undefined names diff --git a/.gitignore b/.gitignore index 43995bd..e2f0671 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,9 @@ target/ #Ipython Notebook .ipynb_checkpoints + +# Environment variables +.envrc + +# Visual Studio Code +.vscode/ diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 735f7cb..6261255 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -22,4 +22,10 @@ pytest-3.8: image: python:3.8-alpine pytest-3.9: extends: .pytest - image: python:3.9-alpine \ No newline at end of file + image: python:3.9-alpine +pytest-3.10: + extends: .pytest + image: python:3.10-alpine +pytest-3.11: + extends: .pytest + image: python:3.11-alpine diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 5d87460..f33536d 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -6,17 +6,18 @@ README.md docs/ACL.md docs/ACLIdsInner.md docs/ACLIdsInnerOneOf.md -docs/ClassLessons.md -docs/ClassStudents.md -docs/ClassSubject.md -docs/ClassSubjectOneOf.md docs/ClassesApi.md docs/Contact.md +docs/ContactDetails.md +docs/ContactDetailsEmails.md docs/DateTimeObject.md docs/Deletion.md docs/DeletionsApi.md +docs/EducationDetails.md docs/Employee.md +docs/EmployeeContactDetails.md docs/EmployeesApi.md +docs/GetSchool200Response.md docs/GetSchoolAcl200Response.md docs/GetSchoolClass200Response.md docs/GetSchoolMeta200Response.md @@ -32,7 +33,6 @@ docs/ListSchoolStudents200Response.md docs/ListSchoolSubjects200Response.md docs/ListSchools200Response.md docs/Meta.md -docs/ModelClass.md docs/Pagination.md docs/Permission.md docs/RequestSchoolAccess200Response.md @@ -40,12 +40,19 @@ docs/RequestSchoolAccessRequest.md docs/School.md docs/SchoolAddress.md docs/SchoolAddressAddressCountry.md +docs/SchoolClass.md +docs/SchoolClassEmployees.md +docs/SchoolClassLessons.md +docs/SchoolClassStudents.md +docs/SchoolClassSubject.md +docs/SchoolClassSubjectOneOf.md docs/SchoolExtended.md docs/SchoolMeta.md docs/SchoolRegion.md docs/SchoolRegionIdentifiers.md docs/SchoolsApi.md docs/Student.md +docs/StudentEducationDetails.md docs/StudentsApi.md docs/Subject.md docs/SubjectsApi.md @@ -58,17 +65,18 @@ test/__init__.py test/test_acl.py test/test_acl_ids_inner.py test/test_acl_ids_inner_one_of.py -test/test_class_lessons.py -test/test_class_students.py -test/test_class_subject.py -test/test_class_subject_one_of.py test/test_classes_api.py test/test_contact.py +test/test_contact_details.py +test/test_contact_details_emails.py test/test_date_time_object.py test/test_deletion.py test/test_deletions_api.py +test/test_education_details.py test/test_employee.py +test/test_employee_contact_details.py test/test_employees_api.py +test/test_get_school200_response.py test/test_get_school_acl200_response.py test/test_get_school_class200_response.py test/test_get_school_meta200_response.py @@ -84,7 +92,6 @@ test/test_list_school_students200_response.py test/test_list_school_subjects200_response.py test/test_list_schools200_response.py test/test_meta.py -test/test_model_class.py test/test_pagination.py test/test_permission.py test/test_request_school_access200_response.py @@ -92,12 +99,19 @@ test/test_request_school_access_request.py test/test_school.py test/test_school_address.py test/test_school_address_address_country.py +test/test_school_class.py +test/test_school_class_employees.py +test/test_school_class_lessons.py +test/test_school_class_students.py +test/test_school_class_subject.py +test/test_school_class_subject_one_of.py test/test_school_extended.py test/test_school_meta.py test/test_school_region.py test/test_school_region_identifiers.py test/test_schools_api.py test/test_student.py +test/test_student_education_details.py test/test_students_api.py test/test_subject.py test/test_subjects_api.py @@ -119,14 +133,15 @@ wonde/models/__init__.py wonde/models/acl.py wonde/models/acl_ids_inner.py wonde/models/acl_ids_inner_one_of.py -wonde/models/class_lessons.py -wonde/models/class_students.py -wonde/models/class_subject.py -wonde/models/class_subject_one_of.py wonde/models/contact.py +wonde/models/contact_details.py +wonde/models/contact_details_emails.py wonde/models/date_time_object.py wonde/models/deletion.py +wonde/models/education_details.py wonde/models/employee.py +wonde/models/employee_contact_details.py +wonde/models/get_school200_response.py wonde/models/get_school_acl200_response.py wonde/models/get_school_class200_response.py wonde/models/get_school_meta200_response.py @@ -141,7 +156,6 @@ wonde/models/list_school_students200_response.py wonde/models/list_school_subjects200_response.py wonde/models/list_schools200_response.py wonde/models/meta.py -wonde/models/model_class.py wonde/models/pagination.py wonde/models/permission.py wonde/models/request_school_access200_response.py @@ -149,10 +163,18 @@ wonde/models/request_school_access_request.py wonde/models/school.py wonde/models/school_address.py wonde/models/school_address_address_country.py +wonde/models/school_class.py +wonde/models/school_class_employees.py +wonde/models/school_class_lessons.py +wonde/models/school_class_students.py +wonde/models/school_class_subject.py +wonde/models/school_class_subject_one_of.py wonde/models/school_extended.py wonde/models/school_meta.py wonde/models/school_region.py wonde/models/school_region_identifiers.py wonde/models/student.py +wonde/models/student_education_details.py wonde/models/subject.py +wonde/py.typed wonde/rest.py diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index cd802a1..73a86b1 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -6.6.0 \ No newline at end of file +7.0.1 \ No newline at end of file diff --git a/README.md b/README.md index ba8b2f4..6dcc598 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ This Python package is automatically generated by the [OpenAPI Generator](https: - API version: 1.0.0 - Package version: 0.1.0 -- Build package: org.openapitools.codegen.languages.PythonNextgenClientCodegen +- Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements. @@ -88,11 +88,11 @@ with wonde.ApiClient(configuration) as api_client: try: # Get specific class for a school - api_response = api_instance.schools_school_id_classes_class_id_get(school_id, class_id, include=include) - print("The response of ClassesApi->schools_school_id_classes_class_id_get:\n") + api_response = api_instance.get_school_class(school_id, class_id, include=include) + print("The response of ClassesApi->get_school_class:\n") pprint(api_response) except ApiException as e: - print("Exception when calling ClassesApi->schools_school_id_classes_class_id_get: %s\n" % e) + print("Exception when calling ClassesApi->get_school_class: %s\n" % e) ``` @@ -102,30 +102,30 @@ All URIs are relative to *https://api.wonde.com/v1.0* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*ClassesApi* | [**schools_school_id_classes_class_id_get**](docs/ClassesApi.md#schools_school_id_classes_class_id_get) | **GET** /schools/{school_id}/classes/{class_id} | Get specific class for a school -*ClassesApi* | [**schools_school_id_classes_get**](docs/ClassesApi.md#schools_school_id_classes_get) | **GET** /schools/{school_id}/classes | Get all classes for a school -*DeletionsApi* | [**schools_school_id_deletions_get**](docs/DeletionsApi.md#schools_school_id_deletions_get) | **GET** /schools/{school_id}/deletions | Get deletions for a school -*EmployeesApi* | [**schools_school_id_employees_employee_id_get**](docs/EmployeesApi.md#schools_school_id_employees_employee_id_get) | **GET** /schools/{school_id}/employees/{employee_id} | Get specific employee for a school -*EmployeesApi* | [**schools_school_id_employees_get**](docs/EmployeesApi.md#schools_school_id_employees_get) | **GET** /schools/{school_id}/employees | Get all employees for a school -*LessonsApi* | [**get_school_lesson_by_id**](docs/LessonsApi.md#get_school_lesson_by_id) | **GET** /schools/{school_id}/lessons/{lesson_id} | Returns a specific lesson for a specific school -*LessonsApi* | [**get_school_lessons**](docs/LessonsApi.md#get_school_lessons) | **GET** /schools/{school_id}/lessons | Returns a list of lessons for a specific school +*ClassesApi* | [**get_school_class**](docs/ClassesApi.md#get_school_class) | **GET** /schools/{school_id}/classes/{class_id} | Get specific class for a school +*ClassesApi* | [**list_school_classes**](docs/ClassesApi.md#list_school_classes) | **GET** /schools/{school_id}/classes | Get all classes for a school +*DeletionsApi* | [**list_school_deletions**](docs/DeletionsApi.md#list_school_deletions) | **GET** /schools/{school_id}/deletions | Get deletions for a school +*EmployeesApi* | [**get_school_employee**](docs/EmployeesApi.md#get_school_employee) | **GET** /schools/{school_id}/employees/{employee_id} | Get specific employee for a school +*EmployeesApi* | [**list_school_employees**](docs/EmployeesApi.md#list_school_employees) | **GET** /schools/{school_id}/employees | Get all employees for a school +*LessonsApi* | [**get_school_lesson**](docs/LessonsApi.md#get_school_lesson) | **GET** /schools/{school_id}/lessons/{lesson_id} | Returns a specific lesson for a specific school +*LessonsApi* | [**list_school_lessons**](docs/LessonsApi.md#list_school_lessons) | **GET** /schools/{school_id}/lessons | Returns a list of lessons for a specific school *SchoolsApi* | [**get_school**](docs/SchoolsApi.md#get_school) | **GET** /schools/{school_id} | Retrieve a specific school -*SchoolsApi* | [**meta_schools_school_id_acl_get**](docs/SchoolsApi.md#meta_schools_school_id_acl_get) | **GET** /meta/schools/{school_id}/acl | Retrieve the access control list applied to a school -*SchoolsApi* | [**meta_schools_school_id_get**](docs/SchoolsApi.md#meta_schools_school_id_get) | **GET** /meta/schools/{school_id} | Retrieve meta data for a school -*SchoolsApi* | [**meta_schools_school_id_permissions_get**](docs/SchoolsApi.md#meta_schools_school_id_permissions_get) | **GET** /meta/schools/{school_id}/permissions | Retrieve the permissions applied to a school -*SchoolsApi* | [**schools_all_get**](docs/SchoolsApi.md#schools_all_get) | **GET** /schools/all | Retrieve all schools -*SchoolsApi* | [**schools_approved_get**](docs/SchoolsApi.md#schools_approved_get) | **GET** /schools/approved | Retrieve all approved schools -*SchoolsApi* | [**schools_audited_get**](docs/SchoolsApi.md#schools_audited_get) | **GET** /schools/audited | Retrieve all audited schools -*SchoolsApi* | [**schools_declined_get**](docs/SchoolsApi.md#schools_declined_get) | **GET** /schools/declined | Retrieve all schools with declined access -*SchoolsApi* | [**schools_offline_get**](docs/SchoolsApi.md#schools_offline_get) | **GET** /schools/offline | Retrieve all offline schools -*SchoolsApi* | [**schools_pending_get**](docs/SchoolsApi.md#schools_pending_get) | **GET** /schools/pending | Retrieve all schools with pending access request -*SchoolsApi* | [**schools_revoked_get**](docs/SchoolsApi.md#schools_revoked_get) | **GET** /schools/revoked | Retrieve all schools with revoked access -*SchoolsApi* | [**schools_school_id_request_access_post**](docs/SchoolsApi.md#schools_school_id_request_access_post) | **POST** /schools/{school_id}/request-access | Request access to a school -*SchoolsApi* | [**schools_school_id_revoke_access_delete**](docs/SchoolsApi.md#schools_school_id_revoke_access_delete) | **DELETE** /schools/{school_id}/revoke-access | Revoke access to a school -*StudentsApi* | [**get_student**](docs/StudentsApi.md#get_student) | **GET** /schools/{school_id}/students/{student_id} | Retrieve a specific student in a specific school -*StudentsApi* | [**list_students**](docs/StudentsApi.md#list_students) | **GET** /schools/{school_id}/students | Retrieve a list of students for a specific school -*SubjectsApi* | [**get_subject**](docs/SubjectsApi.md#get_subject) | **GET** /schools/{school_id}/subjects/{subject_id} | Retrieve a specific subject for a school -*SubjectsApi* | [**get_subjects**](docs/SubjectsApi.md#get_subjects) | **GET** /schools/{school_id}/subjects | Retrieve subjects for a school +*SchoolsApi* | [**get_school_acl**](docs/SchoolsApi.md#get_school_acl) | **GET** /meta/schools/{school_id}/acl | Retrieve the access control list applied to a school +*SchoolsApi* | [**get_school_meta**](docs/SchoolsApi.md#get_school_meta) | **GET** /meta/schools/{school_id} | Retrieve meta data for a school +*SchoolsApi* | [**get_school_permissions**](docs/SchoolsApi.md#get_school_permissions) | **GET** /meta/schools/{school_id}/permissions | Retrieve the permissions applied to a school +*SchoolsApi* | [**list_schools**](docs/SchoolsApi.md#list_schools) | **GET** /schools/all | Retrieve all schools +*SchoolsApi* | [**list_schools_approved**](docs/SchoolsApi.md#list_schools_approved) | **GET** /schools | Retrieve all approved schools +*SchoolsApi* | [**list_schools_audited**](docs/SchoolsApi.md#list_schools_audited) | **GET** /schools/audited | Retrieve all audited schools +*SchoolsApi* | [**list_schools_declined**](docs/SchoolsApi.md#list_schools_declined) | **GET** /schools/declined | Retrieve all schools with declined access +*SchoolsApi* | [**list_schools_offline**](docs/SchoolsApi.md#list_schools_offline) | **GET** /schools/offline | Retrieve all offline schools +*SchoolsApi* | [**list_schools_pending**](docs/SchoolsApi.md#list_schools_pending) | **GET** /schools/pending | Retrieve all schools with pending access request +*SchoolsApi* | [**list_schools_revoked**](docs/SchoolsApi.md#list_schools_revoked) | **GET** /schools/revoked | Retrieve all schools with revoked access +*SchoolsApi* | [**request_school_access**](docs/SchoolsApi.md#request_school_access) | **POST** /schools/{school_id}/request-access | Request access to a school +*SchoolsApi* | [**revoke_school_access**](docs/SchoolsApi.md#revoke_school_access) | **DELETE** /schools/{school_id}/revoke-access | Revoke access to a school +*StudentsApi* | [**get_school_student**](docs/StudentsApi.md#get_school_student) | **GET** /schools/{school_id}/students/{student_id} | Retrieve a specific student in a specific school +*StudentsApi* | [**list_school_students**](docs/StudentsApi.md#list_school_students) | **GET** /schools/{school_id}/students | Retrieve a list of students for a specific school +*SubjectsApi* | [**get_school_subject**](docs/SubjectsApi.md#get_school_subject) | **GET** /schools/{school_id}/subjects/{subject_id} | Retrieve a specific subject for a school +*SubjectsApi* | [**list_school_subjects**](docs/SubjectsApi.md#list_school_subjects) | **GET** /schools/{school_id}/subjects | Retrieve subjects for a school ## Documentation For Models @@ -133,41 +133,48 @@ Class | Method | HTTP request | Description - [ACL](docs/ACL.md) - [ACLIdsInner](docs/ACLIdsInner.md) - [ACLIdsInnerOneOf](docs/ACLIdsInnerOneOf.md) - - [ClassLessons](docs/ClassLessons.md) - - [ClassStudents](docs/ClassStudents.md) - - [ClassSubject](docs/ClassSubject.md) - - [ClassSubjectOneOf](docs/ClassSubjectOneOf.md) - [Contact](docs/Contact.md) + - [ContactDetails](docs/ContactDetails.md) + - [ContactDetailsEmails](docs/ContactDetailsEmails.md) - [DateTimeObject](docs/DateTimeObject.md) - [Deletion](docs/Deletion.md) + - [EducationDetails](docs/EducationDetails.md) - [Employee](docs/Employee.md) - - [GetSchoolLessons200Response](docs/GetSchoolLessons200Response.md) - - [GetSchoolLessons200ResponseMeta](docs/GetSchoolLessons200ResponseMeta.md) - - [GetSubjects200Response](docs/GetSubjects200Response.md) + - [EmployeeContactDetails](docs/EmployeeContactDetails.md) + - [GetSchool200Response](docs/GetSchool200Response.md) + - [GetSchoolAcl200Response](docs/GetSchoolAcl200Response.md) + - [GetSchoolClass200Response](docs/GetSchoolClass200Response.md) + - [GetSchoolMeta200Response](docs/GetSchoolMeta200Response.md) + - [GetSchoolPermissions200Response](docs/GetSchoolPermissions200Response.md) - [Lesson](docs/Lesson.md) - - [ListStudents200Response](docs/ListStudents200Response.md) + - [ListSchoolClasses200Response](docs/ListSchoolClasses200Response.md) + - [ListSchoolDeletions200Response](docs/ListSchoolDeletions200Response.md) + - [ListSchoolEmployees200Response](docs/ListSchoolEmployees200Response.md) + - [ListSchoolLessons200Response](docs/ListSchoolLessons200Response.md) + - [ListSchoolLessons200ResponseMeta](docs/ListSchoolLessons200ResponseMeta.md) + - [ListSchoolStudents200Response](docs/ListSchoolStudents200Response.md) + - [ListSchoolSubjects200Response](docs/ListSchoolSubjects200Response.md) + - [ListSchools200Response](docs/ListSchools200Response.md) - [Meta](docs/Meta.md) - - [MetaSchoolsSchoolIdAclGet200Response](docs/MetaSchoolsSchoolIdAclGet200Response.md) - - [MetaSchoolsSchoolIdGet200Response](docs/MetaSchoolsSchoolIdGet200Response.md) - - [MetaSchoolsSchoolIdPermissionsGet200Response](docs/MetaSchoolsSchoolIdPermissionsGet200Response.md) - - [ModelClass](docs/ModelClass.md) - [Pagination](docs/Pagination.md) - [Permission](docs/Permission.md) + - [RequestSchoolAccess200Response](docs/RequestSchoolAccess200Response.md) + - [RequestSchoolAccessRequest](docs/RequestSchoolAccessRequest.md) - [School](docs/School.md) - [SchoolAddress](docs/SchoolAddress.md) - [SchoolAddressAddressCountry](docs/SchoolAddressAddressCountry.md) + - [SchoolClass](docs/SchoolClass.md) + - [SchoolClassEmployees](docs/SchoolClassEmployees.md) + - [SchoolClassLessons](docs/SchoolClassLessons.md) + - [SchoolClassStudents](docs/SchoolClassStudents.md) + - [SchoolClassSubject](docs/SchoolClassSubject.md) + - [SchoolClassSubjectOneOf](docs/SchoolClassSubjectOneOf.md) - [SchoolExtended](docs/SchoolExtended.md) - [SchoolMeta](docs/SchoolMeta.md) - [SchoolRegion](docs/SchoolRegion.md) - [SchoolRegionIdentifiers](docs/SchoolRegionIdentifiers.md) - - [SchoolsAllGet200Response](docs/SchoolsAllGet200Response.md) - - [SchoolsSchoolIdClassesClassIdGet200Response](docs/SchoolsSchoolIdClassesClassIdGet200Response.md) - - [SchoolsSchoolIdClassesGet200Response](docs/SchoolsSchoolIdClassesGet200Response.md) - - [SchoolsSchoolIdDeletionsGet200Response](docs/SchoolsSchoolIdDeletionsGet200Response.md) - - [SchoolsSchoolIdEmployeesGet200Response](docs/SchoolsSchoolIdEmployeesGet200Response.md) - - [SchoolsSchoolIdRequestAccessPost200Response](docs/SchoolsSchoolIdRequestAccessPost200Response.md) - - [SchoolsSchoolIdRequestAccessPostRequest](docs/SchoolsSchoolIdRequestAccessPostRequest.md) - [Student](docs/Student.md) + - [StudentEducationDetails](docs/StudentEducationDetails.md) - [Subject](docs/Subject.md) @@ -188,3 +195,7 @@ Authentication schemes defined for the API: ## Author + + + + diff --git a/docs/ClassSubjectOneOf.md b/docs/ClassSubjectOneOf.md deleted file mode 100644 index 4b5c74b..0000000 --- a/docs/ClassSubjectOneOf.md +++ /dev/null @@ -1,28 +0,0 @@ -# ClassSubjectOneOf - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Subject**](Subject.md) | | [optional] - -## Example - -```python -from wonde.models.class_subject_one_of import ClassSubjectOneOf - -# TODO update the JSON string below -json = "{}" -# create an instance of ClassSubjectOneOf from a JSON string -class_subject_one_of_instance = ClassSubjectOneOf.from_json(json) -# print the JSON string representation of the object -print ClassSubjectOneOf.to_json() - -# convert the object into a dict -class_subject_one_of_dict = class_subject_one_of_instance.to_dict() -# create an instance of ClassSubjectOneOf from a dict -class_subject_one_of_form_dict = class_subject_one_of.from_dict(class_subject_one_of_dict) -``` -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - - diff --git a/docs/ClassesApi.md b/docs/ClassesApi.md index 9c21bf2..eb050ba 100644 --- a/docs/ClassesApi.md +++ b/docs/ClassesApi.md @@ -65,6 +65,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -94,7 +95,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_school_classes** -> ListSchoolClasses200Response list_school_classes(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, has_students=has_students, has_lessons=has_lessons, class_name=class_name, class_subject=class_subject) +> ListSchoolClasses200Response list_school_classes(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, has_students=has_students, has_lessons=has_lessons, class_name=class_name, class_subject=class_subject) Get all classes for a school @@ -140,6 +141,8 @@ with wonde.ApiClient(configuration) as api_client: updated_after = '2013-10-20' # date | Return rows modified after date (optional) updated_before = '2013-10-20' # date | Return rows modified before date (optional) per_page = 56 # int | Amount of rows to return (optional) + page = 56 # int | Page offset for offset-paginated results. (optional) + cursor = 'cursor_example' # str | Page cursor for cursor-paginated results. (optional) include = 'include_example' # str | Comma separated list of objects to include (optional) has_students = True # bool | Only get classes that have students (optional) has_lessons = True # bool | Only get classes that have lessons (optional) @@ -148,7 +151,7 @@ with wonde.ApiClient(configuration) as api_client: try: # Get all classes for a school - api_response = api_instance.list_school_classes(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, has_students=has_students, has_lessons=has_lessons, class_name=class_name, class_subject=class_subject) + api_response = api_instance.list_school_classes(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, has_students=has_students, has_lessons=has_lessons, class_name=class_name, class_subject=class_subject) print("The response of ClassesApi->list_school_classes:\n") pprint(api_response) except Exception as e: @@ -156,6 +159,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -164,6 +168,8 @@ Name | Type | Description | Notes **updated_after** | **date**| Return rows modified after date | [optional] **updated_before** | **date**| Return rows modified before date | [optional] **per_page** | **int**| Amount of rows to return | [optional] + **page** | **int**| Page offset for offset-paginated results. | [optional] + **cursor** | **str**| Page cursor for cursor-paginated results. | [optional] **include** | **str**| Comma separated list of objects to include | [optional] **has_students** | **bool**| Only get classes that have students | [optional] **has_lessons** | **bool**| Only get classes that have lessons | [optional] diff --git a/docs/ContactDetails.md b/docs/ContactDetails.md new file mode 100644 index 0000000..66dbb0b --- /dev/null +++ b/docs/ContactDetails.md @@ -0,0 +1,28 @@ +# ContactDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**emails** | [**ContactDetailsEmails**](ContactDetailsEmails.md) | | [optional] + +## Example + +```python +from wonde.models.contact_details import ContactDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of ContactDetails from a JSON string +contact_details_instance = ContactDetails.from_json(json) +# print the JSON string representation of the object +print ContactDetails.to_json() + +# convert the object into a dict +contact_details_dict = contact_details_instance.to_dict() +# create an instance of ContactDetails from a dict +contact_details_form_dict = contact_details.from_dict(contact_details_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ContactDetailsEmails.md b/docs/ContactDetailsEmails.md new file mode 100644 index 0000000..c37d612 --- /dev/null +++ b/docs/ContactDetailsEmails.md @@ -0,0 +1,28 @@ +# ContactDetailsEmails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**email** | **str** | | [optional] + +## Example + +```python +from wonde.models.contact_details_emails import ContactDetailsEmails + +# TODO update the JSON string below +json = "{}" +# create an instance of ContactDetailsEmails from a JSON string +contact_details_emails_instance = ContactDetailsEmails.from_json(json) +# print the JSON string representation of the object +print ContactDetailsEmails.to_json() + +# convert the object into a dict +contact_details_emails_dict = contact_details_emails_instance.to_dict() +# create an instance of ContactDetailsEmails from a dict +contact_details_emails_form_dict = contact_details_emails.from_dict(contact_details_emails_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DeletionsApi.md b/docs/DeletionsApi.md index 283d059..42f305c 100644 --- a/docs/DeletionsApi.md +++ b/docs/DeletionsApi.md @@ -68,6 +68,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/EducationDetails.md b/docs/EducationDetails.md new file mode 100644 index 0000000..5997b2b --- /dev/null +++ b/docs/EducationDetails.md @@ -0,0 +1,29 @@ +# EducationDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**current_nc_year** | **str** | | [optional] +**local_upn** | **str** | | [optional] + +## Example + +```python +from wonde.models.education_details import EducationDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of EducationDetails from a JSON string +education_details_instance = EducationDetails.from_json(json) +# print the JSON string representation of the object +print EducationDetails.to_json() + +# convert the object into a dict +education_details_dict = education_details_instance.to_dict() +# create an instance of EducationDetails from a dict +education_details_form_dict = education_details.from_dict(education_details_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/Employee.md b/docs/Employee.md index 730f1fd..c5156a5 100644 --- a/docs/Employee.md +++ b/docs/Employee.md @@ -15,10 +15,11 @@ Name | Type | Description | Notes **legal_surname** | **str** | Employee's legal surname. | [optional] **legal_forename** | **str** | Employee's legal forename. | [optional] **gender** | **str** | Employee's gender. (male|female) | [optional] -**date_of_birth** | **datetime** | Employee's date of birth. | [optional] +**date_of_birth** | **date** | Employee's date of birth. | [optional] **restored_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] **created_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] **updated_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] +**contact_details** | [**EmployeeContactDetails**](EmployeeContactDetails.md) | | [optional] ## Example diff --git a/docs/EmployeeContactDetails.md b/docs/EmployeeContactDetails.md new file mode 100644 index 0000000..5a61d54 --- /dev/null +++ b/docs/EmployeeContactDetails.md @@ -0,0 +1,28 @@ +# EmployeeContactDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**ContactDetails**](ContactDetails.md) | | [optional] + +## Example + +```python +from wonde.models.employee_contact_details import EmployeeContactDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of EmployeeContactDetails from a JSON string +employee_contact_details_instance = EmployeeContactDetails.from_json(json) +# print the JSON string representation of the object +print EmployeeContactDetails.to_json() + +# convert the object into a dict +employee_contact_details_dict = employee_contact_details_instance.to_dict() +# create an instance of EmployeeContactDetails from a dict +employee_contact_details_form_dict = employee_contact_details.from_dict(employee_contact_details_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EmployeesApi.md b/docs/EmployeesApi.md index 136ff92..9d11776 100644 --- a/docs/EmployeesApi.md +++ b/docs/EmployeesApi.md @@ -66,6 +66,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -94,7 +95,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_school_employees** -> ListSchoolEmployees200Response list_school_employees(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, employment_start_before=employment_start_before, employment_start_after=employment_start_after, has_role=has_role, has_contract=has_contract, has_class=has_class, has_group=has_group, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_mis_ids=only_mis_ids) +> ListSchoolEmployees200Response list_school_employees(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, employment_start_before=employment_start_before, employment_start_after=employment_start_after, has_role=has_role, has_contract=has_contract, has_class=has_class, has_group=has_group, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_mis_ids=only_mis_ids) Get all employees for a school @@ -140,6 +141,8 @@ with wonde.ApiClient(configuration) as api_client: updated_after = '2013-10-20' # date | Return rows modified after date (optional) updated_before = '2013-10-20' # date | Return rows modified before date (optional) per_page = 56 # int | Amount of rows to return (optional) + page = 56 # int | Page offset for offset-paginated results. (optional) + cursor = 'cursor_example' # str | Page cursor for cursor-paginated results. (optional) include = 'include_example' # str | Comma separated list of objects to include (optional) employment_start_before = '2013-10-20' # date | Get employees who have started before a date (optional) employment_start_after = '2013-10-20' # date | Get employees who have started after a date (optional) @@ -153,7 +156,7 @@ with wonde.ApiClient(configuration) as api_client: try: # Get all employees for a school - api_response = api_instance.list_school_employees(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, employment_start_before=employment_start_before, employment_start_after=employment_start_after, has_role=has_role, has_contract=has_contract, has_class=has_class, has_group=has_group, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_mis_ids=only_mis_ids) + api_response = api_instance.list_school_employees(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, employment_start_before=employment_start_before, employment_start_after=employment_start_after, has_role=has_role, has_contract=has_contract, has_class=has_class, has_group=has_group, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_mis_ids=only_mis_ids) print("The response of EmployeesApi->list_school_employees:\n") pprint(api_response) except Exception as e: @@ -161,6 +164,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -169,6 +173,8 @@ Name | Type | Description | Notes **updated_after** | **date**| Return rows modified after date | [optional] **updated_before** | **date**| Return rows modified before date | [optional] **per_page** | **int**| Amount of rows to return | [optional] + **page** | **int**| Page offset for offset-paginated results. | [optional] + **cursor** | **str**| Page cursor for cursor-paginated results. | [optional] **include** | **str**| Comma separated list of objects to include | [optional] **employment_start_before** | **date**| Get employees who have started before a date | [optional] **employment_start_after** | **date**| Get employees who have started after a date | [optional] diff --git a/docs/GetSchool200Response.md b/docs/GetSchool200Response.md new file mode 100644 index 0000000..81c815e --- /dev/null +++ b/docs/GetSchool200Response.md @@ -0,0 +1,28 @@ +# GetSchool200Response + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**School**](School.md) | | [optional] + +## Example + +```python +from wonde.models.get_school200_response import GetSchool200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetSchool200Response from a JSON string +get_school200_response_instance = GetSchool200Response.from_json(json) +# print the JSON string representation of the object +print GetSchool200Response.to_json() + +# convert the object into a dict +get_school200_response_dict = get_school200_response_instance.to_dict() +# create an instance of GetSchool200Response from a dict +get_school200_response_form_dict = get_school200_response.from_dict(get_school200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/GetSchoolClass200Response.md b/docs/GetSchoolClass200Response.md index 437433b..a6c7cde 100644 --- a/docs/GetSchoolClass200Response.md +++ b/docs/GetSchoolClass200Response.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**ModelClass**](ModelClass.md) | | [optional] +**data** | [**SchoolClass**](SchoolClass.md) | | [optional] **meta** | [**Meta**](Meta.md) | | [optional] ## Example diff --git a/docs/LessonsApi.md b/docs/LessonsApi.md index 97c007b..14b26f4 100644 --- a/docs/LessonsApi.md +++ b/docs/LessonsApi.md @@ -64,6 +64,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -152,6 +153,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/ListSchoolClasses200Response.md b/docs/ListSchoolClasses200Response.md index 4e46376..55dcdda 100644 --- a/docs/ListSchoolClasses200Response.md +++ b/docs/ListSchoolClasses200Response.md @@ -4,7 +4,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**data** | [**List[ModelClass]**](ModelClass.md) | | [optional] +**data** | [**List[SchoolClass]**](SchoolClass.md) | | [optional] **meta** | [**Meta**](Meta.md) | | [optional] ## Example diff --git a/docs/ListSchoolEmployees200Response.md b/docs/ListSchoolEmployees200Response.md index 0a7668f..cf65eca 100644 --- a/docs/ListSchoolEmployees200Response.md +++ b/docs/ListSchoolEmployees200Response.md @@ -5,6 +5,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**List[Employee]**](Employee.md) | | [optional] +**meta** | [**Meta**](Meta.md) | | [optional] ## Example diff --git a/docs/School.md b/docs/School.md index df105ae..9121d2f 100644 --- a/docs/School.md +++ b/docs/School.md @@ -6,10 +6,10 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] **name** | **str** | | [optional] -**establishment_number** | **int** | | [optional] +**establishment_number** | **str** | | [optional] **urn** | **int** | | [optional] **phase_of_education** | **str** | | [optional] -**la_code** | **int** | | [optional] +**la_code** | **str** | | [optional] **timezone** | **str** | | [optional] **mis** | **str** | | [optional] **address** | [**SchoolAddress**](SchoolAddress.md) | | [optional] diff --git a/docs/ModelClass.md b/docs/SchoolClass.md similarity index 73% rename from docs/ModelClass.md rename to docs/SchoolClass.md index 20548b4..7bc46a2 100644 --- a/docs/ModelClass.md +++ b/docs/SchoolClass.md @@ -1,4 +1,4 @@ -# ModelClass +# SchoolClass https://docs.wonde.com/docs/api/sync#get-classes Related objects Name Relationship -------------------------------------------- subject one students many students.contact_details many > one students.education_details many > one students.extended_details many > one students.house many > one students.registration many > one students.year many > one students.boarding many > one students.campus many > one employees many employees.contact_details many > one employees.employment_details many > one employees.extended_details many > one lessons many lessons.room many > one lessons.period many > one @@ -10,31 +10,31 @@ Name | Type | Description | Notes **name** | **str** | Class name. | [optional] **code** | **str** | Class code. | [optional] **description** | **str** | Class description. | [optional] -**subject** | [**ClassSubject**](ClassSubject.md) | | [optional] +**subject** | [**SchoolClassSubject**](SchoolClassSubject.md) | | [optional] **alternative** | **bool** | The class is an alternative to another class. | [optional] **restored_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] **created_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] **updated_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] -**students** | [**ClassStudents**](ClassStudents.md) | | [optional] -**employees** | [**ListSchoolEmployees200Response**](ListSchoolEmployees200Response.md) | | [optional] -**lessons** | [**ClassLessons**](ClassLessons.md) | | [optional] +**students** | [**SchoolClassStudents**](SchoolClassStudents.md) | | [optional] +**employees** | [**SchoolClassEmployees**](SchoolClassEmployees.md) | | [optional] +**lessons** | [**SchoolClassLessons**](SchoolClassLessons.md) | | [optional] ## Example ```python -from wonde.models.model_class import ModelClass +from wonde.models.school_class import SchoolClass # TODO update the JSON string below json = "{}" -# create an instance of ModelClass from a JSON string -model_class_instance = ModelClass.from_json(json) +# create an instance of SchoolClass from a JSON string +school_class_instance = SchoolClass.from_json(json) # print the JSON string representation of the object -print ModelClass.to_json() +print SchoolClass.to_json() # convert the object into a dict -model_class_dict = model_class_instance.to_dict() -# create an instance of ModelClass from a dict -model_class_form_dict = model_class.from_dict(model_class_dict) +school_class_dict = school_class_instance.to_dict() +# create an instance of SchoolClass from a dict +school_class_form_dict = school_class.from_dict(school_class_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SchoolClassEmployees.md b/docs/SchoolClassEmployees.md new file mode 100644 index 0000000..848a20b --- /dev/null +++ b/docs/SchoolClassEmployees.md @@ -0,0 +1,28 @@ +# SchoolClassEmployees + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[Employee]**](Employee.md) | | [optional] + +## Example + +```python +from wonde.models.school_class_employees import SchoolClassEmployees + +# TODO update the JSON string below +json = "{}" +# create an instance of SchoolClassEmployees from a JSON string +school_class_employees_instance = SchoolClassEmployees.from_json(json) +# print the JSON string representation of the object +print SchoolClassEmployees.to_json() + +# convert the object into a dict +school_class_employees_dict = school_class_employees_instance.to_dict() +# create an instance of SchoolClassEmployees from a dict +school_class_employees_form_dict = school_class_employees.from_dict(school_class_employees_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/ClassLessons.md b/docs/SchoolClassLessons.md similarity index 51% rename from docs/ClassLessons.md rename to docs/SchoolClassLessons.md index 5a3be07..4c8f85d 100644 --- a/docs/ClassLessons.md +++ b/docs/SchoolClassLessons.md @@ -1,4 +1,4 @@ -# ClassLessons +# SchoolClassLessons ## Properties @@ -9,19 +9,19 @@ Name | Type | Description | Notes ## Example ```python -from wonde.models.class_lessons import ClassLessons +from wonde.models.school_class_lessons import SchoolClassLessons # TODO update the JSON string below json = "{}" -# create an instance of ClassLessons from a JSON string -class_lessons_instance = ClassLessons.from_json(json) +# create an instance of SchoolClassLessons from a JSON string +school_class_lessons_instance = SchoolClassLessons.from_json(json) # print the JSON string representation of the object -print ClassLessons.to_json() +print SchoolClassLessons.to_json() # convert the object into a dict -class_lessons_dict = class_lessons_instance.to_dict() -# create an instance of ClassLessons from a dict -class_lessons_form_dict = class_lessons.from_dict(class_lessons_dict) +school_class_lessons_dict = school_class_lessons_instance.to_dict() +# create an instance of SchoolClassLessons from a dict +school_class_lessons_form_dict = school_class_lessons.from_dict(school_class_lessons_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ClassStudents.md b/docs/SchoolClassStudents.md similarity index 51% rename from docs/ClassStudents.md rename to docs/SchoolClassStudents.md index d9f068a..bc045b4 100644 --- a/docs/ClassStudents.md +++ b/docs/SchoolClassStudents.md @@ -1,4 +1,4 @@ -# ClassStudents +# SchoolClassStudents ## Properties @@ -9,19 +9,19 @@ Name | Type | Description | Notes ## Example ```python -from wonde.models.class_students import ClassStudents +from wonde.models.school_class_students import SchoolClassStudents # TODO update the JSON string below json = "{}" -# create an instance of ClassStudents from a JSON string -class_students_instance = ClassStudents.from_json(json) +# create an instance of SchoolClassStudents from a JSON string +school_class_students_instance = SchoolClassStudents.from_json(json) # print the JSON string representation of the object -print ClassStudents.to_json() +print SchoolClassStudents.to_json() # convert the object into a dict -class_students_dict = class_students_instance.to_dict() -# create an instance of ClassStudents from a dict -class_students_form_dict = class_students.from_dict(class_students_dict) +school_class_students_dict = school_class_students_instance.to_dict() +# create an instance of SchoolClassStudents from a dict +school_class_students_form_dict = school_class_students.from_dict(school_class_students_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ClassSubject.md b/docs/SchoolClassSubject.md similarity index 53% rename from docs/ClassSubject.md rename to docs/SchoolClassSubject.md index 539e040..d8ad5ac 100644 --- a/docs/ClassSubject.md +++ b/docs/SchoolClassSubject.md @@ -1,4 +1,4 @@ -# ClassSubject +# SchoolClassSubject The subject for the class. `include` to get object @@ -10,19 +10,19 @@ Name | Type | Description | Notes ## Example ```python -from wonde.models.class_subject import ClassSubject +from wonde.models.school_class_subject import SchoolClassSubject # TODO update the JSON string below json = "{}" -# create an instance of ClassSubject from a JSON string -class_subject_instance = ClassSubject.from_json(json) +# create an instance of SchoolClassSubject from a JSON string +school_class_subject_instance = SchoolClassSubject.from_json(json) # print the JSON string representation of the object -print ClassSubject.to_json() +print SchoolClassSubject.to_json() # convert the object into a dict -class_subject_dict = class_subject_instance.to_dict() -# create an instance of ClassSubject from a dict -class_subject_form_dict = class_subject.from_dict(class_subject_dict) +school_class_subject_dict = school_class_subject_instance.to_dict() +# create an instance of SchoolClassSubject from a dict +school_class_subject_form_dict = school_class_subject.from_dict(school_class_subject_dict) ``` [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SchoolClassSubjectOneOf.md b/docs/SchoolClassSubjectOneOf.md new file mode 100644 index 0000000..1d78818 --- /dev/null +++ b/docs/SchoolClassSubjectOneOf.md @@ -0,0 +1,28 @@ +# SchoolClassSubjectOneOf + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Subject**](Subject.md) | | [optional] + +## Example + +```python +from wonde.models.school_class_subject_one_of import SchoolClassSubjectOneOf + +# TODO update the JSON string below +json = "{}" +# create an instance of SchoolClassSubjectOneOf from a JSON string +school_class_subject_one_of_instance = SchoolClassSubjectOneOf.from_json(json) +# print the JSON string representation of the object +print SchoolClassSubjectOneOf.to_json() + +# convert the object into a dict +school_class_subject_one_of_dict = school_class_subject_one_of_instance.to_dict() +# create an instance of SchoolClassSubjectOneOf from a dict +school_class_subject_one_of_form_dict = school_class_subject_one_of.from_dict(school_class_subject_one_of_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/SchoolRegionIdentifiers.md b/docs/SchoolRegionIdentifiers.md index fb2c333..13e0b2b 100644 --- a/docs/SchoolRegionIdentifiers.md +++ b/docs/SchoolRegionIdentifiers.md @@ -4,8 +4,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**la_code** | **int** | | [optional] -**establishment_number** | **int** | | [optional] +**la_code** | **str** | | [optional] +**establishment_number** | **str** | | [optional] **urn** | **int** | | [optional] ## Example diff --git a/docs/SchoolsApi.md b/docs/SchoolsApi.md index f6c65cb..3ec6b68 100644 --- a/docs/SchoolsApi.md +++ b/docs/SchoolsApi.md @@ -9,7 +9,7 @@ Method | HTTP request | Description [**get_school_meta**](SchoolsApi.md#get_school_meta) | **GET** /meta/schools/{school_id} | Retrieve meta data for a school [**get_school_permissions**](SchoolsApi.md#get_school_permissions) | **GET** /meta/schools/{school_id}/permissions | Retrieve the permissions applied to a school [**list_schools**](SchoolsApi.md#list_schools) | **GET** /schools/all | Retrieve all schools -[**list_schools_approved**](SchoolsApi.md#list_schools_approved) | **GET** /schools/approved | Retrieve all approved schools +[**list_schools_approved**](SchoolsApi.md#list_schools_approved) | **GET** /schools | Retrieve all approved schools [**list_schools_audited**](SchoolsApi.md#list_schools_audited) | **GET** /schools/audited | Retrieve all audited schools [**list_schools_declined**](SchoolsApi.md#list_schools_declined) | **GET** /schools/declined | Retrieve all schools with declined access [**list_schools_offline**](SchoolsApi.md#list_schools_offline) | **GET** /schools/offline | Retrieve all offline schools @@ -20,7 +20,7 @@ Method | HTTP request | Description # **get_school** -> School get_school(school_id) +> GetSchool200Response get_school(school_id) Retrieve a specific school @@ -32,7 +32,7 @@ Retrieve a specific school import time import os import wonde -from wonde.models.school import School +from wonde.models.get_school200_response import GetSchool200Response from wonde.rest import ApiException from pprint import pprint @@ -74,6 +74,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -82,7 +83,7 @@ Name | Type | Description | Notes ### Return type -[**School**](School.md) +[**GetSchool200Response**](GetSchool200Response.md) ### Authorization @@ -156,6 +157,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -238,6 +240,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -319,6 +322,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -346,7 +350,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_schools** -> ListSchools200Response list_schools(updated_after=updated_after, updated_before=updated_before, per_page=per_page, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) +> ListSchools200Response list_schools(updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) Retrieve all schools @@ -391,6 +395,8 @@ with wonde.ApiClient(configuration) as api_client: updated_after = '2013-10-20' # date | Return rows modified after date (optional) updated_before = '2013-10-20' # date | Return rows modified before date (optional) per_page = 56 # int | Amount of rows to return (optional) + page = 56 # int | Page offset for offset-paginated results. (optional) + cursor = 'cursor_example' # str | Page cursor for cursor-paginated results. (optional) postcode = 'postcode_example' # str | Return results matching postcode search string (optional) la_code = 'la_code_example' # str | Return results with provided la_code (optional) establishment_number = 'establishment_number_example' # str | Return results with provided establishment_number (optional) @@ -398,7 +404,7 @@ with wonde.ApiClient(configuration) as api_client: try: # Retrieve all schools - api_response = api_instance.list_schools(updated_after=updated_after, updated_before=updated_before, per_page=per_page, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) + api_response = api_instance.list_schools(updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) print("The response of SchoolsApi->list_schools:\n") pprint(api_response) except Exception as e: @@ -406,6 +412,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -413,6 +420,8 @@ Name | Type | Description | Notes **updated_after** | **date**| Return rows modified after date | [optional] **updated_before** | **date**| Return rows modified before date | [optional] **per_page** | **int**| Amount of rows to return | [optional] + **page** | **int**| Page offset for offset-paginated results. | [optional] + **cursor** | **str**| Page cursor for cursor-paginated results. | [optional] **postcode** | **str**| Return results matching postcode search string | [optional] **la_code** | **str**| Return results with provided la_code | [optional] **establishment_number** | **str**| Return results with provided establishment_number | [optional] @@ -439,7 +448,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_schools_approved** -> ListSchools200Response list_schools_approved(updated_after=updated_after, updated_before=updated_before, per_page=per_page, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) +> ListSchools200Response list_schools_approved(updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) Retrieve all approved schools @@ -484,6 +493,8 @@ with wonde.ApiClient(configuration) as api_client: updated_after = '2013-10-20' # date | Return rows modified after date (optional) updated_before = '2013-10-20' # date | Return rows modified before date (optional) per_page = 56 # int | Amount of rows to return (optional) + page = 56 # int | Page offset for offset-paginated results. (optional) + cursor = 'cursor_example' # str | Page cursor for cursor-paginated results. (optional) postcode = 'postcode_example' # str | Return results matching postcode search string (optional) la_code = 'la_code_example' # str | Return results with provided la_code (optional) establishment_number = 'establishment_number_example' # str | Return results with provided establishment_number (optional) @@ -491,7 +502,7 @@ with wonde.ApiClient(configuration) as api_client: try: # Retrieve all approved schools - api_response = api_instance.list_schools_approved(updated_after=updated_after, updated_before=updated_before, per_page=per_page, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) + api_response = api_instance.list_schools_approved(updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, postcode=postcode, la_code=la_code, establishment_number=establishment_number, urn=urn) print("The response of SchoolsApi->list_schools_approved:\n") pprint(api_response) except Exception as e: @@ -499,6 +510,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -506,6 +518,8 @@ Name | Type | Description | Notes **updated_after** | **date**| Return rows modified after date | [optional] **updated_before** | **date**| Return rows modified before date | [optional] **per_page** | **int**| Amount of rows to return | [optional] + **page** | **int**| Page offset for offset-paginated results. | [optional] + **cursor** | **str**| Page cursor for cursor-paginated results. | [optional] **postcode** | **str**| Return results matching postcode search string | [optional] **la_code** | **str**| Return results with provided la_code | [optional] **establishment_number** | **str**| Return results with provided establishment_number | [optional] @@ -592,6 +606,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -679,6 +694,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -766,6 +782,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -859,6 +876,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -946,6 +964,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -1031,6 +1050,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -1113,6 +1133,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes diff --git a/docs/Student.md b/docs/Student.md index 48095fa..30b2883 100644 --- a/docs/Student.md +++ b/docs/Student.md @@ -15,10 +15,12 @@ Name | Type | Description | Notes **legal_surname** | **str** | The student’s legal last name. | [optional] **legal_forename** | **str** | The student’s legal first name. | [optional] **gender** | **str** | The student’s gender. Possible values are 'MALE' or 'FEMALE'. | [optional] -**date_of_birth** | [**DateTimeObject**](DateTimeObject.md) | | [optional] +**date_of_birth** | **date** | Student's date of birth. | [optional] **restored_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] **created_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] **updated_at** | [**DateTimeObject**](DateTimeObject.md) | | [optional] +**contact_details** | [**EmployeeContactDetails**](EmployeeContactDetails.md) | | [optional] +**education_details** | [**StudentEducationDetails**](StudentEducationDetails.md) | | [optional] ## Example diff --git a/docs/StudentEducationDetails.md b/docs/StudentEducationDetails.md new file mode 100644 index 0000000..336a104 --- /dev/null +++ b/docs/StudentEducationDetails.md @@ -0,0 +1,28 @@ +# StudentEducationDetails + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**EducationDetails**](EducationDetails.md) | | [optional] + +## Example + +```python +from wonde.models.student_education_details import StudentEducationDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of StudentEducationDetails from a JSON string +student_education_details_instance = StudentEducationDetails.from_json(json) +# print the JSON string representation of the object +print StudentEducationDetails.to_json() + +# convert the object into a dict +student_education_details_dict = student_education_details_instance.to_dict() +# create an instance of StudentEducationDetails from a dict +student_education_details_form_dict = student_education_details.from_dict(student_education_details_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StudentsApi.md b/docs/StudentsApi.md index 2da758f..2ee8422 100644 --- a/docs/StudentsApi.md +++ b/docs/StudentsApi.md @@ -64,6 +64,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -92,7 +93,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_school_students** -> ListSchoolStudents200Response list_school_students(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, aspect_id=aspect_id, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_upns=only_upns, only_mis_ids=only_mis_ids) +> ListSchoolStudents200Response list_school_students(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, aspect_id=aspect_id, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_upns=only_upns, only_mis_ids=only_mis_ids) Retrieve a list of students for a specific school @@ -135,9 +136,11 @@ with wonde.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = wonde.StudentsApi(api_client) school_id = 'school_id_example' # str | The ID of the school. - updated_after = '2013-10-20' # date | Return rows modified after date. (optional) - updated_before = '2013-10-20' # date | Return rows modified before date. (optional) - per_page = 56 # int | Amount of rows to return. (optional) + updated_after = '2013-10-20' # date | Return rows modified after date (optional) + updated_before = '2013-10-20' # date | Return rows modified before date (optional) + per_page = 56 # int | Amount of rows to return (optional) + page = 56 # int | Page offset for offset-paginated results. (optional) + cursor = 'cursor_example' # str | Page cursor for cursor-paginated results. (optional) include = 'include_example' # str | Comma separated list of objects to include. (optional) aspect_id = 'aspect_id_example' # str | If including results, restrict to those for this aspect ID only. (optional) user_defined_field = 'user_defined_field_example' # str | Filter students by user defined field key. (optional) @@ -147,7 +150,7 @@ with wonde.ApiClient(configuration) as api_client: try: # Retrieve a list of students for a specific school - api_response = api_instance.list_school_students(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, aspect_id=aspect_id, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_upns=only_upns, only_mis_ids=only_mis_ids) + api_response = api_instance.list_school_students(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, aspect_id=aspect_id, user_defined_field=user_defined_field, only_user_defined_fields=only_user_defined_fields, only_upns=only_upns, only_mis_ids=only_mis_ids) print("The response of StudentsApi->list_school_students:\n") pprint(api_response) except Exception as e: @@ -155,14 +158,17 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **school_id** | **str**| The ID of the school. | - **updated_after** | **date**| Return rows modified after date. | [optional] - **updated_before** | **date**| Return rows modified before date. | [optional] - **per_page** | **int**| Amount of rows to return. | [optional] + **updated_after** | **date**| Return rows modified after date | [optional] + **updated_before** | **date**| Return rows modified before date | [optional] + **per_page** | **int**| Amount of rows to return | [optional] + **page** | **int**| Page offset for offset-paginated results. | [optional] + **cursor** | **str**| Page cursor for cursor-paginated results. | [optional] **include** | **str**| Comma separated list of objects to include. | [optional] **aspect_id** | **str**| If including results, restrict to those for this aspect ID only. | [optional] **user_defined_field** | **str**| Filter students by user defined field key. | [optional] diff --git a/docs/SubjectsApi.md b/docs/SubjectsApi.md index 078b45d..c9f1a32 100644 --- a/docs/SubjectsApi.md +++ b/docs/SubjectsApi.md @@ -65,6 +65,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -94,7 +95,7 @@ Name | Type | Description | Notes [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) # **list_school_subjects** -> ListSchoolSubjects200Response list_school_subjects(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, subject_code=subject_code, subject_name=subject_name) +> ListSchoolSubjects200Response list_school_subjects(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, subject_code=subject_code, subject_name=subject_name) Retrieve subjects for a school @@ -140,13 +141,15 @@ with wonde.ApiClient(configuration) as api_client: updated_after = '2013-10-20' # date | Return rows modified after date (optional) updated_before = '2013-10-20' # date | Return rows modified before date (optional) per_page = 56 # int | Amount of rows to return (optional) + page = 56 # int | Page offset for offset-paginated results. (optional) + cursor = 'cursor_example' # str | Page cursor for cursor-paginated results. (optional) include = 'include_example' # str | Comma separated list of objects to include. (optional) subject_code = 'subject_code_example' # str | Return results with the provided subject code. (optional) subject_name = 'subject_name_example' # str | Return results with the provided subject name. (optional) try: # Retrieve subjects for a school - api_response = api_instance.list_school_subjects(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, include=include, subject_code=subject_code, subject_name=subject_name) + api_response = api_instance.list_school_subjects(school_id, updated_after=updated_after, updated_before=updated_before, per_page=per_page, page=page, cursor=cursor, include=include, subject_code=subject_code, subject_name=subject_name) print("The response of SubjectsApi->list_school_subjects:\n") pprint(api_response) except Exception as e: @@ -154,6 +157,7 @@ with wonde.ApiClient(configuration) as api_client: ``` + ### Parameters Name | Type | Description | Notes @@ -162,6 +166,8 @@ Name | Type | Description | Notes **updated_after** | **date**| Return rows modified after date | [optional] **updated_before** | **date**| Return rows modified before date | [optional] **per_page** | **int**| Amount of rows to return | [optional] + **page** | **int**| Page offset for offset-paginated results. | [optional] + **cursor** | **str**| Page cursor for cursor-paginated results. | [optional] **include** | **str**| Comma separated list of objects to include. | [optional] **subject_code** | **str**| Return results with the provided subject code. | [optional] **subject_name** | **str**| Return results with the provided subject name. | [optional] diff --git a/meta/README.md b/meta/README.md index 0495b2a..30012a8 100644 --- a/meta/README.md +++ b/meta/README.md @@ -1,37 +1,29 @@ -This folder contains a hand-authored OpenAPI spec for Wonde, `wonde-openapi. -yaml`, interpreted from [Wonde's API documentation](https://docs.wonde.com/docs/api/sync) -with the assistance of ChatGPT Code Interpreter. +# Readme -The spec is only partially complete +This folder contains a hand-authored OpenAPI spec for Wonde, `wonde-openapi.yaml`, interpreted from [Wonde's API documentation](https://docs.wonde.com/docs/api/sync) with the assistance of ChatGPT Code Interpreter. -The Wonde API client library is generated with the Java-based -[OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) v6.6.0, which -includes a new generator, `python-nextgen`, which uses Pydantic models. +The spec is only partially complete. -``` -brew install openapi-generator -./generate-python-nextgen.sh +The Wonde API client library is generated with the [OpenAPI Generator](https://github.com/OpenAPITools/openapi-generator) via it's docker image, [openapitools/openapi-generator-cli](https://hub.docker.com/r/openapitools/openapi-generator-cli). -# The above script calls: -openapi-generator generate \ - --generator-name=python-nextgen \ - --config=openapi-generator-config.json \ - --input-spec=wonde.openapi.yaml \ - --output=.. -``` +We currently use `v7.0.1` of the tool, which includes a now-stable `python` generator, which uses Pydantic models. This version (`v7.0.1`) was chosen as the most-recent version that is compatible with the Edrolo projects in which this client is internally used. +Use therefore assumes a working installation of docker. -Workflow: -- Make changes to wonde.openapi.yaml -- Regenerate client via ./generate-python-nextgen.sh -- Run `poetry run pre-commit run --all-files` to format the code with ruff and blue. +## Workflow + +- Make changes to `wonde.openapi.yaml` +- Regenerate client via `./generate-python.sh` +- Run `pre-commit run --all-files` to format the code with ruff and blue. - Check for any errors from ruff. There currently seems to be a bug in the `*_api.py` files where there's lines like `if isinstance(_params['updated_after'], datetime):` but `datetime` is not imported. - If there are files that shouldn't be regenerated, add them to `.openapi-generator-ignore`, e.g. `pyproject.toml`. +- Run tests via `pytest` and fix any errors. +# References - -Customization of templates etc: -https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md +- OpenAPI Generator: [OpenAPITools/openapi-generator: OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)](https://github.com/OpenAPITools/openapi-generator) +- Customization of templates etc: [openapi-generator/docs/customization.md at master · OpenAPITools/openapi-generator](https://github.com/OpenAPITools/openapi-generator/blob/master/docs/customization.md) +- Docker Image: [openapitools/openapi-generator-cli - Docker Image | Docker Hub](https://hub.docker.com/r/openapitools/openapi-generator-cli) diff --git a/meta/generate-python-nextgen.sh b/meta/generate-python-nextgen.sh deleted file mode 100755 index 72fcb39..0000000 --- a/meta/generate-python-nextgen.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh -# Generate the Python client from the OpenAPI specification, -# using the Java-based openapi-generator tool with the python-nextgen generator. - -#export PYTHON_POST_PROCESS_FILE="ruff" - -openapi-generator generate \ - --generator-name=python-nextgen \ - --config=openapi-generator-config.json \ - --input-spec=wonde.openapi.yaml \ - --output=.. -# --enable-post-process-file \ - -poetry run pre-commit run --all-files diff --git a/meta/generate-python.sh b/meta/generate-python.sh new file mode 100755 index 0000000..a3af734 --- /dev/null +++ b/meta/generate-python.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env sh +# Generate the Python client from the OpenAPI specification, +# using the docker-based openapi-generator tool with the python generator. + +#export PYTHON_POST_PROCESS_FILE="ruff" + +GENERATOR_VERSION=v7.0.1 + +# Note: We will run the container as the current user/group, so that the generated files +# are owned by the current user, not by root. +docker run --rm \ + --user $(id --user):$(id --group) \ + -v ${PWD}/..:/project \ + openapitools/openapi-generator-cli:${GENERATOR_VERSION} generate \ + --generator-name=python \ + --config=/project/meta/openapi-generator-config.json \ + --input-spec=/project/meta/wonde.openapi.yaml \ + --output=/project +# --enable-post-process-file \ + +pre-commit run --all-files diff --git a/meta/wonde.openapi.yaml b/meta/wonde.openapi.yaml index 1c3a943..2f64627 100644 --- a/meta/wonde.openapi.yaml +++ b/meta/wonde.openapi.yaml @@ -78,6 +78,8 @@ paths: - $ref: '#/components/parameters/UpdatedAfter' - $ref: '#/components/parameters/UpdatedBefore' - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/PageCursor' - $ref: '#/components/parameters/Postcode' - $ref: '#/components/parameters/LaCode' - $ref: '#/components/parameters/EstablishmentNumber' @@ -110,13 +112,16 @@ paths: schema: type: string responses: - '200': + 200: description: A school content: application/json: schema: - $ref: '#/components/schemas/School' - /schools/approved: + type: object + properties: + data: + $ref: '#/components/schemas/School' + /schools: get: summary: Retrieve all approved schools operationId: listSchoolsApproved @@ -126,12 +131,14 @@ paths: - $ref: '#/components/parameters/UpdatedAfter' - $ref: '#/components/parameters/UpdatedBefore' - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/PageCursor' - $ref: '#/components/parameters/Postcode' - $ref: '#/components/parameters/LaCode' - $ref: '#/components/parameters/EstablishmentNumber' - $ref: '#/components/parameters/Urn' responses: - '200': + 200: $ref: '#/components/responses/SchoolList' /schools/pending: get: @@ -148,7 +155,7 @@ paths: - $ref: '#/components/parameters/EstablishmentNumber' - $ref: '#/components/parameters/Urn' responses: - '200': + 200: $ref: '#/components/responses/SchoolList' /schools/audited: get: @@ -165,7 +172,7 @@ paths: - $ref: '#/components/parameters/EstablishmentNumber' - $ref: '#/components/parameters/Urn' responses: - '200': + 200: $ref: '#/components/responses/SchoolList' /schools/offline: get: @@ -182,7 +189,7 @@ paths: - $ref: '#/components/parameters/EstablishmentNumber' - $ref: '#/components/parameters/Urn' responses: - '200': + 200: $ref: '#/components/responses/SchoolList' /schools/revoked: get: @@ -193,7 +200,7 @@ paths: parameters: - $ref: '#/components/parameters/PerPage' responses: - '200': + 200: $ref: '#/components/responses/SchoolList' /schools/declined: get: @@ -204,7 +211,7 @@ paths: parameters: - $ref: '#/components/parameters/PerPage' responses: - '200': + 200: $ref: '#/components/responses/SchoolList' /meta/schools/{school_id}: get: @@ -371,6 +378,8 @@ paths: - $ref: '#/components/parameters/UpdatedAfter' - $ref: '#/components/parameters/UpdatedBefore' - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/PageCursor' - name: include in: query description: Comma separated list of objects to include @@ -425,7 +434,7 @@ paths: data: type: array items: - $ref: '#/components/schemas/Class' + $ref: '#/components/schemas/SchoolClass' meta: $ref: '#/components/schemas/Meta' @@ -485,7 +494,7 @@ paths: type: object properties: data: - $ref: '#/components/schemas/Class' + $ref: '#/components/schemas/SchoolClass' meta: $ref: '#/components/schemas/Meta' @@ -505,6 +514,8 @@ paths: - $ref: '#/components/parameters/UpdatedAfter' - $ref: '#/components/parameters/UpdatedBefore' - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/PageCursor' - name: include in: query description: Comma separated list of objects to include @@ -569,6 +580,8 @@ paths: type: array items: $ref: '#/components/schemas/Employee' + meta: + $ref: '#/components/schemas/Meta' /schools/{school_id}/employees/{employee_id}: get: @@ -613,23 +626,11 @@ paths: schema: type: string description: The ID of the school. - - name: updated_after - in: query - schema: - type: string - format: date - description: Return rows modified after date. - - name: updated_before - in: query - schema: - type: string - format: date - description: Return rows modified before date. - - name: per_page - in: query - schema: - type: integer - description: Amount of rows to return. + - $ref: '#/components/parameters/UpdatedAfter' + - $ref: '#/components/parameters/UpdatedBefore' + - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/PageCursor' - name: include in: query description: Comma separated list of objects to include. @@ -707,7 +708,7 @@ paths: type: string description: Filter MIS ids by comma separated list. responses: - '200': + 200: description: A list of students content: application/json: @@ -741,7 +742,7 @@ paths: schema: type: string responses: - '200': + 200: description: A student content: application/json: @@ -764,6 +765,8 @@ paths: - $ref: '#/components/parameters/UpdatedAfter' - $ref: '#/components/parameters/UpdatedBefore' - $ref: '#/components/parameters/PerPage' + - $ref: '#/components/parameters/PageOffset' + - $ref: '#/components/parameters/PageCursor' - name: include in: query description: Comma separated list of objects to include. @@ -783,7 +786,7 @@ paths: schema: type: string responses: - '200': + 200: description: Successful operation content: application/json: @@ -823,7 +826,7 @@ paths: schema: type: string responses: - '200': + 200: description: Successful operation content: application/json: @@ -879,7 +882,7 @@ paths: enum: [class, employee, period, room] description: Comma separated list of objects to include. responses: - '200': + 200: description: Successful operation content: application/json: @@ -921,7 +924,7 @@ paths: type: string description: The ID of the lesson. responses: - '200': + 200: description: Successful operation content: application/json: @@ -988,13 +991,13 @@ components: name: type: string establishment_number: - type: integer + type: string urn: type: integer phase_of_education: type: string la_code: - type: integer + type: string timezone: type: string mis: @@ -1050,10 +1053,10 @@ components: type: object properties: la_code: - type: integer + type: string example: 201 establishment_number: - type: integer + type: string example: 3614 urn: type: integer @@ -1113,6 +1116,23 @@ components: type: type: string + ContactDetails: + type: object + properties: + emails: + type: object + properties: + email: + type: string + + EducationDetails: + type: object + properties: + current_nc_year: + type: string + local_upn: + type: string + Contact: type: object properties: @@ -1132,7 +1152,7 @@ components: type: string description: Notes for the contact - Class: + SchoolClass: type: object description: > https://docs.wonde.com/docs/api/sync#get-classes @@ -1272,9 +1292,9 @@ components: example: female date_of_birth: type: string - format: date-time + format: date description: Employee's date of birth. - example: 1963-02-11T00:00:00.000Z + example: 1963-02-11 restored_at: # When the Wonde ID was restored from the deletion's data. $ref: '#/components/schemas/DateTimeObject' created_at: # When the record was added to Wonde. @@ -1282,6 +1302,15 @@ components: updated_at: # When the record was last updated on Wonde. $ref: '#/components/schemas/DateTimeObject' + # Optional "includes" + + contact_details: + type: object + properties: + data: + $ref: '#/components/schemas/ContactDetails' + + Student: type: object description: > @@ -1394,8 +1423,10 @@ components: description: The student’s gender. Possible values are 'MALE' or 'FEMALE'. example: MALE date_of_birth: - $ref: '#/components/schemas/DateTimeObject' - # description: The student’s date of birth. + type: string + format: date + description: Student's date of birth. + example: 2010-02-11 restored_at: $ref: '#/components/schemas/DateTimeObject' # description: When the Wonde ID was restored from the deletion's data. @@ -1406,6 +1437,21 @@ components: $ref: '#/components/schemas/DateTimeObject' # description: When the record was last updated on Wonde. + # Optional "includes" + + contact_details: + type: object + properties: + data: + $ref: '#/components/schemas/ContactDetails' + + education_details: + type: object + properties: + data: + $ref: '#/components/schemas/EducationDetails' + + Subject: type: object description: < @@ -1580,6 +1626,18 @@ components: description: Amount of rows to return schema: type: integer + PageOffset: + name: page + in: query + description: Page offset for offset-paginated results. + schema: + type: integer + PageCursor: + name: cursor + in: query + description: Page cursor for cursor-paginated results. + schema: + type: string Postcode: name: postcode in: query diff --git a/requirements.txt b/requirements.txt index 74ede17..258c179 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3 +urllib3 >= 1.25.3, < 2.1.0 pydantic >= 1.10.5, < 2 aenum >= 3.1.11 diff --git a/setup.py b/setup.py index 758163b..a0738c2 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -21,7 +21,7 @@ NAME = 'pywonde' VERSION = '0.1.0' PYTHON_REQUIRES = '>=3.7' -REQUIRES = ['urllib3 >= 1.25.3', 'python-dateutil', 'pydantic >= 1.10.5, < 2', 'aenum'] +REQUIRES = ['urllib3 >= 1.25.3, < 2.1.0', 'python-dateutil', 'pydantic >= 1.10.5, < 2', 'aenum'] setup( name=NAME, @@ -36,6 +36,7 @@ include_package_data=True, long_description_content_type='text/markdown', long_description="""\ - API Docs # noqa: E501 + API Docs """, + package_data={'wonde': ['py.typed']}, ) diff --git a/test/test_acl.py b/test/test_acl.py index 6cdc1a9..d5b02d2 100644 --- a/test/test_acl.py +++ b/test/test_acl.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.acl import ACL + class TestACL(unittest.TestCase): """ACL unit test stubs""" @@ -22,22 +24,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ACL: """Test ACL include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ACL` """ - model = wonde.models.acl.ACL() # noqa: E501 - if include_optional : + model = ACL() # noqa: E501 + if include_optional: return ACL( - mode = '', + mode = '', ids = [ null ] ) - else : + else: return ACL( ) """ diff --git a/test/test_acl_ids_inner.py b/test/test_acl_ids_inner.py index c81c7eb..ce3c940 100644 --- a/test/test_acl_ids_inner.py +++ b/test/test_acl_ids_inner.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.acl_ids_inner import ACLIdsInner + class TestACLIdsInner(unittest.TestCase): """ACLIdsInner unit test stubs""" @@ -22,20 +24,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ACLIdsInner: """Test ACLIdsInner include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ACLIdsInner` """ - model = wonde.models.acl_ids_inner.ACLIdsInner() # noqa: E501 - if include_optional : + model = ACLIdsInner() # noqa: E501 + if include_optional: return ACLIdsInner( - id = '', + id = '', type = '' ) - else : + else: return ACLIdsInner( ) """ diff --git a/test/test_acl_ids_inner_one_of.py b/test/test_acl_ids_inner_one_of.py index b8b5d05..0383f2f 100644 --- a/test/test_acl_ids_inner_one_of.py +++ b/test/test_acl_ids_inner_one_of.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.acl_ids_inner_one_of import ACLIdsInnerOneOf + class TestACLIdsInnerOneOf(unittest.TestCase): """ACLIdsInnerOneOf unit test stubs""" @@ -22,20 +24,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ACLIdsInnerOneOf: """Test ACLIdsInnerOneOf include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ACLIdsInnerOneOf` """ - model = wonde.models.acl_ids_inner_one_of.ACLIdsInnerOneOf() # noqa: E501 - if include_optional : + model = ACLIdsInnerOneOf() # noqa: E501 + if include_optional: return ACLIdsInnerOneOf( - id = '', + id = '', type = '' ) - else : + else: return ACLIdsInnerOneOf( ) """ diff --git a/test/test_class_students.py b/test/test_class_students.py deleted file mode 100644 index f69dc77..0000000 --- a/test/test_class_students.py +++ /dev/null @@ -1,71 +0,0 @@ -""" -Wonde API - -API Docs # noqa: E501 - -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" - - -import unittest - - -class TestClassStudents(unittest.TestCase): - """ClassStudents unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional): - """Test ClassStudents - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # uncomment below to create an instance of `ClassStudents` - """ - model = wonde.models.class_students.ClassStudents() # noqa: E501 - if include_optional : - return ClassStudents( - data = [ - wonde.models.student.Student( - id = 'A1749191433', - upi = '8d444684b7aa79bc97f8594a4aab7ce3', - mis_id = '9919', - initials = 'TS', - surname = 'Smith', - forename = 'Tom', - middle_names = '', - legal_surname = 'Smith', - legal_forename = 'Tom', - gender = 'MALE', - date_of_birth = wonde.models.date_time_object.DateTimeObject( - date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - timezone_type = 3, - timezone = 'UTC', ), - restored_at = wonde.models.date_time_object.DateTimeObject( - date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - timezone_type = 3, - timezone = 'UTC', ), - created_at = , - updated_at = , ) - ] - ) - else : - return ClassStudents( - ) - """ - - def testClassStudents(self): - """Test ClassStudents""" - # inst_req_only = self.make_instance(include_optional=False) - # inst_req_and_optional = self.make_instance(include_optional=True) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_classes_api.py b/test/test_classes_api.py index 483fc2c..b842551 100644 --- a/test/test_classes_api.py +++ b/test/test_classes_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,26 +12,26 @@ import unittest -import wonde +from wonde.api.classes_api import ClassesApi class TestClassesApi(unittest.TestCase): """ClassesApi unit test stubs""" - def setUp(self): - self.api = wonde.api.classes_api.ClassesApi() + def setUp(self) -> None: + self.api = ClassesApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_school_class(self): + def test_get_school_class(self) -> None: """Test case for get_school_class Get specific class for a school # noqa: E501 """ pass - def test_list_school_classes(self): + def test_list_school_classes(self) -> None: """Test case for list_school_classes Get all classes for a school # noqa: E501 diff --git a/test/test_contact.py b/test/test_contact.py index b786d87..9fbc827 100644 --- a/test/test_contact.py +++ b/test/test_contact.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.contact import Contact + class TestContact(unittest.TestCase): """Contact unit test stubs""" @@ -22,23 +24,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Contact: """Test Contact include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Contact` """ - model = wonde.models.contact.Contact() # noqa: E501 - if include_optional : + model = Contact() # noqa: E501 + if include_optional: return Contact( - first_name = '', - last_name = '', - phone_number = '', - email_address = '', + first_name = '', + last_name = '', + phone_number = '', + email_address = '', notes = '' ) - else : + else: return Contact( ) """ diff --git a/test/test_contact_details.py b/test/test_contact_details.py new file mode 100644 index 0000000..a1ab9cf --- /dev/null +++ b/test/test_contact_details.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.contact_details import ContactDetails # noqa: E501 + +class TestContactDetails(unittest.TestCase): + """ContactDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ContactDetails: + """Test ContactDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ContactDetails` + """ + model = ContactDetails() # noqa: E501 + if include_optional: + return ContactDetails( + emails = wonde.models.contact_details_emails.ContactDetails_emails( + email = '', ) + ) + else: + return ContactDetails( + ) + """ + + def testContactDetails(self): + """Test ContactDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_contact_details_emails.py b/test/test_contact_details_emails.py new file mode 100644 index 0000000..36e837b --- /dev/null +++ b/test/test_contact_details_emails.py @@ -0,0 +1,52 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.contact_details_emails import ContactDetailsEmails # noqa: E501 + +class TestContactDetailsEmails(unittest.TestCase): + """ContactDetailsEmails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ContactDetailsEmails: + """Test ContactDetailsEmails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `ContactDetailsEmails` + """ + model = ContactDetailsEmails() # noqa: E501 + if include_optional: + return ContactDetailsEmails( + email = '' + ) + else: + return ContactDetailsEmails( + ) + """ + + def testContactDetailsEmails(self): + """Test ContactDetailsEmails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_date_time_object.py b/test/test_date_time_object.py index 56bb7e3..0b60cd6 100644 --- a/test/test_date_time_object.py +++ b/test/test_date_time_object.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.date_time_object import DateTimeObject + class TestDateTimeObject(unittest.TestCase): """DateTimeObject unit test stubs""" @@ -22,21 +24,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> DateTimeObject: """Test DateTimeObject include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `DateTimeObject` """ - model = wonde.models.date_time_object.DateTimeObject() # noqa: E501 - if include_optional : + model = DateTimeObject() # noqa: E501 + if include_optional: return DateTimeObject( - var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - timezone_type = 3, + var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timezone_type = 3, timezone = 'UTC' ) - else : + else: return DateTimeObject( ) """ diff --git a/test/test_deletion.py b/test/test_deletion.py index 3aafbb7..df41b68 100644 --- a/test/test_deletion.py +++ b/test/test_deletion.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.deletion import Deletion + class TestDeletion(unittest.TestCase): """Deletion unit test stubs""" @@ -22,29 +24,29 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Deletion: """Test Deletion include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Deletion` """ - model = wonde.models.deletion.Deletion() # noqa: E501 - if include_optional : + model = Deletion() # noqa: E501 + if include_optional: return Deletion( - type = '', - id = '', - mis_id = '', + type = '', + id = '', + mis_id = '', deleted_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ) ) - else : + else: return Deletion( ) """ diff --git a/test/test_deletions_api.py b/test/test_deletions_api.py index b6637fb..a117681 100644 --- a/test/test_deletions_api.py +++ b/test/test_deletions_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,19 +12,19 @@ import unittest -import wonde +from wonde.api.deletions_api import DeletionsApi class TestDeletionsApi(unittest.TestCase): """DeletionsApi unit test stubs""" - def setUp(self): - self.api = wonde.api.deletions_api.DeletionsApi() + def setUp(self) -> None: + self.api = DeletionsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_list_school_deletions(self): + def test_list_school_deletions(self) -> None: """Test case for list_school_deletions Get deletions for a school # noqa: E501 diff --git a/test/test_education_details.py b/test/test_education_details.py new file mode 100644 index 0000000..af015c5 --- /dev/null +++ b/test/test_education_details.py @@ -0,0 +1,53 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.education_details import EducationDetails # noqa: E501 + +class TestEducationDetails(unittest.TestCase): + """EducationDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EducationDetails: + """Test EducationDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EducationDetails` + """ + model = EducationDetails() # noqa: E501 + if include_optional: + return EducationDetails( + current_nc_year = '', + local_upn = '' + ) + else: + return EducationDetails( + ) + """ + + def testEducationDetails(self): + """Test EducationDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_employee.py b/test/test_employee.py index 8193d15..01fe918 100644 --- a/test/test_employee.py +++ b/test/test_employee.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.employee import Employee + class TestEmployee(unittest.TestCase): """Employee unit test stubs""" @@ -22,42 +24,46 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Employee: """Test Employee include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Employee` """ - model = wonde.models.employee.Employee() # noqa: E501 - if include_optional : + model = Employee() # noqa: E501 + if include_optional: return Employee( - id = 'A1329183376', - upi = '5cc4ab015f8f7870b581e30e0ef474fa', - mis_id = '26', - title = 'Mrs', - initials = 'SS', - surname = 'Smith', - forename = 'Sally', - middle_names = 'Victoria', - legal_surname = 'Smith', - legal_forename = 'Sally', - gender = 'female', - date_of_birth = '1963-02-11T00:00Z', + id = 'A1329183376', + upi = '5cc4ab015f8f7870b581e30e0ef474fa', + mis_id = '26', + title = 'Mrs', + initials = 'SS', + surname = 'Smith', + forename = 'Sally', + middle_names = 'Victoria', + legal_surname = 'Smith', + legal_forename = 'Sally', + gender = 'female', + date_of_birth = 'Mon Feb 11 00:00:00 UTC 1963', restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), created_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), updated_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ) + timezone = 'UTC', ), + contact_details = wonde.models.employee_contact_details.Employee_contact_details( + data = wonde.models.contact_details.ContactDetails( + emails = wonde.models.contact_details_emails.ContactDetails_emails( + email = '', ), ), ) ) - else : + else: return Employee( ) """ diff --git a/test/test_employee_contact_details.py b/test/test_employee_contact_details.py new file mode 100644 index 0000000..7eac6cd --- /dev/null +++ b/test/test_employee_contact_details.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.employee_contact_details import EmployeeContactDetails # noqa: E501 + +class TestEmployeeContactDetails(unittest.TestCase): + """EmployeeContactDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> EmployeeContactDetails: + """Test EmployeeContactDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `EmployeeContactDetails` + """ + model = EmployeeContactDetails() # noqa: E501 + if include_optional: + return EmployeeContactDetails( + data = wonde.models.contact_details.ContactDetails( + emails = wonde.models.contact_details_emails.ContactDetails_emails( + email = '', ), ) + ) + else: + return EmployeeContactDetails( + ) + """ + + def testEmployeeContactDetails(self): + """Test EmployeeContactDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_employees_api.py b/test/test_employees_api.py index 5630f48..eee98bf 100644 --- a/test/test_employees_api.py +++ b/test/test_employees_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,26 +12,26 @@ import unittest -import wonde +from wonde.api.employees_api import EmployeesApi class TestEmployeesApi(unittest.TestCase): """EmployeesApi unit test stubs""" - def setUp(self): - self.api = wonde.api.employees_api.EmployeesApi() + def setUp(self) -> None: + self.api = EmployeesApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_school_employee(self): + def test_get_school_employee(self) -> None: """Test case for get_school_employee Get specific employee for a school # noqa: E501 """ pass - def test_list_school_employees(self): + def test_list_school_employees(self) -> None: """Test case for list_school_employees Get all employees for a school # noqa: E501 diff --git a/test/test_get_school200_response.py b/test/test_get_school200_response.py new file mode 100644 index 0000000..0b9ca71 --- /dev/null +++ b/test/test_get_school200_response.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.get_school200_response import GetSchool200Response # noqa: E501 + +class TestGetSchool200Response(unittest.TestCase): + """GetSchool200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetSchool200Response: + """Test GetSchool200Response + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetSchool200Response` + """ + model = GetSchool200Response() # noqa: E501 + if include_optional: + return GetSchool200Response( + data = wonde.models.school.School( + id = '', + name = '', + establishment_number = '', + urn = 56, + phase_of_education = '', + la_code = '', + timezone = '', + mis = '', + address = wonde.models.school_address.School_address( + address_line_1 = 'St James's Passage', + address_line_2 = 'Duke's Place', + address_town = 'London', + address_postcode = 'EC3A 5DE', + address_country = wonde.models.school_address_address_country.School_address_address_country( + code = 'GBR', + name = 'United Kingdom', ), ), + extended = wonde.models.school_extended.School_extended( + allows_writeback = True, + has_timetables = True, + has_lesson_attendance = True, ), + region = wonde.models.school_region.School_region( + code = 'GBR', + domain = 'api.wonde.com', + school_url = 'https://api.wonde.com/v1.0/schools/A1300691890', + identifiers = wonde.models.school_region_identifiers.School_region_identifiers( + la_code = '201', + establishment_number = '3614', + urn = 10000, ), ), ) + ) + else: + return GetSchool200Response( + ) + """ + + def testGetSchool200Response(self): + """Test GetSchool200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_get_school_acl200_response.py b/test/test_get_school_acl200_response.py index 92f4a8b..96914a2 100644 --- a/test/test_get_school_acl200_response.py +++ b/test/test_get_school_acl200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.get_school_acl200_response import GetSchoolAcl200Response + class TestGetSchoolAcl200Response(unittest.TestCase): """GetSchoolAcl200Response unit test stubs""" @@ -22,15 +24,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GetSchoolAcl200Response: """Test GetSchoolAcl200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `GetSchoolAcl200Response` """ - model = wonde.models.get_school_acl200_response.GetSchoolAcl200Response() # noqa: E501 - if include_optional : + model = GetSchoolAcl200Response() # noqa: E501 + if include_optional: return GetSchoolAcl200Response( data = wonde.models.acl.ACL( mode = '', @@ -38,7 +40,7 @@ def make_instance(self, include_optional): null ], ) ) - else : + else: return GetSchoolAcl200Response( ) """ diff --git a/test/test_get_school_class200_response.py b/test/test_get_school_class200_response.py index 34a8020..50b44b0 100644 --- a/test/test_get_school_class200_response.py +++ b/test/test_get_school_class200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.get_school_class200_response import GetSchoolClass200Response + class TestGetSchoolClass200Response(unittest.TestCase): """GetSchoolClass200Response unit test stubs""" @@ -22,17 +24,17 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GetSchoolClass200Response: """Test GetSchoolClass200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `GetSchoolClass200Response` """ - model = wonde.models.get_school_class200_response.GetSchoolClass200Response() # noqa: E501 - if include_optional : + model = GetSchoolClass200Response() # noqa: E501 + if include_optional: return GetSchoolClass200Response( - data = wonde.models.class.Class( + data = wonde.models.school_class.SchoolClass( id = 'A1329183376', mis_id = '8925', name = '10A/Ar1', @@ -49,7 +51,7 @@ def make_instance(self, include_optional): timezone_type = 3, timezone = 'UTC', ), updated_at = , - students = wonde.models.class_students.Class_students( + students = wonde.models.school_class_students.SchoolClass_students( data = [ wonde.models.student.Student( id = 'A1749191433', @@ -62,10 +64,12 @@ def make_instance(self, include_optional): legal_surname = 'Smith', legal_forename = 'Tom', gender = 'MALE', - date_of_birth = , ) + date_of_birth = 'Thu Feb 11 00:00:00 UTC 2010', + contact_details = wonde.models.employee_contact_details.Employee_contact_details(), + education_details = wonde.models.student_education_details.Student_education_details(), ) ], ), - employees = wonde.models.list_school_employees_200_response.listSchoolEmployees_200_response(), - lessons = wonde.models.class_lessons.Class_lessons(), ), + employees = wonde.models.school_class_employees.SchoolClass_employees(), + lessons = wonde.models.school_class_lessons.SchoolClass_lessons(), ), meta = wonde.models.meta.Meta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', @@ -77,7 +81,7 @@ def make_instance(self, include_optional): '' ], ) ) - else : + else: return GetSchoolClass200Response( ) """ diff --git a/test/test_get_school_meta200_response.py b/test/test_get_school_meta200_response.py index 7c7fdb3..f078d23 100644 --- a/test/test_get_school_meta200_response.py +++ b/test/test_get_school_meta200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.get_school_meta200_response import GetSchoolMeta200Response + class TestGetSchoolMeta200Response(unittest.TestCase): """GetSchoolMeta200Response unit test stubs""" @@ -22,15 +24,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GetSchoolMeta200Response: """Test GetSchoolMeta200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `GetSchoolMeta200Response` """ - model = wonde.models.get_school_meta200_response.GetSchoolMeta200Response() # noqa: E501 - if include_optional : + model = GetSchoolMeta200Response() # noqa: E501 + if include_optional: return GetSchoolMeta200Response( data = wonde.models.school_meta.SchoolMeta( online = True, @@ -38,7 +40,7 @@ def make_instance(self, include_optional): audited = True, custom_attendance_codes = True, ) ) - else : + else: return GetSchoolMeta200Response( ) """ diff --git a/test/test_get_school_permissions200_response.py b/test/test_get_school_permissions200_response.py index 3b421a7..e194132 100644 --- a/test/test_get_school_permissions200_response.py +++ b/test/test_get_school_permissions200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,10 @@ import unittest +from wonde.models.get_school_permissions200_response import ( + GetSchoolPermissions200Response, +) + class TestGetSchoolPermissions200Response(unittest.TestCase): """GetSchoolPermissions200Response unit test stubs""" @@ -22,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> GetSchoolPermissions200Response: """Test GetSchoolPermissions200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `GetSchoolPermissions200Response` """ - model = wonde.models.get_school_permissions200_response.GetSchoolPermissions200Response() # noqa: E501 - if include_optional : + model = GetSchoolPermissions200Response() # noqa: E501 + if include_optional: return GetSchoolPermissions200Response( data = [ wonde.models.permission.Permission( @@ -48,7 +52,7 @@ def make_instance(self, include_optional): audited = True, ) ] ) - else : + else: return GetSchoolPermissions200Response( ) """ diff --git a/test/test_lesson.py b/test/test_lesson.py index 3fc39ff..5923ee4 100644 --- a/test/test_lesson.py +++ b/test/test_lesson.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.lesson import Lesson + class TestLesson(unittest.TestCase): """Lesson unit test stubs""" @@ -22,40 +24,40 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Lesson: """Test Lesson include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Lesson` """ - model = wonde.models.lesson.Lesson() # noqa: E501 - if include_optional : + model = Lesson() # noqa: E501 + if include_optional: return Lesson( - id = '', - room = '', - period = '', - employee_id = '', - period_instance_id = 56, - alternative = True, + id = '', + room = '', + period = '', + employee_id = '', + period_instance_id = 56, + alternative = True, start_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), end_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), created_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), updated_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ) ) - else : + else: return Lesson( ) """ diff --git a/test/test_lessons_api.py b/test/test_lessons_api.py index b9af77d..05e7cf9 100644 --- a/test/test_lessons_api.py +++ b/test/test_lessons_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,26 +12,26 @@ import unittest -import wonde +from wonde.api.lessons_api import LessonsApi class TestLessonsApi(unittest.TestCase): """LessonsApi unit test stubs""" - def setUp(self): - self.api = wonde.api.lessons_api.LessonsApi() + def setUp(self) -> None: + self.api = LessonsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_school_lesson(self): + def test_get_school_lesson(self) -> None: """Test case for get_school_lesson Returns a specific lesson for a specific school # noqa: E501 """ pass - def test_list_school_lessons(self): + def test_list_school_lessons(self) -> None: """Test case for list_school_lessons Returns a list of lessons for a specific school # noqa: E501 diff --git a/test/test_list_school_classes200_response.py b/test/test_list_school_classes200_response.py index dc3ad91..4f39540 100644 --- a/test/test_list_school_classes200_response.py +++ b/test/test_list_school_classes200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.list_school_classes200_response import ListSchoolClasses200Response + class TestListSchoolClasses200Response(unittest.TestCase): """ListSchoolClasses200Response unit test stubs""" @@ -22,18 +24,18 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchoolClasses200Response: """Test ListSchoolClasses200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchoolClasses200Response` """ - model = wonde.models.list_school_classes200_response.ListSchoolClasses200Response() # noqa: E501 - if include_optional : + model = ListSchoolClasses200Response() # noqa: E501 + if include_optional: return ListSchoolClasses200Response( data = [ - wonde.models.class.Class( + wonde.models.school_class.SchoolClass( id = 'A1329183376', mis_id = '8925', name = '10A/Ar1', @@ -50,7 +52,7 @@ def make_instance(self, include_optional): timezone_type = 3, timezone = 'UTC', ), updated_at = , - students = wonde.models.class_students.Class_students( + students = wonde.models.school_class_students.SchoolClass_students( data = [ wonde.models.student.Student( id = 'A1749191433', @@ -63,11 +65,13 @@ def make_instance(self, include_optional): legal_surname = 'Smith', legal_forename = 'Tom', gender = 'MALE', - date_of_birth = , ) + date_of_birth = 'Thu Feb 11 00:00:00 UTC 2010', + contact_details = wonde.models.employee_contact_details.Employee_contact_details(), + education_details = wonde.models.student_education_details.Student_education_details(), ) ], ), - employees = wonde.models.list_school_employees_200_response.listSchoolEmployees_200_response(), - lessons = wonde.models.class_lessons.Class_lessons(), ) - ], + employees = wonde.models.school_class_employees.SchoolClass_employees(), + lessons = wonde.models.school_class_lessons.SchoolClass_lessons(), ) + ], meta = wonde.models.meta.Meta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', @@ -79,7 +83,7 @@ def make_instance(self, include_optional): '' ], ) ) - else : + else: return ListSchoolClasses200Response( ) """ diff --git a/test/test_list_school_deletions200_response.py b/test/test_list_school_deletions200_response.py index 1b6225d..b9a3ecf 100644 --- a/test/test_list_school_deletions200_response.py +++ b/test/test_list_school_deletions200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,10 @@ import unittest +from wonde.models.list_school_deletions200_response import ( + ListSchoolDeletions200Response, +) + class TestListSchoolDeletions200Response(unittest.TestCase): """ListSchoolDeletions200Response unit test stubs""" @@ -22,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchoolDeletions200Response: """Test ListSchoolDeletions200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchoolDeletions200Response` """ - model = wonde.models.list_school_deletions200_response.ListSchoolDeletions200Response() # noqa: E501 - if include_optional : + model = ListSchoolDeletions200Response() # noqa: E501 + if include_optional: return ListSchoolDeletions200Response( data = [ wonde.models.deletion.Deletion( @@ -47,7 +51,7 @@ def make_instance(self, include_optional): timezone = 'UTC', ), ) ] ) - else : + else: return ListSchoolDeletions200Response( ) """ diff --git a/test/test_list_school_employees200_response.py b/test/test_list_school_employees200_response.py index 3aee1c9..08dd6df 100644 --- a/test/test_list_school_employees200_response.py +++ b/test/test_list_school_employees200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,10 @@ import unittest +from wonde.models.list_school_employees200_response import ( + ListSchoolEmployees200Response, +) + class TestListSchoolEmployees200Response(unittest.TestCase): """ListSchoolEmployees200Response unit test stubs""" @@ -22,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchoolEmployees200Response: """Test ListSchoolEmployees200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchoolEmployees200Response` """ - model = wonde.models.list_school_employees200_response.ListSchoolEmployees200Response() # noqa: E501 - if include_optional : + model = ListSchoolEmployees200Response() # noqa: E501 + if include_optional: return ListSchoolEmployees200Response( data = [ wonde.models.employee.Employee( @@ -45,7 +49,7 @@ def make_instance(self, include_optional): legal_surname = 'Smith', legal_forename = 'Sally', gender = 'female', - date_of_birth = '1963-02-11T00:00Z', + date_of_birth = 'Mon Feb 11 00:00:00 UTC 1963', restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, @@ -54,10 +58,24 @@ def make_instance(self, include_optional): date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ), - updated_at = , ) - ] + updated_at = , + contact_details = wonde.models.employee_contact_details.Employee_contact_details( + data = wonde.models.contact_details.ContactDetails( + emails = wonde.models.contact_details_emails.ContactDetails_emails( + email = '', ), ), ), ) + ], + meta = wonde.models.meta.Meta( + pagination = wonde.models.pagination.Pagination( + next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', + previous = '', + more = True, + per_page = 2, + current_page = 1, ), + includes = [ + '' + ], ) ) - else : + else: return ListSchoolEmployees200Response( ) """ diff --git a/test/test_list_school_lessons200_response.py b/test/test_list_school_lessons200_response.py index 215f594..2ea4f4d 100644 --- a/test/test_list_school_lessons200_response.py +++ b/test/test_list_school_lessons200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.list_school_lessons200_response import ListSchoolLessons200Response + class TestListSchoolLessons200Response(unittest.TestCase): """ListSchoolLessons200Response unit test stubs""" @@ -22,15 +24,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchoolLessons200Response: """Test ListSchoolLessons200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchoolLessons200Response` """ - model = wonde.models.list_school_lessons200_response.ListSchoolLessons200Response() # noqa: E501 - if include_optional : + model = ListSchoolLessons200Response() # noqa: E501 + if include_optional: return ListSchoolLessons200Response( data = [ wonde.models.lesson.Lesson( @@ -50,7 +52,7 @@ def make_instance(self, include_optional): timezone = 'UTC', ), created_at = , updated_at = , ) - ], + ], meta = wonde.models.list_school_lessons_200_response_meta.listSchoolLessons_200_response_meta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', @@ -62,7 +64,7 @@ def make_instance(self, include_optional): 'class' ], ) ) - else : + else: return ListSchoolLessons200Response( ) """ diff --git a/test/test_list_school_lessons200_response_meta.py b/test/test_list_school_lessons200_response_meta.py index c54fc54..b56542a 100644 --- a/test/test_list_school_lessons200_response_meta.py +++ b/test/test_list_school_lessons200_response_meta.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,10 @@ import unittest +from wonde.models.list_school_lessons200_response_meta import ( + ListSchoolLessons200ResponseMeta, +) + class TestListSchoolLessons200ResponseMeta(unittest.TestCase): """ListSchoolLessons200ResponseMeta unit test stubs""" @@ -22,27 +26,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchoolLessons200ResponseMeta: """Test ListSchoolLessons200ResponseMeta include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchoolLessons200ResponseMeta` """ - model = wonde.models.list_school_lessons200_response_meta.ListSchoolLessons200ResponseMeta() # noqa: E501 - if include_optional : + model = ListSchoolLessons200ResponseMeta() # noqa: E501 + if include_optional: return ListSchoolLessons200ResponseMeta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', previous = '', more = True, per_page = 2, - current_page = 1, ), + current_page = 1, ), includes = [ 'class' ] ) - else : + else: return ListSchoolLessons200ResponseMeta( ) """ diff --git a/test/test_list_school_students200_response.py b/test/test_list_school_students200_response.py index 8c43373..1856190 100644 --- a/test/test_list_school_students200_response.py +++ b/test/test_list_school_students200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,10 @@ import unittest +from wonde.models.list_school_students200_response import ( + ListSchoolStudents200Response, +) + class TestListSchoolStudents200Response(unittest.TestCase): """ListSchoolStudents200Response unit test stubs""" @@ -22,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchoolStudents200Response: """Test ListSchoolStudents200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchoolStudents200Response` """ - model = wonde.models.list_school_students200_response.ListSchoolStudents200Response() # noqa: E501 - if include_optional : + model = ListSchoolStudents200Response() # noqa: E501 + if include_optional: return ListSchoolStudents200Response( data = [ wonde.models.student.Student( @@ -44,17 +48,22 @@ def make_instance(self, include_optional): legal_surname = 'Smith', legal_forename = 'Tom', gender = 'MALE', - date_of_birth = wonde.models.date_time_object.DateTimeObject( + date_of_birth = 'Thu Feb 11 00:00:00 UTC 2010', + restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ), - restored_at = wonde.models.date_time_object.DateTimeObject( + created_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ), - created_at = , - updated_at = , ) - ], + updated_at = , + contact_details = wonde.models.employee_contact_details.Employee_contact_details( + data = wonde.models.contact_details.ContactDetails( + emails = wonde.models.contact_details_emails.ContactDetails_emails( + email = '', ), ), ), + education_details = wonde.models.student_education_details.Student_education_details(), ) + ], meta = wonde.models.meta.Meta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', @@ -66,7 +75,7 @@ def make_instance(self, include_optional): '' ], ) ) - else : + else: return ListSchoolStudents200Response( ) """ diff --git a/test/test_list_school_subjects200_response.py b/test/test_list_school_subjects200_response.py index 495eba0..a373b00 100644 --- a/test/test_list_school_subjects200_response.py +++ b/test/test_list_school_subjects200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,10 @@ import unittest +from wonde.models.list_school_subjects200_response import ( + ListSchoolSubjects200Response, +) + class TestListSchoolSubjects200Response(unittest.TestCase): """ListSchoolSubjects200Response unit test stubs""" @@ -22,15 +26,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchoolSubjects200Response: """Test ListSchoolSubjects200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchoolSubjects200Response` """ - model = wonde.models.list_school_subjects200_response.ListSchoolSubjects200Response() # noqa: E501 - if include_optional : + model = ListSchoolSubjects200Response() # noqa: E501 + if include_optional: return ListSchoolSubjects200Response( data = [ wonde.models.subject.Subject( @@ -47,7 +51,7 @@ def make_instance(self, include_optional): date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ), ) - ], + ], meta = wonde.models.meta.Meta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', @@ -59,7 +63,7 @@ def make_instance(self, include_optional): '' ], ) ) - else : + else: return ListSchoolSubjects200Response( ) """ diff --git a/test/test_list_schools200_response.py b/test/test_list_schools200_response.py index 248bb77..74c9074 100644 --- a/test/test_list_schools200_response.py +++ b/test/test_list_schools200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.list_schools200_response import ListSchools200Response + class TestListSchools200Response(unittest.TestCase): """ListSchools200Response unit test stubs""" @@ -22,24 +24,24 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> ListSchools200Response: """Test ListSchools200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `ListSchools200Response` """ - model = wonde.models.list_schools200_response.ListSchools200Response() # noqa: E501 - if include_optional : + model = ListSchools200Response() # noqa: E501 + if include_optional: return ListSchools200Response( data = [ wonde.models.school.School( id = '', name = '', - establishment_number = 56, + establishment_number = '', urn = 56, phase_of_education = '', - la_code = 56, + la_code = '', timezone = '', mis = '', address = wonde.models.school_address.School_address( @@ -59,10 +61,10 @@ def make_instance(self, include_optional): domain = 'api.wonde.com', school_url = 'https://api.wonde.com/v1.0/schools/A1300691890', identifiers = wonde.models.school_region_identifiers.School_region_identifiers( - la_code = 201, - establishment_number = 3614, + la_code = '201', + establishment_number = '3614', urn = 10000, ), ), ) - ], + ], meta = wonde.models.meta.Meta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', @@ -74,7 +76,7 @@ def make_instance(self, include_optional): '' ], ) ) - else : + else: return ListSchools200Response( ) """ diff --git a/test/test_meta.py b/test/test_meta.py index 04f0fe7..5f55aec 100644 --- a/test/test_meta.py +++ b/test/test_meta.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.meta import Meta + class TestMeta(unittest.TestCase): """Meta unit test stubs""" @@ -22,27 +24,27 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Meta: """Test Meta include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Meta` """ - model = wonde.models.meta.Meta() # noqa: E501 - if include_optional : + model = Meta() # noqa: E501 + if include_optional: return Meta( pagination = wonde.models.pagination.Pagination( next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', previous = '', more = True, per_page = 2, - current_page = 1, ), + current_page = 1, ), includes = [ '' ] ) - else : + else: return Meta( ) """ diff --git a/test/test_pagination.py b/test/test_pagination.py index 6884794..7b20e7a 100644 --- a/test/test_pagination.py +++ b/test/test_pagination.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.pagination import Pagination + class TestPagination(unittest.TestCase): """Pagination unit test stubs""" @@ -22,23 +24,23 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Pagination: """Test Pagination include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Pagination` """ - model = wonde.models.pagination.Pagination() # noqa: E501 - if include_optional : + model = Pagination() # noqa: E501 + if include_optional: return Pagination( - next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', - previous = '', - more = True, - per_page = 2, + next = 'https://api.wonde.com/v1.0/schools/{school_id}/students/?page=2', + previous = '', + more = True, + per_page = 2, current_page = 1 ) - else : + else: return Pagination( ) """ diff --git a/test/test_permission.py b/test/test_permission.py index 9308085..cd939be 100644 --- a/test/test_permission.py +++ b/test/test_permission.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.permission import Permission + class TestPermission(unittest.TestCase): """Permission unit test stubs""" @@ -22,30 +24,30 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Permission: """Test Permission include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Permission` """ - model = wonde.models.permission.Permission() # noqa: E501 - if include_optional : + model = Permission() # noqa: E501 + if include_optional: return Permission( - identity = '', - name = '', - description = '', - parent = '', - group = '', + identity = '', + name = '', + description = '', + parent = '', + group = '', active_from = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), - optional = True, - approved = True, + timezone = 'UTC', ), + optional = True, + approved = True, audited = True ) - else : + else: return Permission( ) """ diff --git a/test/test_request_school_access200_response.py b/test/test_request_school_access200_response.py index fedbf4c..1bd78df 100644 --- a/test/test_request_school_access200_response.py +++ b/test/test_request_school_access200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,10 @@ import unittest +from wonde.models.request_school_access200_response import ( + RequestSchoolAccess200Response, +) + class TestRequestSchoolAccess200Response(unittest.TestCase): """RequestSchoolAccess200Response unit test stubs""" @@ -22,21 +26,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RequestSchoolAccess200Response: """Test RequestSchoolAccess200Response include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `RequestSchoolAccess200Response` """ - model = wonde.models.request_school_access200_response.RequestSchoolAccess200Response() # noqa: E501 - if include_optional : + model = RequestSchoolAccess200Response() # noqa: E501 + if include_optional: return RequestSchoolAccess200Response( - success = True, - state = '', + success = True, + state = '', message = '' ) - else : + else: return RequestSchoolAccess200Response( ) """ diff --git a/test/test_request_school_access_request.py b/test/test_request_school_access_request.py index c7fb75a..6ba2e8c 100644 --- a/test/test_request_school_access_request.py +++ b/test/test_request_school_access_request.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.request_school_access_request import RequestSchoolAccessRequest + class TestRequestSchoolAccessRequest(unittest.TestCase): """RequestSchoolAccessRequest unit test stubs""" @@ -22,15 +24,15 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> RequestSchoolAccessRequest: """Test RequestSchoolAccessRequest include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `RequestSchoolAccessRequest` """ - model = wonde.models.request_school_access_request.RequestSchoolAccessRequest() # noqa: E501 - if include_optional : + model = RequestSchoolAccessRequest() # noqa: E501 + if include_optional: return RequestSchoolAccessRequest( contacts = [ wonde.models.contact.Contact( @@ -41,7 +43,7 @@ def make_instance(self, include_optional): notes = '', ) ] ) - else : + else: return RequestSchoolAccessRequest( ) """ diff --git a/test/test_school.py b/test/test_school.py index 9b1892d..5a493ca 100644 --- a/test/test_school.py +++ b/test/test_school.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.school import School + class TestSchool(unittest.TestCase): """School unit test stubs""" @@ -22,24 +24,24 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> School: """Test School include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `School` """ - model = wonde.models.school.School() # noqa: E501 - if include_optional : + model = School() # noqa: E501 + if include_optional: return School( - id = '', - name = '', - establishment_number = 56, - urn = 56, - phase_of_education = '', - la_code = 56, - timezone = '', - mis = '', + id = '', + name = '', + establishment_number = '', + urn = 56, + phase_of_education = '', + la_code = '', + timezone = '', + mis = '', address = wonde.models.school_address.School_address( address_line_1 = 'St James's Passage', address_line_2 = 'Duke's Place', @@ -47,21 +49,21 @@ def make_instance(self, include_optional): address_postcode = 'EC3A 5DE', address_country = wonde.models.school_address_address_country.School_address_address_country( code = 'GBR', - name = 'United Kingdom', ), ), + name = 'United Kingdom', ), ), extended = wonde.models.school_extended.School_extended( allows_writeback = True, has_timetables = True, - has_lesson_attendance = True, ), + has_lesson_attendance = True, ), region = wonde.models.school_region.School_region( code = 'GBR', domain = 'api.wonde.com', school_url = 'https://api.wonde.com/v1.0/schools/A1300691890', identifiers = wonde.models.school_region_identifiers.School_region_identifiers( - la_code = 201, - establishment_number = 3614, + la_code = '201', + establishment_number = '3614', urn = 10000, ), ) ) - else : + else: return School( ) """ diff --git a/test/test_school_address.py b/test/test_school_address.py index 6dac927..3587324 100644 --- a/test/test_school_address.py +++ b/test/test_school_address.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.school_address import SchoolAddress + class TestSchoolAddress(unittest.TestCase): """SchoolAddress unit test stubs""" @@ -22,25 +24,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> SchoolAddress: """Test SchoolAddress include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `SchoolAddress` """ - model = wonde.models.school_address.SchoolAddress() # noqa: E501 - if include_optional : + model = SchoolAddress() # noqa: E501 + if include_optional: return SchoolAddress( - address_line_1 = 'St James's Passage', - address_line_2 = 'Duke's Place', - address_town = 'London', - address_postcode = 'EC3A 5DE', + address_line_1 = 'St James's Passage', + address_line_2 = 'Duke's Place', + address_town = 'London', + address_postcode = 'EC3A 5DE', address_country = wonde.models.school_address_address_country.School_address_address_country( code = 'GBR', name = 'United Kingdom', ) ) - else : + else: return SchoolAddress( ) """ diff --git a/test/test_school_address_address_country.py b/test/test_school_address_address_country.py index 57f1713..01895a2 100644 --- a/test/test_school_address_address_country.py +++ b/test/test_school_address_address_country.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.school_address_address_country import SchoolAddressAddressCountry + class TestSchoolAddressAddressCountry(unittest.TestCase): """SchoolAddressAddressCountry unit test stubs""" @@ -22,20 +24,20 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> SchoolAddressAddressCountry: """Test SchoolAddressAddressCountry include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `SchoolAddressAddressCountry` """ - model = wonde.models.school_address_address_country.SchoolAddressAddressCountry() # noqa: E501 - if include_optional : + model = SchoolAddressAddressCountry() # noqa: E501 + if include_optional: return SchoolAddressAddressCountry( - code = 'GBR', + code = 'GBR', name = 'United Kingdom' ) - else : + else: return SchoolAddressAddressCountry( ) """ diff --git a/test/test_model_class.py b/test/test_school_class.py similarity index 66% rename from test/test_model_class.py rename to test/test_school_class.py index 2f1518f..7f09f15 100644 --- a/test/test_model_class.py +++ b/test/test_school_class.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 import unittest +import datetime +from wonde.models.school_class import SchoolClass # noqa: E501 -class TestModelClass(unittest.TestCase): - """ModelClass unit test stubs""" +class TestSchoolClass(unittest.TestCase): + """SchoolClass unit test stubs""" def setUp(self): pass @@ -22,36 +26,36 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): - """Test ModelClass - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # uncomment below to create an instance of `ModelClass` + def make_instance(self, include_optional) -> SchoolClass: + """Test SchoolClass + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SchoolClass` """ - model = wonde.models.model_class.ModelClass() # noqa: E501 - if include_optional : - return ModelClass( - id = 'A1329183376', - mis_id = '8925', - name = '10A/Ar1', - code = '10A/Ar1', - description = '10A/Ar1', - subject = None, - alternative = False, + model = SchoolClass() # noqa: E501 + if include_optional: + return SchoolClass( + id = 'A1329183376', + mis_id = '8925', + name = '10A/Ar1', + code = '10A/Ar1', + description = '10A/Ar1', + subject = None, + alternative = False, restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), created_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), updated_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), - students = wonde.models.class_students.Class_students( + timezone = 'UTC', ), + students = wonde.models.school_class_students.SchoolClass_students( data = [ wonde.models.student.Student( id = 'A1749191433', @@ -64,18 +68,20 @@ def make_instance(self, include_optional): legal_surname = 'Smith', legal_forename = 'Tom', gender = 'MALE', - date_of_birth = wonde.models.date_time_object.DateTimeObject( + date_of_birth = 'Thu Feb 11 00:00:00 UTC 2010', + restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ), - restored_at = wonde.models.date_time_object.DateTimeObject( + created_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ), - created_at = , - updated_at = , ) - ], ), - employees = wonde.models.list_school_employees_200_response.listSchoolEmployees_200_response( + updated_at = , + contact_details = wonde.models.employee_contact_details.Employee_contact_details(), + education_details = wonde.models.student_education_details.Student_education_details(), ) + ], ), + employees = wonde.models.school_class_employees.SchoolClass_employees( data = [ wonde.models.employee.Employee( id = 'A1329183376', @@ -89,7 +95,7 @@ def make_instance(self, include_optional): legal_surname = 'Smith', legal_forename = 'Sally', gender = 'female', - date_of_birth = '1963-02-11T00:00Z', + date_of_birth = 'Mon Feb 11 00:00:00 UTC 1963', restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, @@ -98,9 +104,10 @@ def make_instance(self, include_optional): date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ), - updated_at = , ) - ], ), - lessons = wonde.models.class_lessons.Class_lessons( + updated_at = , + contact_details = wonde.models.employee_contact_details.Employee_contact_details(), ) + ], ), + lessons = wonde.models.school_class_lessons.SchoolClass_lessons( data = [ wonde.models.lesson.Lesson( id = '', @@ -121,16 +128,15 @@ def make_instance(self, include_optional): updated_at = , ) ], ) ) - else : - return ModelClass( + else: + return SchoolClass( ) """ - def testModelClass(self): - """Test ModelClass""" + def testSchoolClass(self): + """Test SchoolClass""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) - if __name__ == '__main__': unittest.main() diff --git a/test/test_school_class_employees.py b/test/test_school_class_employees.py new file mode 100644 index 0000000..64f800e --- /dev/null +++ b/test/test_school_class_employees.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.school_class_employees import SchoolClassEmployees # noqa: E501 + +class TestSchoolClassEmployees(unittest.TestCase): + """SchoolClassEmployees unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SchoolClassEmployees: + """Test SchoolClassEmployees + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SchoolClassEmployees` + """ + model = SchoolClassEmployees() # noqa: E501 + if include_optional: + return SchoolClassEmployees( + data = [ + wonde.models.employee.Employee( + id = 'A1329183376', + upi = '5cc4ab015f8f7870b581e30e0ef474fa', + mis_id = '26', + title = 'Mrs', + initials = 'SS', + surname = 'Smith', + forename = 'Sally', + middle_names = 'Victoria', + legal_surname = 'Smith', + legal_forename = 'Sally', + gender = 'female', + date_of_birth = 'Mon Feb 11 00:00:00 UTC 1963', + restored_at = wonde.models.date_time_object.DateTimeObject( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timezone_type = 3, + timezone = 'UTC', ), + created_at = wonde.models.date_time_object.DateTimeObject( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timezone_type = 3, + timezone = 'UTC', ), + updated_at = , + contact_details = wonde.models.employee_contact_details.Employee_contact_details(), ) + ] + ) + else: + return SchoolClassEmployees( + ) + """ + + def testSchoolClassEmployees(self): + """Test SchoolClassEmployees""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_class_lessons.py b/test/test_school_class_lessons.py similarity index 57% rename from test/test_class_lessons.py rename to test/test_school_class_lessons.py index 14b6db8..fa11c44 100644 --- a/test/test_class_lessons.py +++ b/test/test_school_class_lessons.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 import unittest +import datetime +from wonde.models.school_class_lessons import SchoolClassLessons # noqa: E501 -class TestClassLessons(unittest.TestCase): - """ClassLessons unit test stubs""" +class TestSchoolClassLessons(unittest.TestCase): + """SchoolClassLessons unit test stubs""" def setUp(self): pass @@ -22,16 +26,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): - """Test ClassLessons - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # uncomment below to create an instance of `ClassLessons` + def make_instance(self, include_optional) -> SchoolClassLessons: + """Test SchoolClassLessons + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SchoolClassLessons` """ - model = wonde.models.class_lessons.ClassLessons() # noqa: E501 - if include_optional : - return ClassLessons( + model = SchoolClassLessons() # noqa: E501 + if include_optional: + return SchoolClassLessons( data = [ wonde.models.lesson.Lesson( id = '', @@ -52,16 +56,15 @@ def make_instance(self, include_optional): updated_at = , ) ] ) - else : - return ClassLessons( + else: + return SchoolClassLessons( ) """ - def testClassLessons(self): - """Test ClassLessons""" + def testSchoolClassLessons(self): + """Test SchoolClassLessons""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) - if __name__ == '__main__': unittest.main() diff --git a/test/test_school_class_students.py b/test/test_school_class_students.py new file mode 100644 index 0000000..834dc46 --- /dev/null +++ b/test/test_school_class_students.py @@ -0,0 +1,76 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.school_class_students import SchoolClassStudents # noqa: E501 + +class TestSchoolClassStudents(unittest.TestCase): + """SchoolClassStudents unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SchoolClassStudents: + """Test SchoolClassStudents + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SchoolClassStudents` + """ + model = SchoolClassStudents() # noqa: E501 + if include_optional: + return SchoolClassStudents( + data = [ + wonde.models.student.Student( + id = 'A1749191433', + upi = '8d444684b7aa79bc97f8594a4aab7ce3', + mis_id = '9919', + initials = 'TS', + surname = 'Smith', + forename = 'Tom', + middle_names = '', + legal_surname = 'Smith', + legal_forename = 'Tom', + gender = 'MALE', + date_of_birth = 'Thu Feb 11 00:00:00 UTC 2010', + restored_at = wonde.models.date_time_object.DateTimeObject( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timezone_type = 3, + timezone = 'UTC', ), + created_at = wonde.models.date_time_object.DateTimeObject( + date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), + timezone_type = 3, + timezone = 'UTC', ), + updated_at = , + contact_details = wonde.models.employee_contact_details.Employee_contact_details(), + education_details = wonde.models.student_education_details.Student_education_details(), ) + ] + ) + else: + return SchoolClassStudents( + ) + """ + + def testSchoolClassStudents(self): + """Test SchoolClassStudents""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_class_subject_one_of.py b/test/test_school_class_subject.py similarity index 53% rename from test/test_class_subject_one_of.py rename to test/test_school_class_subject.py index d6557ca..6d96ea6 100644 --- a/test/test_class_subject_one_of.py +++ b/test/test_school_class_subject.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 import unittest +import datetime +from wonde.models.school_class_subject import SchoolClassSubject # noqa: E501 -class TestClassSubjectOneOf(unittest.TestCase): - """ClassSubjectOneOf unit test stubs""" +class TestSchoolClassSubject(unittest.TestCase): + """SchoolClassSubject unit test stubs""" def setUp(self): pass @@ -22,16 +26,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): - """Test ClassSubjectOneOf - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # uncomment below to create an instance of `ClassSubjectOneOf` + def make_instance(self, include_optional) -> SchoolClassSubject: + """Test SchoolClassSubject + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SchoolClassSubject` """ - model = wonde.models.class_subject_one_of.ClassSubjectOneOf() # noqa: E501 - if include_optional : - return ClassSubjectOneOf( + model = SchoolClassSubject() # noqa: E501 + if include_optional: + return SchoolClassSubject( data = wonde.models.subject.Subject( id = 'A1362597725', mis_id = '520', @@ -47,16 +51,15 @@ def make_instance(self, include_optional): timezone_type = 3, timezone = 'UTC', ), ) ) - else : - return ClassSubjectOneOf( + else: + return SchoolClassSubject( ) """ - def testClassSubjectOneOf(self): - """Test ClassSubjectOneOf""" + def testSchoolClassSubject(self): + """Test SchoolClassSubject""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) - if __name__ == '__main__': unittest.main() diff --git a/test/test_class_subject.py b/test/test_school_class_subject_one_of.py similarity index 51% rename from test/test_class_subject.py rename to test/test_school_class_subject_one_of.py index 65e1c5d..1356dbc 100644 --- a/test/test_class_subject.py +++ b/test/test_school_class_subject_one_of.py @@ -1,20 +1,24 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 import unittest +import datetime +from wonde.models.school_class_subject_one_of import SchoolClassSubjectOneOf # noqa: E501 -class TestClassSubject(unittest.TestCase): - """ClassSubject unit test stubs""" +class TestSchoolClassSubjectOneOf(unittest.TestCase): + """SchoolClassSubjectOneOf unit test stubs""" def setUp(self): pass @@ -22,16 +26,16 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): - """Test ClassSubject - include_option is a boolean, when False only required - params are included, when True both required and - optional params are included""" - # uncomment below to create an instance of `ClassSubject` + def make_instance(self, include_optional) -> SchoolClassSubjectOneOf: + """Test SchoolClassSubjectOneOf + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SchoolClassSubjectOneOf` """ - model = wonde.models.class_subject.ClassSubject() # noqa: E501 - if include_optional : - return ClassSubject( + model = SchoolClassSubjectOneOf() # noqa: E501 + if include_optional: + return SchoolClassSubjectOneOf( data = wonde.models.subject.Subject( id = 'A1362597725', mis_id = '520', @@ -47,16 +51,15 @@ def make_instance(self, include_optional): timezone_type = 3, timezone = 'UTC', ), ) ) - else : - return ClassSubject( + else: + return SchoolClassSubjectOneOf( ) """ - def testClassSubject(self): - """Test ClassSubject""" + def testSchoolClassSubjectOneOf(self): + """Test SchoolClassSubjectOneOf""" # inst_req_only = self.make_instance(include_optional=False) # inst_req_and_optional = self.make_instance(include_optional=True) - if __name__ == '__main__': unittest.main() diff --git a/test/test_school_extended.py b/test/test_school_extended.py index ce8d272..2956dfe 100644 --- a/test/test_school_extended.py +++ b/test/test_school_extended.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.school_extended import SchoolExtended + class TestSchoolExtended(unittest.TestCase): """SchoolExtended unit test stubs""" @@ -22,21 +24,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> SchoolExtended: """Test SchoolExtended include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `SchoolExtended` """ - model = wonde.models.school_extended.SchoolExtended() # noqa: E501 - if include_optional : + model = SchoolExtended() # noqa: E501 + if include_optional: return SchoolExtended( - allows_writeback = True, - has_timetables = True, + allows_writeback = True, + has_timetables = True, has_lesson_attendance = True ) - else : + else: return SchoolExtended( ) """ diff --git a/test/test_school_meta.py b/test/test_school_meta.py index bd07294..f721b4b 100644 --- a/test/test_school_meta.py +++ b/test/test_school_meta.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.school_meta import SchoolMeta + class TestSchoolMeta(unittest.TestCase): """SchoolMeta unit test stubs""" @@ -22,22 +24,22 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> SchoolMeta: """Test SchoolMeta include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `SchoolMeta` """ - model = wonde.models.school_meta.SchoolMeta() # noqa: E501 - if include_optional : + model = SchoolMeta() # noqa: E501 + if include_optional: return SchoolMeta( - online = True, - approved = True, - audited = True, + online = True, + approved = True, + audited = True, custom_attendance_codes = True ) - else : + else: return SchoolMeta( ) """ diff --git a/test/test_school_region.py b/test/test_school_region.py index 36b1016..ca33d80 100644 --- a/test/test_school_region.py +++ b/test/test_school_region.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.school_region import SchoolRegion + class TestSchoolRegion(unittest.TestCase): """SchoolRegion unit test stubs""" @@ -22,25 +24,25 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> SchoolRegion: """Test SchoolRegion include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `SchoolRegion` """ - model = wonde.models.school_region.SchoolRegion() # noqa: E501 - if include_optional : + model = SchoolRegion() # noqa: E501 + if include_optional: return SchoolRegion( - code = 'GBR', - domain = 'api.wonde.com', - school_url = 'https://api.wonde.com/v1.0/schools/A1300691890', + code = 'GBR', + domain = 'api.wonde.com', + school_url = 'https://api.wonde.com/v1.0/schools/A1300691890', identifiers = wonde.models.school_region_identifiers.School_region_identifiers( - la_code = 201, - establishment_number = 3614, + la_code = '201', + establishment_number = '3614', urn = 10000, ) ) - else : + else: return SchoolRegion( ) """ diff --git a/test/test_school_region_identifiers.py b/test/test_school_region_identifiers.py index 50af51e..4222124 100644 --- a/test/test_school_region_identifiers.py +++ b/test/test_school_region_identifiers.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.school_region_identifiers import SchoolRegionIdentifiers + class TestSchoolRegionIdentifiers(unittest.TestCase): """SchoolRegionIdentifiers unit test stubs""" @@ -22,21 +24,21 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> SchoolRegionIdentifiers: """Test SchoolRegionIdentifiers include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `SchoolRegionIdentifiers` """ - model = wonde.models.school_region_identifiers.SchoolRegionIdentifiers() # noqa: E501 - if include_optional : + model = SchoolRegionIdentifiers() # noqa: E501 + if include_optional: return SchoolRegionIdentifiers( - la_code = 201, - establishment_number = 3614, + la_code = '201', + establishment_number = '3614', urn = 10000 ) - else : + else: return SchoolRegionIdentifiers( ) """ diff --git a/test/test_schools_api.py b/test/test_schools_api.py index b76a7d7..b7fadd1 100644 --- a/test/test_schools_api.py +++ b/test/test_schools_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,103 +12,103 @@ import unittest -import wonde +from wonde.api.schools_api import SchoolsApi class TestSchoolsApi(unittest.TestCase): """SchoolsApi unit test stubs""" - def setUp(self): - self.api = wonde.api.schools_api.SchoolsApi() + def setUp(self) -> None: + self.api = SchoolsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_school(self): + def test_get_school(self) -> None: """Test case for get_school Retrieve a specific school # noqa: E501 """ pass - def test_get_school_acl(self): + def test_get_school_acl(self) -> None: """Test case for get_school_acl Retrieve the access control list applied to a school # noqa: E501 """ pass - def test_get_school_meta(self): + def test_get_school_meta(self) -> None: """Test case for get_school_meta Retrieve meta data for a school # noqa: E501 """ pass - def test_get_school_permissions(self): + def test_get_school_permissions(self) -> None: """Test case for get_school_permissions Retrieve the permissions applied to a school # noqa: E501 """ pass - def test_list_schools(self): + def test_list_schools(self) -> None: """Test case for list_schools Retrieve all schools # noqa: E501 """ pass - def test_list_schools_approved(self): + def test_list_schools_approved(self) -> None: """Test case for list_schools_approved Retrieve all approved schools # noqa: E501 """ pass - def test_list_schools_audited(self): + def test_list_schools_audited(self) -> None: """Test case for list_schools_audited Retrieve all audited schools # noqa: E501 """ pass - def test_list_schools_declined(self): + def test_list_schools_declined(self) -> None: """Test case for list_schools_declined Retrieve all schools with declined access # noqa: E501 """ pass - def test_list_schools_offline(self): + def test_list_schools_offline(self) -> None: """Test case for list_schools_offline Retrieve all offline schools # noqa: E501 """ pass - def test_list_schools_pending(self): + def test_list_schools_pending(self) -> None: """Test case for list_schools_pending Retrieve all schools with pending access request # noqa: E501 """ pass - def test_list_schools_revoked(self): + def test_list_schools_revoked(self) -> None: """Test case for list_schools_revoked Retrieve all schools with revoked access # noqa: E501 """ pass - def test_request_school_access(self): + def test_request_school_access(self) -> None: """Test case for request_school_access Request access to a school # noqa: E501 """ pass - def test_revoke_school_access(self): + def test_revoke_school_access(self) -> None: """Test case for revoke_school_access Revoke access to a school # noqa: E501 diff --git a/test/test_student.py b/test/test_student.py index 1fbdaa8..065cee7 100644 --- a/test/test_student.py +++ b/test/test_student.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.student import Student + class TestStudent(unittest.TestCase): """Student unit test stubs""" @@ -22,44 +24,49 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Student: """Test Student include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Student` """ - model = wonde.models.student.Student() # noqa: E501 - if include_optional : + model = Student() # noqa: E501 + if include_optional: return Student( - id = 'A1749191433', - upi = '8d444684b7aa79bc97f8594a4aab7ce3', - mis_id = '9919', - initials = 'TS', - surname = 'Smith', - forename = 'Tom', - middle_names = '', - legal_surname = 'Smith', - legal_forename = 'Tom', - gender = 'MALE', - date_of_birth = wonde.models.date_time_object.DateTimeObject( - date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - timezone_type = 3, - timezone = 'UTC', ), + id = 'A1749191433', + upi = '8d444684b7aa79bc97f8594a4aab7ce3', + mis_id = '9919', + initials = 'TS', + surname = 'Smith', + forename = 'Tom', + middle_names = '', + legal_surname = 'Smith', + legal_forename = 'Tom', + gender = 'MALE', + date_of_birth = 'Thu Feb 11 00:00:00 UTC 2010', restored_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), created_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), updated_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ) + timezone = 'UTC', ), + contact_details = wonde.models.employee_contact_details.Employee_contact_details( + data = wonde.models.contact_details.ContactDetails( + emails = wonde.models.contact_details_emails.ContactDetails_emails( + email = '', ), ), ), + education_details = wonde.models.student_education_details.Student_education_details( + data = wonde.models.education_details.EducationDetails( + current_nc_year = '', + local_upn = '', ), ) ) - else : + else: return Student( ) """ diff --git a/test/test_student_education_details.py b/test/test_student_education_details.py new file mode 100644 index 0000000..29ff0c3 --- /dev/null +++ b/test/test_student_education_details.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest +import datetime + +from wonde.models.student_education_details import StudentEducationDetails # noqa: E501 + +class TestStudentEducationDetails(unittest.TestCase): + """StudentEducationDetails unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> StudentEducationDetails: + """Test StudentEducationDetails + include_option is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `StudentEducationDetails` + """ + model = StudentEducationDetails() # noqa: E501 + if include_optional: + return StudentEducationDetails( + data = wonde.models.education_details.EducationDetails( + current_nc_year = '', + local_upn = '', ) + ) + else: + return StudentEducationDetails( + ) + """ + + def testStudentEducationDetails(self): + """Test StudentEducationDetails""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_students_api.py b/test/test_students_api.py index bc042aa..377eec8 100644 --- a/test/test_students_api.py +++ b/test/test_students_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,26 +12,26 @@ import unittest -import wonde +from wonde.api.students_api import StudentsApi class TestStudentsApi(unittest.TestCase): """StudentsApi unit test stubs""" - def setUp(self): - self.api = wonde.api.students_api.StudentsApi() + def setUp(self) -> None: + self.api = StudentsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_school_student(self): + def test_get_school_student(self) -> None: """Test case for get_school_student Retrieve a specific student in a specific school # noqa: E501 """ pass - def test_list_school_students(self): + def test_list_school_students(self) -> None: """Test case for list_school_students Retrieve a list of students for a specific school # noqa: E501 diff --git a/test/test_subject.py b/test/test_subject.py index cc42ffa..d80c857 100644 --- a/test/test_subject.py +++ b/test/test_subject.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,6 +12,8 @@ import unittest +from wonde.models.subject import Subject + class TestSubject(unittest.TestCase): """Subject unit test stubs""" @@ -22,31 +24,31 @@ def setUp(self): def tearDown(self): pass - def make_instance(self, include_optional): + def make_instance(self, include_optional) -> Subject: """Test Subject include_option is a boolean, when False only required params are included, when True both required and optional params are included""" # uncomment below to create an instance of `Subject` """ - model = wonde.models.subject.Subject() # noqa: E501 - if include_optional : + model = Subject() # noqa: E501 + if include_optional: return Subject( - id = 'A1362597725', - mis_id = '520', - code = 'Bi', - name = 'Biology', - active = True, + id = 'A1362597725', + mis_id = '520', + code = 'Bi', + name = 'Biology', + active = True, created_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, - timezone = 'UTC', ), + timezone = 'UTC', ), updated_at = wonde.models.date_time_object.DateTimeObject( date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), timezone_type = 3, timezone = 'UTC', ) ) - else : + else: return Subject( ) """ diff --git a/test/test_subjects_api.py b/test/test_subjects_api.py index a0c21fb..b6fe43c 100644 --- a/test/test_subjects_api.py +++ b/test/test_subjects_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -12,26 +12,26 @@ import unittest -import wonde +from wonde.api.subjects_api import SubjectsApi class TestSubjectsApi(unittest.TestCase): """SubjectsApi unit test stubs""" - def setUp(self): - self.api = wonde.api.subjects_api.SubjectsApi() + def setUp(self) -> None: + self.api = SubjectsApi() - def tearDown(self): + def tearDown(self) -> None: pass - def test_get_school_subject(self): + def test_get_school_subject(self) -> None: """Test case for get_school_subject Retrieve a specific subject for a school # noqa: E501 """ pass - def test_list_school_subjects(self): + def test_list_school_subjects(self) -> None: """Test case for list_school_subjects Retrieve subjects for a school # noqa: E501 diff --git a/wonde/__init__.py b/wonde/__init__.py index 7e41660..8cfc370 100644 --- a/wonde/__init__.py +++ b/wonde/__init__.py @@ -5,7 +5,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -40,14 +40,15 @@ from wonde.models.acl import ACL from wonde.models.acl_ids_inner import ACLIdsInner from wonde.models.acl_ids_inner_one_of import ACLIdsInnerOneOf -from wonde.models.class_lessons import ClassLessons -from wonde.models.class_students import ClassStudents -from wonde.models.class_subject import ClassSubject -from wonde.models.class_subject_one_of import ClassSubjectOneOf from wonde.models.contact import Contact +from wonde.models.contact_details import ContactDetails +from wonde.models.contact_details_emails import ContactDetailsEmails from wonde.models.date_time_object import DateTimeObject from wonde.models.deletion import Deletion +from wonde.models.education_details import EducationDetails from wonde.models.employee import Employee +from wonde.models.employee_contact_details import EmployeeContactDetails +from wonde.models.get_school200_response import GetSchool200Response from wonde.models.get_school_acl200_response import GetSchoolAcl200Response from wonde.models.get_school_class200_response import GetSchoolClass200Response from wonde.models.get_school_meta200_response import GetSchoolMeta200Response @@ -62,7 +63,6 @@ from wonde.models.list_school_subjects200_response import ListSchoolSubjects200Response from wonde.models.list_schools200_response import ListSchools200Response from wonde.models.meta import Meta -from wonde.models.model_class import ModelClass from wonde.models.pagination import Pagination from wonde.models.permission import Permission from wonde.models.request_school_access200_response import RequestSchoolAccess200Response @@ -70,9 +70,16 @@ from wonde.models.school import School from wonde.models.school_address import SchoolAddress from wonde.models.school_address_address_country import SchoolAddressAddressCountry +from wonde.models.school_class import SchoolClass +from wonde.models.school_class_employees import SchoolClassEmployees +from wonde.models.school_class_lessons import SchoolClassLessons +from wonde.models.school_class_students import SchoolClassStudents +from wonde.models.school_class_subject import SchoolClassSubject +from wonde.models.school_class_subject_one_of import SchoolClassSubjectOneOf from wonde.models.school_extended import SchoolExtended from wonde.models.school_meta import SchoolMeta from wonde.models.school_region import SchoolRegion from wonde.models.school_region_identifiers import SchoolRegionIdentifiers from wonde.models.student import Student +from wonde.models.student_education_details import StudentEducationDetails from wonde.models.subject import Subject diff --git a/wonde/api/classes_api.py b/wonde/api/classes_api.py index 90634ff..0dd13eb 100644 --- a/wonde/api/classes_api.py +++ b/wonde/api/classes_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -11,10 +11,7 @@ import re # noqa: F401 -from datetime import ( - date, - datetime, -) +from datetime import date from typing import Optional from pydantic import ( @@ -41,7 +38,7 @@ class ClassesApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -73,10 +70,10 @@ def get_school_class( :type include: List[str] :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -84,9 +81,8 @@ def get_school_class( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_class_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_class_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_class_with_http_info(school_id, class_id, include, **kwargs) @validate_arguments @@ -228,6 +224,12 @@ def list_school_classes( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include') ] = None, @@ -250,7 +252,7 @@ def list_school_classes( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_classes(school_id, updated_after, updated_before, per_page, include, has_students, has_lessons, class_name, class_subject, async_req=True) + >>> thread = api.list_school_classes(school_id, updated_after, updated_before, per_page, page, cursor, include, has_students, has_lessons, class_name, class_subject, async_req=True) >>> result = thread.get() :param school_id: The ID of the school (required) @@ -261,6 +263,10 @@ def list_school_classes( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include :type include: str :param has_students: Only get classes that have students @@ -273,10 +279,10 @@ def list_school_classes( :type class_subject: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -284,14 +290,15 @@ def list_school_classes( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_school_classes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_school_classes_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_school_classes_with_http_info( school_id, updated_after, updated_before, per_page, + page, + cursor, include, has_students, has_lessons, @@ -313,6 +320,12 @@ def list_school_classes_with_http_info( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include') ] = None, @@ -335,7 +348,7 @@ def list_school_classes_with_http_info( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_classes_with_http_info(school_id, updated_after, updated_before, per_page, include, has_students, has_lessons, class_name, class_subject, async_req=True) + >>> thread = api.list_school_classes_with_http_info(school_id, updated_after, updated_before, per_page, page, cursor, include, has_students, has_lessons, class_name, class_subject, async_req=True) >>> result = thread.get() :param school_id: The ID of the school (required) @@ -346,6 +359,10 @@ def list_school_classes_with_http_info( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include :type include: str :param has_students: Only get classes that have students @@ -388,6 +405,8 @@ def list_school_classes_with_http_info( 'updated_after', 'updated_before', 'per_page', + 'page', + 'cursor', 'include', 'has_students', 'has_lessons', @@ -426,7 +445,7 @@ def list_school_classes_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -439,7 +458,7 @@ def list_school_classes_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -454,8 +473,14 @@ def list_school_classes_with_http_info( if _params.get('per_page') is not None: _query_params.append(('per_page', _params['per_page'])) + if _params.get('page') is not None: + _query_params.append(('page', _params['page'])) + + if _params.get('cursor') is not None: + _query_params.append(('cursor', _params['cursor'])) + if _params.get('include') is not None: - _query_params.append(('include', _params['include'].value)) + _query_params.append(('include', _params['include'])) if _params.get('has_students') is not None: _query_params.append(('has_students', _params['has_students'])) diff --git a/wonde/api/deletions_api.py b/wonde/api/deletions_api.py index 23b7bb6..1f067e4 100644 --- a/wonde/api/deletions_api.py +++ b/wonde/api/deletions_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -11,10 +11,7 @@ import re # noqa: F401 -from datetime import ( - date, - datetime, -) +from datetime import date from typing import Optional from pydantic import Field, StrictInt, StrictStr, validate_arguments @@ -33,7 +30,7 @@ class DeletionsApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -78,10 +75,10 @@ def list_school_deletions( :type type: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -89,9 +86,8 @@ def list_school_deletions( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_school_deletions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_school_deletions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_school_deletions_with_http_info( school_id, updated_after, updated_before, per_page, type, **kwargs ) @@ -194,7 +190,7 @@ def list_school_deletions_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -207,7 +203,7 @@ def list_school_deletions_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', diff --git a/wonde/api/employees_api.py b/wonde/api/employees_api.py index 3c31189..d375c12 100644 --- a/wonde/api/employees_api.py +++ b/wonde/api/employees_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -11,10 +11,7 @@ import re # noqa: F401 -from datetime import ( - date, - datetime, -) +from datetime import date from typing import Optional from pydantic import Field, StrictBool, StrictInt, StrictStr, validate_arguments @@ -34,7 +31,7 @@ class EmployeesApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -61,10 +58,10 @@ def get_school_employee( :type employee_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -72,9 +69,8 @@ def get_school_employee( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_employee_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_employee_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_employee_with_http_info(school_id, employee_id, **kwargs) @validate_arguments @@ -208,6 +204,12 @@ def list_school_employees( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include') ] = None, @@ -248,7 +250,7 @@ def list_school_employees( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_employees(school_id, updated_after, updated_before, per_page, include, employment_start_before, employment_start_after, has_role, has_contract, has_class, has_group, user_defined_field, only_user_defined_fields, only_mis_ids, async_req=True) + >>> thread = api.list_school_employees(school_id, updated_after, updated_before, per_page, page, cursor, include, employment_start_before, employment_start_after, has_role, has_contract, has_class, has_group, user_defined_field, only_user_defined_fields, only_mis_ids, async_req=True) >>> result = thread.get() :param school_id: The ID of the school (required) @@ -259,6 +261,10 @@ def list_school_employees( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include :type include: str :param employment_start_before: Get employees who have started before a date @@ -281,10 +287,10 @@ def list_school_employees( :type only_mis_ids: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -292,14 +298,15 @@ def list_school_employees( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_school_employees_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_school_employees_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_school_employees_with_http_info( school_id, updated_after, updated_before, per_page, + page, + cursor, include, employment_start_before, employment_start_after, @@ -326,6 +333,12 @@ def list_school_employees_with_http_info( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include') ] = None, @@ -366,7 +379,7 @@ def list_school_employees_with_http_info( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_employees_with_http_info(school_id, updated_after, updated_before, per_page, include, employment_start_before, employment_start_after, has_role, has_contract, has_class, has_group, user_defined_field, only_user_defined_fields, only_mis_ids, async_req=True) + >>> thread = api.list_school_employees_with_http_info(school_id, updated_after, updated_before, per_page, page, cursor, include, employment_start_before, employment_start_after, has_role, has_contract, has_class, has_group, user_defined_field, only_user_defined_fields, only_mis_ids, async_req=True) >>> result = thread.get() :param school_id: The ID of the school (required) @@ -377,6 +390,10 @@ def list_school_employees_with_http_info( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include :type include: str :param employment_start_before: Get employees who have started before a date @@ -429,6 +446,8 @@ def list_school_employees_with_http_info( 'updated_after', 'updated_before', 'per_page', + 'page', + 'cursor', 'include', 'employment_start_before', 'employment_start_after', @@ -472,7 +491,7 @@ def list_school_employees_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -485,7 +504,7 @@ def list_school_employees_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -500,11 +519,17 @@ def list_school_employees_with_http_info( if _params.get('per_page') is not None: _query_params.append(('per_page', _params['per_page'])) + if _params.get('page') is not None: + _query_params.append(('page', _params['page'])) + + if _params.get('cursor') is not None: + _query_params.append(('cursor', _params['cursor'])) + if _params.get('include') is not None: _query_params.append(('include', _params['include'])) if _params.get('employment_start_before') is not None: - if isinstance(_params['employment_start_before'], datetime): + if isinstance(_params['employment_start_before'], date): _query_params.append( ( 'employment_start_before', @@ -519,7 +544,7 @@ def list_school_employees_with_http_info( ) if _params.get('employment_start_after') is not None: - if isinstance(_params['employment_start_after'], datetime): + if isinstance(_params['employment_start_after'], date): _query_params.append( ( 'employment_start_after', diff --git a/wonde/api/lessons_api.py b/wonde/api/lessons_api.py index 8235b20..0baa7de 100644 --- a/wonde/api/lessons_api.py +++ b/wonde/api/lessons_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -11,10 +11,7 @@ import re # noqa: F401 -from datetime import ( - date, - datetime, -) +from datetime import date from typing import Optional from pydantic import Field, StrictInt, StrictStr, validate_arguments @@ -34,7 +31,7 @@ class LessonsApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -60,10 +57,10 @@ def get_school_lesson( :type lesson_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -71,9 +68,8 @@ def get_school_lesson( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_lesson_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_lesson_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_lesson_with_http_info(school_id, lesson_id, **kwargs) @validate_arguments @@ -240,10 +236,10 @@ def list_school_lessons( :type include: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -251,9 +247,8 @@ def list_school_lessons( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_school_lessons_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_school_lessons_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_school_lessons_with_http_info( school_id, updated_after, @@ -379,7 +374,7 @@ def list_school_lessons_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -392,7 +387,7 @@ def list_school_lessons_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -405,7 +400,7 @@ def list_school_lessons_with_http_info( _query_params.append(('updated_before', _params['updated_before'])) if _params.get('lessons_start_after') is not None: - if isinstance(_params['lessons_start_after'], datetime): + if isinstance(_params['lessons_start_after'], date): _query_params.append( ( 'lessons_start_after', @@ -418,7 +413,7 @@ def list_school_lessons_with_http_info( _query_params.append(('lessons_start_after', _params['lessons_start_after'])) if _params.get('lessons_start_before') is not None: - if isinstance(_params['lessons_start_before'], datetime): + if isinstance(_params['lessons_start_before'], date): _query_params.append( ( 'lessons_start_before', @@ -434,7 +429,7 @@ def list_school_lessons_with_http_info( _query_params.append(('per_page', _params['per_page'])) if _params.get('include') is not None: - _query_params.append(('include', _params['include'].value)) + _query_params.append(('include', _params['include'])) # process the header parameters _header_params = dict(_params.get('_headers', {})) diff --git a/wonde/api/schools_api.py b/wonde/api/schools_api.py index f6a9f0e..2bae129 100644 --- a/wonde/api/schools_api.py +++ b/wonde/api/schools_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -11,10 +11,7 @@ import re # noqa: F401 -from datetime import ( - date, - datetime, -) +from datetime import date from typing import Optional from pydantic import Field, StrictBool, StrictInt, StrictStr, validate_arguments @@ -23,13 +20,13 @@ from wonde.api_client import ApiClient from wonde.api_response import ApiResponse from wonde.exceptions import ApiTypeError, ApiValueError # noqa: F401 +from wonde.models.get_school200_response import GetSchool200Response from wonde.models.get_school_acl200_response import GetSchoolAcl200Response from wonde.models.get_school_meta200_response import GetSchoolMeta200Response from wonde.models.get_school_permissions200_response import GetSchoolPermissions200Response from wonde.models.list_schools200_response import ListSchools200Response from wonde.models.request_school_access200_response import RequestSchoolAccess200Response from wonde.models.request_school_access_request import RequestSchoolAccessRequest -from wonde.models.school import School class SchoolsApi: @@ -39,7 +36,7 @@ class SchoolsApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -49,7 +46,7 @@ def get_school( self, school_id: Annotated[StrictStr, Field(..., description='The ID of the school to retrieve')], **kwargs - ) -> School: + ) -> GetSchool200Response: """Retrieve a specific school # noqa: E501 This method makes a synchronous HTTP request by default. To make an @@ -62,20 +59,19 @@ def get_school( :type school_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: School + :rtype: GetSchool200Response """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_with_http_info(school_id, **kwargs) @validate_arguments @@ -116,7 +112,7 @@ def get_school_with_http_info( :return: Returns the result object. If the method is called asynchronously, returns the request thread. - :rtype: tuple(School, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(GetSchool200Response, status_code(int), headers(HTTPHeaderDict)) """ _params = locals() @@ -166,7 +162,7 @@ def get_school_with_http_info( _auth_settings = ['BasicAuth', 'BearerAuth'] _response_types_map = { - '200': 'School', + '200': 'GetSchool200Response', } return self.api_client.call_api( @@ -211,10 +207,10 @@ def get_school_acl( :type with_user_type: bool :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -222,9 +218,8 @@ def get_school_acl( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_acl_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_acl_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_acl_with_http_info(school_id, with_user_type, **kwargs) @validate_arguments @@ -363,10 +358,10 @@ def get_school_meta( :type school_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -374,9 +369,8 @@ def get_school_meta( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_meta_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_meta_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_meta_with_http_info(school_id, **kwargs) @validate_arguments @@ -507,10 +501,10 @@ def get_school_permissions( :type school_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -518,9 +512,8 @@ def get_school_permissions( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_permissions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_permissions_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_permissions_with_http_info(school_id, **kwargs) @validate_arguments @@ -646,6 +639,12 @@ def list_schools( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, postcode: Annotated[ Optional[StrictStr], Field(description='Return results matching postcode search string') ] = None, @@ -667,7 +666,7 @@ def list_schools( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_schools(updated_after, updated_before, per_page, postcode, la_code, establishment_number, urn, async_req=True) + >>> thread = api.list_schools(updated_after, updated_before, per_page, page, cursor, postcode, la_code, establishment_number, urn, async_req=True) >>> result = thread.get() :param updated_after: Return rows modified after date @@ -676,6 +675,10 @@ def list_schools( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param postcode: Return results matching postcode search string :type postcode: str :param la_code: Return results with provided la_code @@ -686,10 +689,10 @@ def list_schools( :type urn: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -697,13 +700,14 @@ def list_schools( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_schools_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_schools_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_schools_with_http_info( updated_after, updated_before, per_page, + page, + cursor, postcode, la_code, establishment_number, @@ -723,6 +727,12 @@ def list_schools_with_http_info( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, postcode: Annotated[ Optional[StrictStr], Field(description='Return results matching postcode search string') ] = None, @@ -744,7 +754,7 @@ def list_schools_with_http_info( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_schools_with_http_info(updated_after, updated_before, per_page, postcode, la_code, establishment_number, urn, async_req=True) + >>> thread = api.list_schools_with_http_info(updated_after, updated_before, per_page, page, cursor, postcode, la_code, establishment_number, urn, async_req=True) >>> result = thread.get() :param updated_after: Return rows modified after date @@ -753,6 +763,10 @@ def list_schools_with_http_info( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param postcode: Return results matching postcode search string :type postcode: str :param la_code: Return results with provided la_code @@ -792,6 +806,8 @@ def list_schools_with_http_info( 'updated_after', 'updated_before', 'per_page', + 'page', + 'cursor', 'postcode', 'la_code', 'establishment_number', @@ -826,7 +842,7 @@ def list_schools_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -839,7 +855,7 @@ def list_schools_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -854,6 +870,12 @@ def list_schools_with_http_info( if _params.get('per_page') is not None: _query_params.append(('per_page', _params['per_page'])) + if _params.get('page') is not None: + _query_params.append(('page', _params['page'])) + + if _params.get('cursor') is not None: + _query_params.append(('cursor', _params['cursor'])) + if _params.get('postcode') is not None: _query_params.append(('postcode', _params['postcode'])) @@ -914,6 +936,12 @@ def list_schools_approved( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, postcode: Annotated[ Optional[StrictStr], Field(description='Return results matching postcode search string') ] = None, @@ -935,7 +963,7 @@ def list_schools_approved( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_schools_approved(updated_after, updated_before, per_page, postcode, la_code, establishment_number, urn, async_req=True) + >>> thread = api.list_schools_approved(updated_after, updated_before, per_page, page, cursor, postcode, la_code, establishment_number, urn, async_req=True) >>> result = thread.get() :param updated_after: Return rows modified after date @@ -944,6 +972,10 @@ def list_schools_approved( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param postcode: Return results matching postcode search string :type postcode: str :param la_code: Return results with provided la_code @@ -954,10 +986,10 @@ def list_schools_approved( :type urn: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -965,13 +997,14 @@ def list_schools_approved( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_schools_approved_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_schools_approved_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_schools_approved_with_http_info( updated_after, updated_before, per_page, + page, + cursor, postcode, la_code, establishment_number, @@ -991,6 +1024,12 @@ def list_schools_approved_with_http_info( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, postcode: Annotated[ Optional[StrictStr], Field(description='Return results matching postcode search string') ] = None, @@ -1012,7 +1051,7 @@ def list_schools_approved_with_http_info( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_schools_approved_with_http_info(updated_after, updated_before, per_page, postcode, la_code, establishment_number, urn, async_req=True) + >>> thread = api.list_schools_approved_with_http_info(updated_after, updated_before, per_page, page, cursor, postcode, la_code, establishment_number, urn, async_req=True) >>> result = thread.get() :param updated_after: Return rows modified after date @@ -1021,6 +1060,10 @@ def list_schools_approved_with_http_info( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param postcode: Return results matching postcode search string :type postcode: str :param la_code: Return results with provided la_code @@ -1060,6 +1103,8 @@ def list_schools_approved_with_http_info( 'updated_after', 'updated_before', 'per_page', + 'page', + 'cursor', 'postcode', 'la_code', 'establishment_number', @@ -1095,7 +1140,7 @@ def list_schools_approved_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -1108,7 +1153,7 @@ def list_schools_approved_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -1123,6 +1168,12 @@ def list_schools_approved_with_http_info( if _params.get('per_page') is not None: _query_params.append(('per_page', _params['per_page'])) + if _params.get('page') is not None: + _query_params.append(('page', _params['page'])) + + if _params.get('cursor') is not None: + _query_params.append(('cursor', _params['cursor'])) + if _params.get('postcode') is not None: _query_params.append(('postcode', _params['postcode'])) @@ -1153,7 +1204,7 @@ def list_schools_approved_with_http_info( } return self.api_client.call_api( - '/schools/approved', + '/schools', 'GET', _path_params, _query_params, @@ -1223,10 +1274,10 @@ def list_schools_audited( :type urn: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1234,9 +1285,8 @@ def list_schools_audited( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_schools_audited_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_schools_audited_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_schools_audited_with_http_info( updated_after, updated_before, @@ -1364,7 +1414,7 @@ def list_schools_audited_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -1377,7 +1427,7 @@ def list_schools_audited_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -1460,10 +1510,10 @@ def list_schools_declined( :type per_page: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1471,9 +1521,8 @@ def list_schools_declined( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_schools_declined_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_schools_declined_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_schools_declined_with_http_info(per_page, **kwargs) @validate_arguments @@ -1642,10 +1691,10 @@ def list_schools_offline( :type urn: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1653,9 +1702,8 @@ def list_schools_offline( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_schools_offline_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_schools_offline_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_schools_offline_with_http_info( updated_after, updated_before, @@ -1783,7 +1831,7 @@ def list_schools_offline_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -1796,7 +1844,7 @@ def list_schools_offline_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -1911,10 +1959,10 @@ def list_schools_pending( :type urn: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -1922,9 +1970,8 @@ def list_schools_pending( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_schools_pending_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_schools_pending_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_schools_pending_with_http_info( updated_after, updated_before, @@ -2052,7 +2099,7 @@ def list_schools_pending_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -2065,7 +2112,7 @@ def list_schools_pending_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -2148,10 +2195,10 @@ def list_schools_revoked( :type per_page: int :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2159,9 +2206,8 @@ def list_schools_revoked( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_schools_revoked_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_schools_revoked_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_schools_revoked_with_http_info(per_page, **kwargs) @validate_arguments @@ -2303,10 +2349,10 @@ def request_school_access( :type request_school_access_request: RequestSchoolAccessRequest :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2314,9 +2360,8 @@ def request_school_access( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the request_school_access_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the request_school_access_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.request_school_access_with_http_info( school_id, request_school_access_request, **kwargs ) @@ -2467,10 +2512,10 @@ def revoke_school_access( :type school_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -2478,9 +2523,8 @@ def revoke_school_access( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the revoke_school_access_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the revoke_school_access_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.revoke_school_access_with_http_info(school_id, **kwargs) @validate_arguments diff --git a/wonde/api/students_api.py b/wonde/api/students_api.py index af3cbb8..8b99fdd 100644 --- a/wonde/api/students_api.py +++ b/wonde/api/students_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -11,10 +11,7 @@ import re # noqa: F401 -from datetime import ( - date, - datetime, -) +from datetime import date from typing import Optional from pydantic import Field, StrictInt, StrictStr, validate_arguments @@ -34,7 +31,7 @@ class StudentsApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -64,10 +61,10 @@ def get_school_student( :type student_id: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -75,9 +72,8 @@ def get_school_student( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_student_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_student_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_student_with_http_info(school_id, student_id, **kwargs) @validate_arguments @@ -205,13 +201,19 @@ def list_school_students( self, school_id: Annotated[StrictStr, Field(..., description='The ID of the school.')], updated_after: Annotated[ - Optional[date], Field(description='Return rows modified after date.') + Optional[date], Field(description='Return rows modified after date') ] = None, updated_before: Annotated[ - Optional[date], Field(description='Return rows modified before date.') + Optional[date], Field(description='Return rows modified before date') ] = None, per_page: Annotated[ - Optional[StrictInt], Field(description='Amount of rows to return.') + Optional[StrictInt], Field(description='Amount of rows to return') + ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include.') @@ -240,17 +242,21 @@ def list_school_students( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_students(school_id, updated_after, updated_before, per_page, include, aspect_id, user_defined_field, only_user_defined_fields, only_upns, only_mis_ids, async_req=True) + >>> thread = api.list_school_students(school_id, updated_after, updated_before, per_page, page, cursor, include, aspect_id, user_defined_field, only_user_defined_fields, only_upns, only_mis_ids, async_req=True) >>> result = thread.get() :param school_id: The ID of the school. (required) :type school_id: str - :param updated_after: Return rows modified after date. + :param updated_after: Return rows modified after date :type updated_after: date - :param updated_before: Return rows modified before date. + :param updated_before: Return rows modified before date :type updated_before: date - :param per_page: Amount of rows to return. + :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include. :type include: str :param aspect_id: If including results, restrict to those for this aspect ID only. @@ -265,10 +271,10 @@ def list_school_students( :type only_mis_ids: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -276,14 +282,15 @@ def list_school_students( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_school_students_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_school_students_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_school_students_with_http_info( school_id, updated_after, updated_before, per_page, + page, + cursor, include, aspect_id, user_defined_field, @@ -298,13 +305,19 @@ def list_school_students_with_http_info( self, school_id: Annotated[StrictStr, Field(..., description='The ID of the school.')], updated_after: Annotated[ - Optional[date], Field(description='Return rows modified after date.') + Optional[date], Field(description='Return rows modified after date') ] = None, updated_before: Annotated[ - Optional[date], Field(description='Return rows modified before date.') + Optional[date], Field(description='Return rows modified before date') ] = None, per_page: Annotated[ - Optional[StrictInt], Field(description='Amount of rows to return.') + Optional[StrictInt], Field(description='Amount of rows to return') + ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include.') @@ -333,17 +346,21 @@ def list_school_students_with_http_info( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_students_with_http_info(school_id, updated_after, updated_before, per_page, include, aspect_id, user_defined_field, only_user_defined_fields, only_upns, only_mis_ids, async_req=True) + >>> thread = api.list_school_students_with_http_info(school_id, updated_after, updated_before, per_page, page, cursor, include, aspect_id, user_defined_field, only_user_defined_fields, only_upns, only_mis_ids, async_req=True) >>> result = thread.get() :param school_id: The ID of the school. (required) :type school_id: str - :param updated_after: Return rows modified after date. + :param updated_after: Return rows modified after date :type updated_after: date - :param updated_before: Return rows modified before date. + :param updated_before: Return rows modified before date :type updated_before: date - :param per_page: Amount of rows to return. + :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include. :type include: str :param aspect_id: If including results, restrict to those for this aspect ID only. @@ -388,6 +405,8 @@ def list_school_students_with_http_info( 'updated_after', 'updated_before', 'per_page', + 'page', + 'cursor', 'include', 'aspect_id', 'user_defined_field', @@ -427,7 +446,7 @@ def list_school_students_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -440,7 +459,7 @@ def list_school_students_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -455,8 +474,14 @@ def list_school_students_with_http_info( if _params.get('per_page') is not None: _query_params.append(('per_page', _params['per_page'])) + if _params.get('page') is not None: + _query_params.append(('page', _params['page'])) + + if _params.get('cursor') is not None: + _query_params.append(('cursor', _params['cursor'])) + if _params.get('include') is not None: - _query_params.append(('include', _params['include'].value)) + _query_params.append(('include', _params['include'])) if _params.get('aspect_id') is not None: _query_params.append(('aspect_id', _params['aspect_id'])) diff --git a/wonde/api/subjects_api.py b/wonde/api/subjects_api.py index 6bf4f2e..6e81738 100644 --- a/wonde/api/subjects_api.py +++ b/wonde/api/subjects_api.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -11,10 +11,7 @@ import re # noqa: F401 -from datetime import ( - date, - datetime, -) +from datetime import date from typing import Optional from pydantic import Field, StrictInt, StrictStr, validate_arguments @@ -34,7 +31,7 @@ class SubjectsApi: Do not edit the class manually. """ - def __init__(self, api_client=None): + def __init__(self, api_client=None) -> None: if api_client is None: api_client = ApiClient.get_default() self.api_client = api_client @@ -67,10 +64,10 @@ def get_school_subject( :type include: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -78,9 +75,8 @@ def get_school_subject( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the get_school_subject_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the get_school_subject_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.get_school_subject_with_http_info(school_id, subject_id, include, **kwargs) @validate_arguments @@ -224,6 +220,12 @@ def list_school_subjects( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include.') ] = None, @@ -240,7 +242,7 @@ def list_school_subjects( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_subjects(school_id, updated_after, updated_before, per_page, include, subject_code, subject_name, async_req=True) + >>> thread = api.list_school_subjects(school_id, updated_after, updated_before, per_page, page, cursor, include, subject_code, subject_name, async_req=True) >>> result = thread.get() :param school_id: ID of the school to retrieve subjects for (required) @@ -251,6 +253,10 @@ def list_school_subjects( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include. :type include: str :param subject_code: Return results with the provided subject code. @@ -259,10 +265,10 @@ def list_school_subjects( :type subject_name: str :param async_req: Whether to execute the request asynchronously. :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. + If one number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. :return: Returns the result object. If the method is called asynchronously, returns the request thread. @@ -270,14 +276,15 @@ def list_school_subjects( """ kwargs['_return_http_data_only'] = True if '_preload_content' in kwargs: - raise ValueError( - 'Error! Please call the list_school_subjects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' - ) + message = 'Error! Please call the list_school_subjects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data' + raise ValueError(message) return self.list_school_subjects_with_http_info( school_id, updated_after, updated_before, per_page, + page, + cursor, include, subject_code, subject_name, @@ -299,6 +306,12 @@ def list_school_subjects_with_http_info( per_page: Annotated[ Optional[StrictInt], Field(description='Amount of rows to return') ] = None, + page: Annotated[ + Optional[StrictInt], Field(description='Page offset for offset-paginated results.') + ] = None, + cursor: Annotated[ + Optional[StrictStr], Field(description='Page cursor for cursor-paginated results.') + ] = None, include: Annotated[ Optional[StrictStr], Field(description='Comma separated list of objects to include.') ] = None, @@ -315,7 +328,7 @@ def list_school_subjects_with_http_info( This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_school_subjects_with_http_info(school_id, updated_after, updated_before, per_page, include, subject_code, subject_name, async_req=True) + >>> thread = api.list_school_subjects_with_http_info(school_id, updated_after, updated_before, per_page, page, cursor, include, subject_code, subject_name, async_req=True) >>> result = thread.get() :param school_id: ID of the school to retrieve subjects for (required) @@ -326,6 +339,10 @@ def list_school_subjects_with_http_info( :type updated_before: date :param per_page: Amount of rows to return :type per_page: int + :param page: Page offset for offset-paginated results. + :type page: int + :param cursor: Page cursor for cursor-paginated results. + :type cursor: str :param include: Comma separated list of objects to include. :type include: str :param subject_code: Return results with the provided subject code. @@ -364,6 +381,8 @@ def list_school_subjects_with_http_info( 'updated_after', 'updated_before', 'per_page', + 'page', + 'cursor', 'include', 'subject_code', 'subject_name', @@ -400,7 +419,7 @@ def list_school_subjects_with_http_info( # process the query parameters _query_params = [] if _params.get('updated_after') is not None: - if isinstance(_params['updated_after'], datetime): + if isinstance(_params['updated_after'], date): _query_params.append( ( 'updated_after', @@ -413,7 +432,7 @@ def list_school_subjects_with_http_info( _query_params.append(('updated_after', _params['updated_after'])) if _params.get('updated_before') is not None: - if isinstance(_params['updated_before'], datetime): + if isinstance(_params['updated_before'], date): _query_params.append( ( 'updated_before', @@ -428,6 +447,12 @@ def list_school_subjects_with_http_info( if _params.get('per_page') is not None: _query_params.append(('per_page', _params['per_page'])) + if _params.get('page') is not None: + _query_params.append(('page', _params['page'])) + + if _params.get('cursor') is not None: + _query_params.append(('cursor', _params['cursor'])) + if _params.get('include') is not None: _query_params.append(('include', _params['include'])) diff --git a/wonde/api_client.py b/wonde/api_client.py index 4ce3816..2266925 100644 --- a/wonde/api_client.py +++ b/wonde/api_client.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -62,7 +62,7 @@ class ApiClient: def __init__( self, configuration=None, header_name=None, header_value=None, cookie=None, pool_threads=1 - ): + ) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() @@ -239,6 +239,13 @@ def __call_api( # data needs deserialization or returns HTTP data (deserialized) only if _preload_content or _return_http_data_only: response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + 'XX', None) if response_type == 'bytearray': response_data.data = response_data.data @@ -338,7 +345,7 @@ def __deserialize(self, data, klass): if data is None: return None - if type(klass) == str: + if isinstance(klass, str): if klass.startswith('List['): sub_kls = re.match(r'List\[(.*)]', klass).group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] diff --git a/wonde/api_response.py b/wonde/api_response.py index 640e2d5..c46ca80 100644 --- a/wonde/api_response.py +++ b/wonde/api_response.py @@ -17,7 +17,7 @@ class ApiResponse: data: Optional[Any] = Field(None, description='Deserialized data given the data type') raw_data: Optional[Any] = Field(None, description='Raw data (HTTP response body)') - def __init__(self, status_code=None, headers=None, data=None, raw_data=None): + def __init__(self, status_code=None, headers=None, data=None, raw_data=None) -> None: self.status_code = status_code self.headers = headers self.data = data diff --git a/wonde/configuration.py b/wonde/configuration.py index a373087..9556134 100644 --- a/wonde/configuration.py +++ b/wonde/configuration.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -54,7 +54,8 @@ class Configuration: configuration. :param server_operation_variables: Mapping from operation ID to a mapping with string values to replace variables in templated server configuration. - The validation of enums is performed for variables with defined enum values before. + The validation of enums is performed for variables with defined enum + values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. @@ -92,7 +93,7 @@ def __init__( server_operation_index=None, server_operation_variables=None, ssl_ca_cert=None, - ): + ) -> None: """Constructor""" self._base_path = 'https://api.wonde.com/v1.0' if host is None else host """Default Base url @@ -131,9 +132,6 @@ def __init__( self.access_token = access_token """Access token """ - self.access_token = None - """access token for OAuth/Bearer - """ self.logger = {} """Logging Settings """ diff --git a/wonde/exceptions.py b/wonde/exceptions.py index 0d4566b..5cce318 100644 --- a/wonde/exceptions.py +++ b/wonde/exceptions.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,7 +15,7 @@ class OpenApiException(Exception): class ApiTypeError(OpenApiException, TypeError): - def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): + def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None) -> None: """Raises an exception for TypeErrors Args: @@ -43,7 +43,7 @@ def __init__(self, msg, path_to_item=None, valid_classes=None, key_type=None): class ApiValueError(OpenApiException, ValueError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -61,7 +61,7 @@ def __init__(self, msg, path_to_item=None): class ApiAttributeError(OpenApiException, AttributeError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Raised when an attribute reference or assignment fails. @@ -80,7 +80,7 @@ def __init__(self, msg, path_to_item=None): class ApiKeyError(OpenApiException, KeyError): - def __init__(self, msg, path_to_item=None): + def __init__(self, msg, path_to_item=None) -> None: """ Args: msg (str): the exception message @@ -97,7 +97,7 @@ def __init__(self, msg, path_to_item=None): class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: if http_resp: self.status = http_resp.status self.reason = http_resp.reason @@ -121,23 +121,28 @@ def __str__(self): return error_message +class BadRequestException(ApiException): + def __init__(self, status=None, reason=None, http_resp=None) -> None: + super().__init__(status, reason, http_resp) + + class NotFoundException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super().__init__(status, reason, http_resp) class UnauthorizedException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super().__init__(status, reason, http_resp) class ForbiddenException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super().__init__(status, reason, http_resp) class ServiceException(ApiException): - def __init__(self, status=None, reason=None, http_resp=None): + def __init__(self, status=None, reason=None, http_resp=None) -> None: super().__init__(status, reason, http_resp) diff --git a/wonde/models/__init__.py b/wonde/models/__init__.py index 1a3fad2..a70e02e 100644 --- a/wonde/models/__init__.py +++ b/wonde/models/__init__.py @@ -4,7 +4,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,14 +17,15 @@ from wonde.models.acl import ACL from wonde.models.acl_ids_inner import ACLIdsInner from wonde.models.acl_ids_inner_one_of import ACLIdsInnerOneOf -from wonde.models.class_lessons import ClassLessons -from wonde.models.class_students import ClassStudents -from wonde.models.class_subject import ClassSubject -from wonde.models.class_subject_one_of import ClassSubjectOneOf from wonde.models.contact import Contact +from wonde.models.contact_details import ContactDetails +from wonde.models.contact_details_emails import ContactDetailsEmails from wonde.models.date_time_object import DateTimeObject from wonde.models.deletion import Deletion +from wonde.models.education_details import EducationDetails from wonde.models.employee import Employee +from wonde.models.employee_contact_details import EmployeeContactDetails +from wonde.models.get_school200_response import GetSchool200Response from wonde.models.get_school_acl200_response import GetSchoolAcl200Response from wonde.models.get_school_class200_response import GetSchoolClass200Response from wonde.models.get_school_meta200_response import GetSchoolMeta200Response @@ -39,7 +40,6 @@ from wonde.models.list_school_subjects200_response import ListSchoolSubjects200Response from wonde.models.list_schools200_response import ListSchools200Response from wonde.models.meta import Meta -from wonde.models.model_class import ModelClass from wonde.models.pagination import Pagination from wonde.models.permission import Permission from wonde.models.request_school_access200_response import RequestSchoolAccess200Response @@ -47,9 +47,16 @@ from wonde.models.school import School from wonde.models.school_address import SchoolAddress from wonde.models.school_address_address_country import SchoolAddressAddressCountry +from wonde.models.school_class import SchoolClass +from wonde.models.school_class_employees import SchoolClassEmployees +from wonde.models.school_class_lessons import SchoolClassLessons +from wonde.models.school_class_students import SchoolClassStudents +from wonde.models.school_class_subject import SchoolClassSubject +from wonde.models.school_class_subject_one_of import SchoolClassSubjectOneOf from wonde.models.school_extended import SchoolExtended from wonde.models.school_meta import SchoolMeta from wonde.models.school_region import SchoolRegion from wonde.models.school_region_identifiers import SchoolRegionIdentifiers from wonde.models.student import Student +from wonde.models.student_education_details import StudentEducationDetails from wonde.models.subject import Subject diff --git a/wonde/models/acl.py b/wonde/models/acl.py index 49dcaad..d4bdf85 100644 --- a/wonde/models/acl.py +++ b/wonde/models/acl.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/acl_ids_inner.py b/wonde/models/acl_ids_inner.py index 01a9b76..4c8fc5a 100644 --- a/wonde/models/acl_ids_inner.py +++ b/wonde/models/acl_ids_inner.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,7 +15,7 @@ import json import pprint import re # noqa: F401 -from typing import Any, List, Optional +from typing import TYPE_CHECKING, Any, List, Optional, Union from pydantic import BaseModel, Field, StrictStr, ValidationError, validator @@ -33,13 +33,16 @@ class ACLIdsInner(BaseModel): oneof_schema_1_validator: Optional[StrictStr] = None # data type: ACLIdsInnerOneOf oneof_schema_2_validator: Optional[ACLIdsInnerOneOf] = None - actual_instance: Any + if TYPE_CHECKING: + actual_instance: Union[ACLIdsInnerOneOf, str] + else: + actual_instance: Any one_of_schemas: List[str] = Field(ACLIDSINNER_ONE_OF_SCHEMAS, const=True) class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: raise ValueError( diff --git a/wonde/models/acl_ids_inner_one_of.py b/wonde/models/acl_ids_inner_one_of.py index ed05315..b0dccaf 100644 --- a/wonde/models/acl_ids_inner_one_of.py +++ b/wonde/models/acl_ids_inner_one_of.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/contact.py b/wonde/models/contact.py index b4f1e15..7185cfc 100644 --- a/wonde/models/contact.py +++ b/wonde/models/contact.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/contact_details.py b/wonde/models/contact_details.py new file mode 100644 index 0000000..9fbdaa3 --- /dev/null +++ b/wonde/models/contact_details.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from wonde.models.contact_details_emails import ContactDetailsEmails + +class ContactDetails(BaseModel): + """ + ContactDetails + """ + emails: Optional[ContactDetailsEmails] = None + __properties = ["emails"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ContactDetails: + """Create an instance of ContactDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of emails + if self.emails: + _dict['emails'] = self.emails.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ContactDetails: + """Create an instance of ContactDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ContactDetails.parse_obj(obj) + + _obj = ContactDetails.parse_obj({ + "emails": ContactDetailsEmails.from_dict(obj.get("emails")) if obj.get("emails") is not None else None + }) + return _obj + + diff --git a/wonde/models/contact_details_emails.py b/wonde/models/contact_details_emails.py new file mode 100644 index 0000000..7ac6b32 --- /dev/null +++ b/wonde/models/contact_details_emails.py @@ -0,0 +1,71 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + +class ContactDetailsEmails(BaseModel): + """ + ContactDetailsEmails + """ + email: Optional[StrictStr] = None + __properties = ["email"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> ContactDetailsEmails: + """Create an instance of ContactDetailsEmails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> ContactDetailsEmails: + """Create an instance of ContactDetailsEmails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return ContactDetailsEmails.parse_obj(obj) + + _obj = ContactDetailsEmails.parse_obj({ + "email": obj.get("email") + }) + return _obj + + diff --git a/wonde/models/date_time_object.py b/wonde/models/date_time_object.py index 081e573..8994f7d 100644 --- a/wonde/models/date_time_object.py +++ b/wonde/models/date_time_object.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/deletion.py b/wonde/models/deletion.py index e4710a7..8bb4c8b 100644 --- a/wonde/models/deletion.py +++ b/wonde/models/deletion.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/education_details.py b/wonde/models/education_details.py new file mode 100644 index 0000000..4e40929 --- /dev/null +++ b/wonde/models/education_details.py @@ -0,0 +1,73 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, StrictStr + +class EducationDetails(BaseModel): + """ + EducationDetails + """ + current_nc_year: Optional[StrictStr] = None + local_upn: Optional[StrictStr] = None + __properties = ["current_nc_year", "local_upn"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> EducationDetails: + """Create an instance of EducationDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> EducationDetails: + """Create an instance of EducationDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return EducationDetails.parse_obj(obj) + + _obj = EducationDetails.parse_obj({ + "current_nc_year": obj.get("current_nc_year"), + "local_upn": obj.get("local_upn") + }) + return _obj + + diff --git a/wonde/models/employee.py b/wonde/models/employee.py index 08dc1c4..7fd2625 100644 --- a/wonde/models/employee.py +++ b/wonde/models/employee.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,12 +15,13 @@ import json import pprint import re # noqa: F401 -from datetime import datetime +from datetime import date from typing import Optional from pydantic import BaseModel, Field, StrictStr from wonde.models.date_time_object import DateTimeObject +from wonde.models.employee_contact_details import EmployeeContactDetails class Employee(BaseModel): @@ -44,10 +45,11 @@ class Employee(BaseModel): legal_surname: Optional[StrictStr] = Field(None, description="Employee's legal surname.") legal_forename: Optional[StrictStr] = Field(None, description="Employee's legal forename.") gender: Optional[StrictStr] = Field(None, description="Employee's gender. (male|female)") - date_of_birth: Optional[datetime] = Field(None, description="Employee's date of birth.") + date_of_birth: Optional[date] = Field(None, description="Employee's date of birth.") restored_at: Optional[DateTimeObject] = None created_at: Optional[DateTimeObject] = None updated_at: Optional[DateTimeObject] = None + contact_details: Optional[EmployeeContactDetails] = None __properties = [ 'id', 'upi', @@ -64,6 +66,7 @@ class Employee(BaseModel): 'restored_at', 'created_at', 'updated_at', + 'contact_details', ] class Config: @@ -97,6 +100,9 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of updated_at if self.updated_at: _dict['updated_at'] = self.updated_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact_details + if self.contact_details: + _dict['contact_details'] = self.contact_details.to_dict() return _dict @classmethod @@ -131,6 +137,9 @@ def from_dict(cls, obj: dict) -> Employee: 'updated_at': DateTimeObject.from_dict(obj.get('updated_at')) if obj.get('updated_at') is not None else None, + 'contact_details': EmployeeContactDetails.from_dict(obj.get('contact_details')) + if obj.get('contact_details') is not None + else None, } ) return _obj diff --git a/wonde/models/employee_contact_details.py b/wonde/models/employee_contact_details.py new file mode 100644 index 0000000..161667a --- /dev/null +++ b/wonde/models/employee_contact_details.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from wonde.models.contact_details import ContactDetails + +class EmployeeContactDetails(BaseModel): + """ + EmployeeContactDetails + """ + data: Optional[ContactDetails] = None + __properties = ["data"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> EmployeeContactDetails: + """Create an instance of EmployeeContactDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> EmployeeContactDetails: + """Create an instance of EmployeeContactDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return EmployeeContactDetails.parse_obj(obj) + + _obj = EmployeeContactDetails.parse_obj({ + "data": ContactDetails.from_dict(obj.get("data")) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/wonde/models/get_school200_response.py b/wonde/models/get_school200_response.py new file mode 100644 index 0000000..05c7abd --- /dev/null +++ b/wonde/models/get_school200_response.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from wonde.models.school import School + +class GetSchool200Response(BaseModel): + """ + GetSchool200Response + """ + data: Optional[School] = None + __properties = ["data"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> GetSchool200Response: + """Create an instance of GetSchool200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> GetSchool200Response: + """Create an instance of GetSchool200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return GetSchool200Response.parse_obj(obj) + + _obj = GetSchool200Response.parse_obj({ + "data": School.from_dict(obj.get("data")) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/wonde/models/get_school_acl200_response.py b/wonde/models/get_school_acl200_response.py index 0420acd..093461b 100644 --- a/wonde/models/get_school_acl200_response.py +++ b/wonde/models/get_school_acl200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/get_school_class200_response.py b/wonde/models/get_school_class200_response.py index c1bceb5..61f6ffe 100644 --- a/wonde/models/get_school_class200_response.py +++ b/wonde/models/get_school_class200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,7 +20,7 @@ from pydantic import BaseModel from wonde.models.meta import Meta -from wonde.models.model_class import ModelClass +from wonde.models.school_class import SchoolClass class GetSchoolClass200Response(BaseModel): @@ -28,7 +28,7 @@ class GetSchoolClass200Response(BaseModel): GetSchoolClass200Response """ - data: Optional[ModelClass] = None + data: Optional[SchoolClass] = None meta: Optional[Meta] = None __properties = ['data', 'meta'] @@ -73,7 +73,7 @@ def from_dict(cls, obj: dict) -> GetSchoolClass200Response: _obj = GetSchoolClass200Response.parse_obj( { - 'data': ModelClass.from_dict(obj.get('data')) + 'data': SchoolClass.from_dict(obj.get('data')) if obj.get('data') is not None else None, 'meta': Meta.from_dict(obj.get('meta')) if obj.get('meta') is not None else None, diff --git a/wonde/models/get_school_meta200_response.py b/wonde/models/get_school_meta200_response.py index 62e1cfe..173d672 100644 --- a/wonde/models/get_school_meta200_response.py +++ b/wonde/models/get_school_meta200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/get_school_permissions200_response.py b/wonde/models/get_school_permissions200_response.py index eeb4fca..1cd1299 100644 --- a/wonde/models/get_school_permissions200_response.py +++ b/wonde/models/get_school_permissions200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/lesson.py b/wonde/models/lesson.py index 90d38db..c0161b7 100644 --- a/wonde/models/lesson.py +++ b/wonde/models/lesson.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -24,7 +24,7 @@ class Lesson(BaseModel): """ - https://docs.wonde.com/docs/api/sync#lesson-object Related objects Name Relationship ---------------------- period one class one employee one room one + https://docs.wonde.com/docs/api/sync#lesson-object Related objects Name Relationship ---------------------- period one class one employee one room one # noqa: E501 """ id: Optional[StrictStr] = Field(None, description='The ID of the object.') diff --git a/wonde/models/list_school_classes200_response.py b/wonde/models/list_school_classes200_response.py index 6b0653a..00a06a2 100644 --- a/wonde/models/list_school_classes200_response.py +++ b/wonde/models/list_school_classes200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,7 +20,7 @@ from pydantic import BaseModel, conlist from wonde.models.meta import Meta -from wonde.models.model_class import ModelClass +from wonde.models.school_class import SchoolClass class ListSchoolClasses200Response(BaseModel): @@ -28,7 +28,7 @@ class ListSchoolClasses200Response(BaseModel): ListSchoolClasses200Response """ - data: Optional[conlist(ModelClass)] = None + data: Optional[conlist(SchoolClass)] = None meta: Optional[Meta] = None __properties = ['data', 'meta'] @@ -77,7 +77,7 @@ def from_dict(cls, obj: dict) -> ListSchoolClasses200Response: _obj = ListSchoolClasses200Response.parse_obj( { - 'data': [ModelClass.from_dict(_item) for _item in obj.get('data')] + 'data': [SchoolClass.from_dict(_item) for _item in obj.get('data')] if obj.get('data') is not None else None, 'meta': Meta.from_dict(obj.get('meta')) if obj.get('meta') is not None else None, diff --git a/wonde/models/list_school_deletions200_response.py b/wonde/models/list_school_deletions200_response.py index 0e111fb..3348266 100644 --- a/wonde/models/list_school_deletions200_response.py +++ b/wonde/models/list_school_deletions200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/list_school_employees200_response.py b/wonde/models/list_school_employees200_response.py index b7a9c42..c6e6298 100644 --- a/wonde/models/list_school_employees200_response.py +++ b/wonde/models/list_school_employees200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -20,6 +20,7 @@ from pydantic import BaseModel, conlist from wonde.models.employee import Employee +from wonde.models.meta import Meta class ListSchoolEmployees200Response(BaseModel): @@ -28,7 +29,8 @@ class ListSchoolEmployees200Response(BaseModel): """ data: Optional[conlist(Employee)] = None - __properties = ['data'] + meta: Optional[Meta] = None + __properties = ['data', 'meta'] class Config: """Pydantic configuration""" @@ -59,6 +61,9 @@ def to_dict(self): if _item: _items.append(_item.to_dict()) _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of meta + if self.meta: + _dict['meta'] = self.meta.to_dict() return _dict @classmethod @@ -74,7 +79,8 @@ def from_dict(cls, obj: dict) -> ListSchoolEmployees200Response: { 'data': [Employee.from_dict(_item) for _item in obj.get('data')] if obj.get('data') is not None - else None + else None, + 'meta': Meta.from_dict(obj.get('meta')) if obj.get('meta') is not None else None, } ) return _obj diff --git a/wonde/models/list_school_lessons200_response.py b/wonde/models/list_school_lessons200_response.py index 1b5d284..5af3ad9 100644 --- a/wonde/models/list_school_lessons200_response.py +++ b/wonde/models/list_school_lessons200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/list_school_lessons200_response_meta.py b/wonde/models/list_school_lessons200_response_meta.py index 752c2b7..61fc170 100644 --- a/wonde/models/list_school_lessons200_response_meta.py +++ b/wonde/models/list_school_lessons200_response_meta.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/list_school_students200_response.py b/wonde/models/list_school_students200_response.py index 6f89b06..11a4a16 100644 --- a/wonde/models/list_school_students200_response.py +++ b/wonde/models/list_school_students200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/list_school_subjects200_response.py b/wonde/models/list_school_subjects200_response.py index 88a8022..f5aa2db 100644 --- a/wonde/models/list_school_subjects200_response.py +++ b/wonde/models/list_school_subjects200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/list_schools200_response.py b/wonde/models/list_schools200_response.py index 5f7bef0..31b5898 100644 --- a/wonde/models/list_schools200_response.py +++ b/wonde/models/list_schools200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/meta.py b/wonde/models/meta.py index bf64d91..dd63baa 100644 --- a/wonde/models/meta.py +++ b/wonde/models/meta.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/model_class.py b/wonde/models/model_class.py deleted file mode 100644 index 08c7137..0000000 --- a/wonde/models/model_class.py +++ /dev/null @@ -1,150 +0,0 @@ -""" -Wonde API - -API Docs # noqa: E501 - -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) - -Do not edit the class manually. -""" - - -from __future__ import annotations - -import json -import pprint -import re # noqa: F401 -from typing import Optional - -from pydantic import BaseModel, Field, StrictBool, StrictStr - -from wonde.models.class_lessons import ClassLessons -from wonde.models.class_students import ClassStudents -from wonde.models.class_subject import ClassSubject -from wonde.models.date_time_object import DateTimeObject -from wonde.models.list_school_employees200_response import ListSchoolEmployees200Response - - -class ModelClass(BaseModel): - """ - https://docs.wonde.com/docs/api/sync#get-classes Related objects Name Relationship -------------------------------------------- subject one students many students.contact_details many > one students.education_details many > one students.extended_details many > one students.house many > one students.registration many > one students.year many > one students.boarding many > one students.campus many > one employees many employees.contact_details many > one employees.employment_details many > one employees.extended_details many > one lessons many lessons.room many > one lessons.period many > one - """ - - id: Optional[StrictStr] = Field(None, description='The ID of the object.') - mis_id: Optional[StrictStr] = Field(None, description='The ID in the MIS.') - name: Optional[StrictStr] = Field(None, description='Class name.') - code: Optional[StrictStr] = Field(None, description='Class code.') - description: Optional[StrictStr] = Field(None, description='Class description.') - subject: Optional[ClassSubject] = None - alternative: Optional[StrictBool] = Field( - None, description='The class is an alternative to another class.' - ) - restored_at: Optional[DateTimeObject] = None - created_at: Optional[DateTimeObject] = None - updated_at: Optional[DateTimeObject] = None - students: Optional[ClassStudents] = None - employees: Optional[ListSchoolEmployees200Response] = None - lessons: Optional[ClassLessons] = None - __properties = [ - 'id', - 'mis_id', - 'name', - 'code', - 'description', - 'subject', - 'alternative', - 'restored_at', - 'created_at', - 'updated_at', - 'students', - 'employees', - 'lessons', - ] - - class Config: - """Pydantic configuration""" - - allow_population_by_field_name = True - validate_assignment = True - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> ModelClass: - """Create an instance of ModelClass from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of subject - if self.subject: - _dict['subject'] = self.subject.to_dict() - # override the default output from pydantic by calling `to_dict()` of restored_at - if self.restored_at: - _dict['restored_at'] = self.restored_at.to_dict() - # override the default output from pydantic by calling `to_dict()` of created_at - if self.created_at: - _dict['created_at'] = self.created_at.to_dict() - # override the default output from pydantic by calling `to_dict()` of updated_at - if self.updated_at: - _dict['updated_at'] = self.updated_at.to_dict() - # override the default output from pydantic by calling `to_dict()` of students - if self.students: - _dict['students'] = self.students.to_dict() - # override the default output from pydantic by calling `to_dict()` of employees - if self.employees: - _dict['employees'] = self.employees.to_dict() - # override the default output from pydantic by calling `to_dict()` of lessons - if self.lessons: - _dict['lessons'] = self.lessons.to_dict() - return _dict - - @classmethod - def from_dict(cls, obj: dict) -> ModelClass: - """Create an instance of ModelClass from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return ModelClass.parse_obj(obj) - - _obj = ModelClass.parse_obj( - { - 'id': obj.get('id'), - 'mis_id': obj.get('mis_id'), - 'name': obj.get('name'), - 'code': obj.get('code'), - 'description': obj.get('description'), - 'subject': ClassSubject.from_dict(obj.get('subject')) - if obj.get('subject') is not None - else None, - 'alternative': obj.get('alternative'), - 'restored_at': DateTimeObject.from_dict(obj.get('restored_at')) - if obj.get('restored_at') is not None - else None, - 'created_at': DateTimeObject.from_dict(obj.get('created_at')) - if obj.get('created_at') is not None - else None, - 'updated_at': DateTimeObject.from_dict(obj.get('updated_at')) - if obj.get('updated_at') is not None - else None, - 'students': ClassStudents.from_dict(obj.get('students')) - if obj.get('students') is not None - else None, - 'employees': ListSchoolEmployees200Response.from_dict(obj.get('employees')) - if obj.get('employees') is not None - else None, - 'lessons': ClassLessons.from_dict(obj.get('lessons')) - if obj.get('lessons') is not None - else None, - } - ) - return _obj diff --git a/wonde/models/pagination.py b/wonde/models/pagination.py index 2f931e3..4ce7b3b 100644 --- a/wonde/models/pagination.py +++ b/wonde/models/pagination.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -22,7 +22,7 @@ class Pagination(BaseModel): """ - https://docs.wonde.com/docs/api/sync#pagination The pagination object is returned as part of the response body when pagination is enabled. By default, 50 objects are returned per page. If the response contains 50 objects or fewer, no pagination object will be returned. If the response contains more than 50 objects, the first 50 will be returned along with the pagination object. You can request a different pagination limit or force pagination by appending ?per_page= to the request with the number of items you would like per page. For instance, to show only two results per page, you could add ?per_page=2 to the end of your query. The maximum number of results per page is set per-endpoint. + https://docs.wonde.com/docs/api/sync#pagination The pagination object is returned as part of the response body when pagination is enabled. By default, 50 objects are returned per page. If the response contains 50 objects or fewer, no pagination object will be returned. If the response contains more than 50 objects, the first 50 will be returned along with the pagination object. You can request a different pagination limit or force pagination by appending ?per_page= to the request with the number of items you would like per page. For instance, to show only two results per page, you could add ?per_page=2 to the end of your query. The maximum number of results per page is set per-endpoint. # noqa: E501 """ next: Optional[StrictStr] = Field(None, description='The next page in the paginated response.') diff --git a/wonde/models/permission.py b/wonde/models/permission.py index 07e2464..baa5987 100644 --- a/wonde/models/permission.py +++ b/wonde/models/permission.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/request_school_access200_response.py b/wonde/models/request_school_access200_response.py index 9fbbfd0..3385a4a 100644 --- a/wonde/models/request_school_access200_response.py +++ b/wonde/models/request_school_access200_response.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/request_school_access_request.py b/wonde/models/request_school_access_request.py index 7be0704..2b4def7 100644 --- a/wonde/models/request_school_access_request.py +++ b/wonde/models/request_school_access_request.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/school.py b/wonde/models/school.py index 2187080..d4ec1c7 100644 --- a/wonde/models/school.py +++ b/wonde/models/school.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -31,10 +31,10 @@ class School(BaseModel): id: Optional[StrictStr] = None name: Optional[StrictStr] = None - establishment_number: Optional[StrictInt] = None + establishment_number: Optional[StrictStr] = None urn: Optional[StrictInt] = None phase_of_education: Optional[StrictStr] = None - la_code: Optional[StrictInt] = None + la_code: Optional[StrictStr] = None timezone: Optional[StrictStr] = None mis: Optional[StrictStr] = None address: Optional[SchoolAddress] = None diff --git a/wonde/models/school_address.py b/wonde/models/school_address.py index 3052224..a75b986 100644 --- a/wonde/models/school_address.py +++ b/wonde/models/school_address.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/school_address_address_country.py b/wonde/models/school_address_address_country.py index 7ee6d93..11ba9eb 100644 --- a/wonde/models/school_address_address_country.py +++ b/wonde/models/school_address_address_country.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/school_class.py b/wonde/models/school_class.py new file mode 100644 index 0000000..472cdf8 --- /dev/null +++ b/wonde/models/school_class.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel, Field, StrictBool, StrictStr +from wonde.models.date_time_object import DateTimeObject +from wonde.models.school_class_employees import SchoolClassEmployees +from wonde.models.school_class_lessons import SchoolClassLessons +from wonde.models.school_class_students import SchoolClassStudents +from wonde.models.school_class_subject import SchoolClassSubject + +class SchoolClass(BaseModel): + """ + https://docs.wonde.com/docs/api/sync#get-classes Related objects Name Relationship -------------------------------------------- subject one students many students.contact_details many > one students.education_details many > one students.extended_details many > one students.house many > one students.registration many > one students.year many > one students.boarding many > one students.campus many > one employees many employees.contact_details many > one employees.employment_details many > one employees.extended_details many > one lessons many lessons.room many > one lessons.period many > one # noqa: E501 + """ + id: Optional[StrictStr] = Field(None, description="The ID of the object.") + mis_id: Optional[StrictStr] = Field(None, description="The ID in the MIS.") + name: Optional[StrictStr] = Field(None, description="Class name.") + code: Optional[StrictStr] = Field(None, description="Class code.") + description: Optional[StrictStr] = Field(None, description="Class description.") + subject: Optional[SchoolClassSubject] = None + alternative: Optional[StrictBool] = Field(None, description="The class is an alternative to another class.") + restored_at: Optional[DateTimeObject] = None + created_at: Optional[DateTimeObject] = None + updated_at: Optional[DateTimeObject] = None + students: Optional[SchoolClassStudents] = None + employees: Optional[SchoolClassEmployees] = None + lessons: Optional[SchoolClassLessons] = None + __properties = ["id", "mis_id", "name", "code", "description", "subject", "alternative", "restored_at", "created_at", "updated_at", "students", "employees", "lessons"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> SchoolClass: + """Create an instance of SchoolClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of subject + if self.subject: + _dict['subject'] = self.subject.to_dict() + # override the default output from pydantic by calling `to_dict()` of restored_at + if self.restored_at: + _dict['restored_at'] = self.restored_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of created_at + if self.created_at: + _dict['created_at'] = self.created_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of updated_at + if self.updated_at: + _dict['updated_at'] = self.updated_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of students + if self.students: + _dict['students'] = self.students.to_dict() + # override the default output from pydantic by calling `to_dict()` of employees + if self.employees: + _dict['employees'] = self.employees.to_dict() + # override the default output from pydantic by calling `to_dict()` of lessons + if self.lessons: + _dict['lessons'] = self.lessons.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> SchoolClass: + """Create an instance of SchoolClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SchoolClass.parse_obj(obj) + + _obj = SchoolClass.parse_obj({ + "id": obj.get("id"), + "mis_id": obj.get("mis_id"), + "name": obj.get("name"), + "code": obj.get("code"), + "description": obj.get("description"), + "subject": SchoolClassSubject.from_dict(obj.get("subject")) if obj.get("subject") is not None else None, + "alternative": obj.get("alternative"), + "restored_at": DateTimeObject.from_dict(obj.get("restored_at")) if obj.get("restored_at") is not None else None, + "created_at": DateTimeObject.from_dict(obj.get("created_at")) if obj.get("created_at") is not None else None, + "updated_at": DateTimeObject.from_dict(obj.get("updated_at")) if obj.get("updated_at") is not None else None, + "students": SchoolClassStudents.from_dict(obj.get("students")) if obj.get("students") is not None else None, + "employees": SchoolClassEmployees.from_dict(obj.get("employees")) if obj.get("employees") is not None else None, + "lessons": SchoolClassLessons.from_dict(obj.get("lessons")) if obj.get("lessons") is not None else None + }) + return _obj + + diff --git a/wonde/models/school_class_employees.py b/wonde/models/school_class_employees.py new file mode 100644 index 0000000..949e212 --- /dev/null +++ b/wonde/models/school_class_employees.py @@ -0,0 +1,79 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import List, Optional +from pydantic import BaseModel, conlist +from wonde.models.employee import Employee + +class SchoolClassEmployees(BaseModel): + """ + SchoolClassEmployees + """ + data: Optional[conlist(Employee)] = None + __properties = ["data"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> SchoolClassEmployees: + """Create an instance of SchoolClassEmployees from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> SchoolClassEmployees: + """Create an instance of SchoolClassEmployees from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return SchoolClassEmployees.parse_obj(obj) + + _obj = SchoolClassEmployees.parse_obj({ + "data": [Employee.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/wonde/models/class_lessons.py b/wonde/models/school_class_lessons.py similarity index 57% rename from wonde/models/class_lessons.py rename to wonde/models/school_class_lessons.py index 7df2052..aa1e62b 100644 --- a/wonde/models/class_lessons.py +++ b/wonde/models/school_class_lessons.py @@ -1,38 +1,36 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Optional +import json -from pydantic import BaseModel, conlist +from typing import List, Optional +from pydantic import BaseModel, conlist from wonde.models.lesson import Lesson - -class ClassLessons(BaseModel): +class SchoolClassLessons(BaseModel): """ - ClassLessons + SchoolClassLessons """ - data: Optional[conlist(Lesson)] = None - __properties = ['data'] + __properties = ["data"] class Config: """Pydantic configuration""" - allow_population_by_field_name = True validate_assignment = True @@ -45,13 +43,16 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ClassLessons: - """Create an instance of ClassLessons from a JSON string""" + def from_json(cls, json_str: str) -> SchoolClassLessons: + """Create an instance of SchoolClassLessons from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self): """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in data (list) _items = [] if self.data: @@ -62,19 +63,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ClassLessons: - """Create an instance of ClassLessons from a dict""" + def from_dict(cls, obj: dict) -> SchoolClassLessons: + """Create an instance of SchoolClassLessons from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ClassLessons.parse_obj(obj) - - _obj = ClassLessons.parse_obj( - { - 'data': [Lesson.from_dict(_item) for _item in obj.get('data')] - if obj.get('data') is not None - else None - } - ) + return SchoolClassLessons.parse_obj(obj) + + _obj = SchoolClassLessons.parse_obj({ + "data": [Lesson.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None + }) return _obj + + diff --git a/wonde/models/class_students.py b/wonde/models/school_class_students.py similarity index 57% rename from wonde/models/class_students.py rename to wonde/models/school_class_students.py index 723040f..897f6c7 100644 --- a/wonde/models/class_students.py +++ b/wonde/models/school_class_students.py @@ -1,38 +1,36 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Optional +import json -from pydantic import BaseModel, conlist +from typing import List, Optional +from pydantic import BaseModel, conlist from wonde.models.student import Student - -class ClassStudents(BaseModel): +class SchoolClassStudents(BaseModel): """ - ClassStudents + SchoolClassStudents """ - data: Optional[conlist(Student)] = None - __properties = ['data'] + __properties = ["data"] class Config: """Pydantic configuration""" - allow_population_by_field_name = True validate_assignment = True @@ -45,13 +43,16 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ClassStudents: - """Create an instance of ClassStudents from a JSON string""" + def from_json(cls, json_str: str) -> SchoolClassStudents: + """Create an instance of SchoolClassStudents from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self): """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) # override the default output from pydantic by calling `to_dict()` of each item in data (list) _items = [] if self.data: @@ -62,19 +63,17 @@ def to_dict(self): return _dict @classmethod - def from_dict(cls, obj: dict) -> ClassStudents: - """Create an instance of ClassStudents from a dict""" + def from_dict(cls, obj: dict) -> SchoolClassStudents: + """Create an instance of SchoolClassStudents from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ClassStudents.parse_obj(obj) - - _obj = ClassStudents.parse_obj( - { - 'data': [Student.from_dict(_item) for _item in obj.get('data')] - if obj.get('data') is not None - else None - } - ) + return SchoolClassStudents.parse_obj(obj) + + _obj = SchoolClassStudents.parse_obj({ + "data": [Student.from_dict(_item) for _item in obj.get("data")] if obj.get("data") is not None else None + }) return _obj + + diff --git a/wonde/models/class_subject.py b/wonde/models/school_class_subject.py similarity index 51% rename from wonde/models/class_subject.py rename to wonde/models/school_class_subject.py index 57c1dcb..32a6f9d 100644 --- a/wonde/models/class_subject.py +++ b/wonde/models/school_class_subject.py @@ -1,61 +1,61 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 from __future__ import annotations - +from inspect import getfullargspec import json import pprint import re # noqa: F401 -from typing import Any, List, Optional +from typing import Any, List, Optional from pydantic import BaseModel, Field, StrictStr, ValidationError, validator +from wonde.models.school_class_subject_one_of import SchoolClassSubjectOneOf +from typing import Union, Any, List, TYPE_CHECKING +from pydantic import StrictStr, Field -from wonde.models.class_subject_one_of import ClassSubjectOneOf +SCHOOLCLASSSUBJECT_ONE_OF_SCHEMAS = ["SchoolClassSubjectOneOf", "str"] -CLASSSUBJECT_ONE_OF_SCHEMAS = ['ClassSubjectOneOf', 'str'] - - -class ClassSubject(BaseModel): +class SchoolClassSubject(BaseModel): """ The subject for the class. `include` to get object """ - # data type: str oneof_schema_1_validator: Optional[StrictStr] = None - # data type: ClassSubjectOneOf - oneof_schema_2_validator: Optional[ClassSubjectOneOf] = None - actual_instance: Any - one_of_schemas: List[str] = Field(CLASSSUBJECT_ONE_OF_SCHEMAS, const=True) + # data type: SchoolClassSubjectOneOf + oneof_schema_2_validator: Optional[SchoolClassSubjectOneOf] = None + if TYPE_CHECKING: + actual_instance: Union[SchoolClassSubjectOneOf, str] + else: + actual_instance: Any + one_of_schemas: List[str] = Field(SCHOOLCLASSSUBJECT_ONE_OF_SCHEMAS, const=True) class Config: validate_assignment = True - def __init__(self, *args, **kwargs): + def __init__(self, *args, **kwargs) -> None: if args: if len(args) > 1: - raise ValueError( - 'If a position argument is used, only 1 is allowed to set `actual_instance`' - ) + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") if kwargs: - raise ValueError( - 'If a position argument is used, keyword arguments cannot be used.' - ) + raise ValueError("If a position argument is used, keyword arguments cannot be used.") super().__init__(actual_instance=args[0]) else: super().__init__(**kwargs) @validator('actual_instance') def actual_instance_must_validate_oneof(cls, v): - instance = ClassSubject.construct() + instance = SchoolClassSubject.construct() error_messages = [] match = 0 # validate data type: str @@ -64,34 +64,28 @@ def actual_instance_must_validate_oneof(cls, v): match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # validate data type: ClassSubjectOneOf - if not isinstance(v, ClassSubjectOneOf): - error_messages.append(f'Error! Input type `{type(v)}` is not `ClassSubjectOneOf`') + # validate data type: SchoolClassSubjectOneOf + if not isinstance(v, SchoolClassSubjectOneOf): + error_messages.append(f"Error! Input type `{type(v)}` is not `SchoolClassSubjectOneOf`") else: match += 1 if match > 1: # more than 1 match - raise ValueError( - 'Multiple matches found when setting `actual_instance` in ClassSubject with oneOf schemas: ClassSubjectOneOf, str. Details: ' - + ', '.join(error_messages) - ) + raise ValueError("Multiple matches found when setting `actual_instance` in SchoolClassSubject with oneOf schemas: SchoolClassSubjectOneOf, str. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError( - 'No match found when setting `actual_instance` in ClassSubject with oneOf schemas: ClassSubjectOneOf, str. Details: ' - + ', '.join(error_messages) - ) + raise ValueError("No match found when setting `actual_instance` in SchoolClassSubject with oneOf schemas: SchoolClassSubjectOneOf, str. Details: " + ", ".join(error_messages)) else: return v @classmethod - def from_dict(cls, obj: dict) -> ClassSubject: + def from_dict(cls, obj: dict) -> SchoolClassSubject: return cls.from_json(json.dumps(obj)) @classmethod - def from_json(cls, json_str: str) -> ClassSubject: + def from_json(cls, json_str: str) -> SchoolClassSubject: """Returns the object represented by the json string""" - instance = ClassSubject.construct() + instance = SchoolClassSubject.construct() error_messages = [] match = 0 @@ -104,34 +98,28 @@ def from_json(cls, json_str: str) -> ClassSubject: match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) - # deserialize data into ClassSubjectOneOf + # deserialize data into SchoolClassSubjectOneOf try: - instance.actual_instance = ClassSubjectOneOf.from_json(json_str) + instance.actual_instance = SchoolClassSubjectOneOf.from_json(json_str) match += 1 except (ValidationError, ValueError) as e: error_messages.append(str(e)) if match > 1: # more than 1 match - raise ValueError( - 'Multiple matches found when deserializing the JSON string into ClassSubject with oneOf schemas: ClassSubjectOneOf, str. Details: ' - + ', '.join(error_messages) - ) + raise ValueError("Multiple matches found when deserializing the JSON string into SchoolClassSubject with oneOf schemas: SchoolClassSubjectOneOf, str. Details: " + ", ".join(error_messages)) elif match == 0: # no match - raise ValueError( - 'No match found when deserializing the JSON string into ClassSubject with oneOf schemas: ClassSubjectOneOf, str. Details: ' - + ', '.join(error_messages) - ) + raise ValueError("No match found when deserializing the JSON string into SchoolClassSubject with oneOf schemas: SchoolClassSubjectOneOf, str. Details: " + ", ".join(error_messages)) else: return instance def to_json(self) -> str: """Returns the JSON representation of the actual instance""" if self.actual_instance is None: - return 'null' + return "null" - to_json = getattr(self.actual_instance, 'to_json', None) + to_json = getattr(self.actual_instance, "to_json", None) if callable(to_json): return self.actual_instance.to_json() else: @@ -142,7 +130,7 @@ def to_dict(self) -> dict: if self.actual_instance is None: return None - to_dict = getattr(self.actual_instance, 'to_dict', None) + to_dict = getattr(self.actual_instance, "to_dict", None) if callable(to_dict): return self.actual_instance.to_dict() else: @@ -152,3 +140,5 @@ def to_dict(self) -> dict: def to_str(self) -> str: """Returns the string representation of the actual instance""" return pprint.pformat(self.dict()) + + diff --git a/wonde/models/class_subject_one_of.py b/wonde/models/school_class_subject_one_of.py similarity index 54% rename from wonde/models/class_subject_one_of.py rename to wonde/models/school_class_subject_one_of.py index 956e64e..a785bfa 100644 --- a/wonde/models/class_subject_one_of.py +++ b/wonde/models/school_class_subject_one_of.py @@ -1,38 +1,36 @@ +# coding: utf-8 + """ -Wonde API + Wonde API -API Docs # noqa: E501 + API Docs -The version of the OpenAPI document: 1.0.0 -Generated by OpenAPI Generator (https://openapi-generator.tech) + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) -Do not edit the class manually. -""" + Do not edit the class manually. +""" # noqa: E501 from __future__ import annotations - -import json import pprint import re # noqa: F401 -from typing import Optional +import json -from pydantic import BaseModel +from typing import Optional +from pydantic import BaseModel from wonde.models.subject import Subject - -class ClassSubjectOneOf(BaseModel): +class SchoolClassSubjectOneOf(BaseModel): """ - ClassSubjectOneOf + SchoolClassSubjectOneOf """ - data: Optional[Subject] = None - __properties = ['data'] + __properties = ["data"] class Config: """Pydantic configuration""" - allow_population_by_field_name = True validate_assignment = True @@ -45,28 +43,33 @@ def to_json(self) -> str: return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ClassSubjectOneOf: - """Create an instance of ClassSubjectOneOf from a JSON string""" + def from_json(cls, json_str: str) -> SchoolClassSubjectOneOf: + """Create an instance of SchoolClassSubjectOneOf from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self): """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) # override the default output from pydantic by calling `to_dict()` of data if self.data: _dict['data'] = self.data.to_dict() return _dict @classmethod - def from_dict(cls, obj: dict) -> ClassSubjectOneOf: - """Create an instance of ClassSubjectOneOf from a dict""" + def from_dict(cls, obj: dict) -> SchoolClassSubjectOneOf: + """Create an instance of SchoolClassSubjectOneOf from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ClassSubjectOneOf.parse_obj(obj) + return SchoolClassSubjectOneOf.parse_obj(obj) - _obj = ClassSubjectOneOf.parse_obj( - {'data': Subject.from_dict(obj.get('data')) if obj.get('data') is not None else None} - ) + _obj = SchoolClassSubjectOneOf.parse_obj({ + "data": Subject.from_dict(obj.get("data")) if obj.get("data") is not None else None + }) return _obj + + diff --git a/wonde/models/school_extended.py b/wonde/models/school_extended.py index c84ea17..23d0261 100644 --- a/wonde/models/school_extended.py +++ b/wonde/models/school_extended.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/school_meta.py b/wonde/models/school_meta.py index ea619e8..967c371 100644 --- a/wonde/models/school_meta.py +++ b/wonde/models/school_meta.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/school_region.py b/wonde/models/school_region.py index 9f842c2..84189c4 100644 --- a/wonde/models/school_region.py +++ b/wonde/models/school_region.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/wonde/models/school_region_identifiers.py b/wonde/models/school_region_identifiers.py index 8d76402..fcc0844 100644 --- a/wonde/models/school_region_identifiers.py +++ b/wonde/models/school_region_identifiers.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -17,7 +17,7 @@ import re # noqa: F401 from typing import Optional -from pydantic import BaseModel, StrictInt +from pydantic import BaseModel, StrictInt, StrictStr class SchoolRegionIdentifiers(BaseModel): @@ -25,8 +25,8 @@ class SchoolRegionIdentifiers(BaseModel): SchoolRegionIdentifiers """ - la_code: Optional[StrictInt] = None - establishment_number: Optional[StrictInt] = None + la_code: Optional[StrictStr] = None + establishment_number: Optional[StrictStr] = None urn: Optional[StrictInt] = None __properties = ['la_code', 'establishment_number', 'urn'] diff --git a/wonde/models/student.py b/wonde/models/student.py index 9b8fb97..5657cb2 100644 --- a/wonde/models/student.py +++ b/wonde/models/student.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,16 +15,19 @@ import json import pprint import re # noqa: F401 +from datetime import date from typing import Optional from pydantic import BaseModel, Field, StrictStr, validator from wonde.models.date_time_object import DateTimeObject +from wonde.models.employee_contact_details import EmployeeContactDetails +from wonde.models.student_education_details import StudentEducationDetails class Student(BaseModel): """ - https://docs.wonde.com/docs/api/sync#student-object You need the students read permission to view this object. Related objects Name Relationship ------------------------------------------------ classes many classes.employees many classes.subject many > one education_details one contact_details one attendance_summary one extended_details one contacts many contacts.contact_details many > one year one (nullable) year.employees one (nullable) > many house one (nullable) house.employees one (nullable) > many registration one (nullable) registration.employees one (nullable) > many boarding one (nullable) boarding.employees one (nullable) > many groups many groups.employees many > many campus one (nullable) permissions one identifiers one behaviours many behaviours.employees many > many achievements many achievements.employees many > many photo one sen_needs many siblings many medical_conditions many medical_conditions.notes many > many medical_events many medical_events.notes many > many medical_notes many doctors many in_care_date_ranges many sen_date_ranges many fsm_date_ranges many user_defined_fields many results many results.aspect many > one results.resultset many > one exclusions many child_protection_plan_date_ranges many upfsm_date_ranges many + https://docs.wonde.com/docs/api/sync#student-object You need the students read permission to view this object. Related objects Name Relationship ------------------------------------------------ classes many classes.employees many classes.subject many > one education_details one contact_details one attendance_summary one extended_details one contacts many contacts.contact_details many > one year one (nullable) year.employees one (nullable) > many house one (nullable) house.employees one (nullable) > many registration one (nullable) registration.employees one (nullable) > many boarding one (nullable) boarding.employees one (nullable) > many groups many groups.employees many > many campus one (nullable) permissions one identifiers one behaviours many behaviours.employees many > many achievements many achievements.employees many > many photo one sen_needs many siblings many medical_conditions many medical_conditions.notes many > many medical_events many medical_events.notes many > many medical_notes many doctors many in_care_date_ranges many sen_date_ranges many fsm_date_ranges many user_defined_fields many results many results.aspect many > one results.resultset many > one exclusions many child_protection_plan_date_ranges many upfsm_date_ranges many # noqa: E501 """ id: Optional[StrictStr] = Field(None, description='The ID of the object.') @@ -42,10 +45,12 @@ class Student(BaseModel): gender: Optional[StrictStr] = Field( None, description="The student`s gender. Possible values are 'MALE' or 'FEMALE'." ) - date_of_birth: Optional[DateTimeObject] = None + date_of_birth: Optional[date] = Field(None, description="Student's date of birth.") restored_at: Optional[DateTimeObject] = None created_at: Optional[DateTimeObject] = None updated_at: Optional[DateTimeObject] = None + contact_details: Optional[EmployeeContactDetails] = None + education_details: Optional[StudentEducationDetails] = None __properties = [ 'id', 'upi', @@ -61,6 +66,8 @@ class Student(BaseModel): 'restored_at', 'created_at', 'updated_at', + 'contact_details', + 'education_details', ] @validator('gender') @@ -95,9 +102,6 @@ def from_json(cls, json_str: str) -> Student: def to_dict(self): """Returns the dictionary representation of the model using alias""" _dict = self.dict(by_alias=True, exclude={}, exclude_none=True) - # override the default output from pydantic by calling `to_dict()` of date_of_birth - if self.date_of_birth: - _dict['date_of_birth'] = self.date_of_birth.to_dict() # override the default output from pydantic by calling `to_dict()` of restored_at if self.restored_at: _dict['restored_at'] = self.restored_at.to_dict() @@ -107,6 +111,12 @@ def to_dict(self): # override the default output from pydantic by calling `to_dict()` of updated_at if self.updated_at: _dict['updated_at'] = self.updated_at.to_dict() + # override the default output from pydantic by calling `to_dict()` of contact_details + if self.contact_details: + _dict['contact_details'] = self.contact_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of education_details + if self.education_details: + _dict['education_details'] = self.education_details.to_dict() # set to None if initials (nullable) is None # and __fields_set__ contains the field if self.initials is None and 'initials' in self.__fields_set__: @@ -160,9 +170,7 @@ def from_dict(cls, obj: dict) -> Student: 'legal_surname': obj.get('legal_surname'), 'legal_forename': obj.get('legal_forename'), 'gender': obj.get('gender'), - 'date_of_birth': DateTimeObject.from_dict(obj.get('date_of_birth')) - if obj.get('date_of_birth') is not None - else None, + 'date_of_birth': obj.get('date_of_birth'), 'restored_at': DateTimeObject.from_dict(obj.get('restored_at')) if obj.get('restored_at') is not None else None, @@ -172,6 +180,12 @@ def from_dict(cls, obj: dict) -> Student: 'updated_at': DateTimeObject.from_dict(obj.get('updated_at')) if obj.get('updated_at') is not None else None, + 'contact_details': EmployeeContactDetails.from_dict(obj.get('contact_details')) + if obj.get('contact_details') is not None + else None, + 'education_details': StudentEducationDetails.from_dict(obj.get('education_details')) + if obj.get('education_details') is not None + else None, } ) return _obj diff --git a/wonde/models/student_education_details.py b/wonde/models/student_education_details.py new file mode 100644 index 0000000..2fa5457 --- /dev/null +++ b/wonde/models/student_education_details.py @@ -0,0 +1,75 @@ +# coding: utf-8 + +""" + Wonde API + + API Docs + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + + +from typing import Optional +from pydantic import BaseModel +from wonde.models.education_details import EducationDetails + +class StudentEducationDetails(BaseModel): + """ + StudentEducationDetails + """ + data: Optional[EducationDetails] = None + __properties = ["data"] + + class Config: + """Pydantic configuration""" + allow_population_by_field_name = True + validate_assignment = True + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.dict(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> StudentEducationDetails: + """Create an instance of StudentEducationDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self): + """Returns the dictionary representation of the model using alias""" + _dict = self.dict(by_alias=True, + exclude={ + }, + exclude_none=True) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: dict) -> StudentEducationDetails: + """Create an instance of StudentEducationDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return StudentEducationDetails.parse_obj(obj) + + _obj = StudentEducationDetails.parse_obj({ + "data": EducationDetails.from_dict(obj.get("data")) if obj.get("data") is not None else None + }) + return _obj + + diff --git a/wonde/models/subject.py b/wonde/models/subject.py index 6c301ec..d9d15c3 100644 --- a/wonde/models/subject.py +++ b/wonde/models/subject.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -24,7 +24,7 @@ class Subject(BaseModel): """ - < https://docs.wonde.com/docs/api/sync#subject-object Related objects Name Relationship ----------------------------------------- classes many classes.lessons many > many classes.lessons.period many > many > one classes.lessons.room many > many > one + < https://docs.wonde.com/docs/api/sync#subject-object Related objects Name Relationship ----------------------------------------- classes many classes.lessons many > many classes.lessons.period many > many > one classes.lessons.room many > many > one # noqa: E501 """ id: Optional[StrictStr] = Field(None, description='The ID of the object.') diff --git a/wonde/py.typed b/wonde/py.typed new file mode 100644 index 0000000..e69de29 diff --git a/wonde/rest.py b/wonde/rest.py index a04be95..7f8b62b 100644 --- a/wonde/rest.py +++ b/wonde/rest.py @@ -1,7 +1,7 @@ """ Wonde API -API Docs # noqa: E501 +API Docs The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -21,6 +21,7 @@ from wonde.exceptions import ( ApiException, ApiValueError, + BadRequestException, ForbiddenException, NotFoundException, ServiceException, @@ -31,7 +32,7 @@ class RESTResponse(io.IOBase): - def __init__(self, resp): + def __init__(self, resp) -> None: self.urllib3_response = resp self.status = resp.status self.reason = resp.reason @@ -47,7 +48,7 @@ def getheader(self, name, default=None): class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None): + def __init__(self, configuration, pools_size=4, maxsize=None) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 @@ -233,6 +234,9 @@ def request( logger.debug('response body: %s', r.data) if not 200 <= r.status <= 299: + if r.status == 400: + raise BadRequestException(http_resp=r) + if r.status == 401: raise UnauthorizedException(http_resp=r)