From 38a7c7de1caf1245050e9cd6aec07f62d6cf520e Mon Sep 17 00:00:00 2001 From: Vincent Giersch Date: Thu, 10 Sep 2026 16:49:48 +0200 Subject: [PATCH] feat!: rebuild the client as 2.0.0 against API 2.26.0 Replaces the 1.x client, generated from Swagger Codegen against a 2020-era specification, with one regenerated from api-reference v2.26.0 through a pipeline that reproduces from this repository alone. 123 operations, the full public surface of API 2.26.0, against 119 before. `FlatClient` and `AsyncFlatClient`: the generator emits sync or async and never both, so tools/generate.sh runs it twice and merges the async client under `flat_api.aio`. Typed errors, a retry layer that understands Flat's rate limiting (HTTP 403 with the reset in `X-RateLimit-Reset`, not 429), cursor pagination that reads the undeclared `Link` header, `OAuth2Helper`, and a `py.typed` marker so a consumer's type checker stops ignoring the annotations. `SPEC_REF=v2.26.0 ./tools/generate.sh` fetches the specification by tag, runs openapi-generator pinned to an exact 7.24.0, wipes the zone `.sdkgen.yaml` declares generated, applies the post-generation patches and writes OPERATIONS.json. Two checks guard it: determinism, that the same inputs twice produce identical trees, and idempotency, that re-applying every patch changes nothing. Packaging was broken in two ways that a green build hid. `uv build` emitted `flat_api-0.0.0` and exited 0, because pyproject.toml still carried a `[tool.poetry]` table under a setuptools backend, so setuptools saw no `[project]` table and fell back to directory discovery for the name and 0.0.0 for the version; the only guard compared the tag against `cat VERSION`, which the build never read. And the dependency list omitted `httpx`, `aiohttp` and `aiohttp-retry`, all of which `flat_api/__init__` reaches through its own re-exports, so a clean install could not `import flat_api` at all. It is now a PEP 621 project with the version derived from VERSION, Apache-2.0 declared with its text, and `requires-python >=3.11` matching the tested matrix. The release-please workflows are removed. They published on every push to master with a long-lived token, taking their version from release-please's manifest rather than VERSION, which bypassed the merge gate, the tag, OIDC and provenance. Publishing is now the tag alone: tag-on-merge.yml creates it with SDK_RELEASE_TOKEN, since GitHub does not start a workflow run for an event created with the automatic GITHUB_TOKEN, and release.yml uploads to PyPI by trusted publishing with attestations. Verified: import and compileall on 3.11, 3.12 and 3.13; a clean install of the built wheel imports FlatClient, AsyncFlatClient and OAuth2Helper; the wheel carries py.typed, flat_api/aio/ and LICENSE and no tests or docs; 123 of 123 operations and 23 scopes with no internal leak; 100% documentation coverage; determinism, idempotency and zone checks pass; and all three LTI 1.3 modes deserialize to their own variant. --- .DS_Store | Bin 0 -> 8196 bytes .github/workflows/ci.yml | 36 + .github/workflows/python-push.yml | 39 - .github/workflows/python.yml | 38 - .github/workflows/release.yml | 50 + .github/workflows/tag-on-merge.yml | 38 + .gitignore | 9 + .openapi-generator/FILES | 801 +- .openapi-generator/VERSION | 2 +- .sdkgen.yaml | 36 + MIGRATION.md | 45 + OPERATIONS.json | 1218 +++ QUICKSTART.md | 64 + README.md | 400 +- VERSION | 1 + docs/AppScopes.md | 12 - docs/Assignment.md | 43 - docs/AssignmentCopyResponse.md | 43 - ...ponseCapabilitiesCanPublishInClassError.md | 31 - docs/AssignmentSubmissionPlaybackInner.md | 31 - docs/AssignmentType.md | 12 - docs/AssignmentUpdate.md | 40 - docs/ClassAssignment.md | 57 - docs/ClassAssignmentLti.md | 30 - docs/ClassAssignmentUpdate.md | 46 - docs/ClassAssignmentUpdateGoogleClassroom.md | 30 - docs/ClassAssignmentUpdateMicrosoftGraph.md | 30 - docs/CollectionPrivacy.md | 12 - docs/CollectionType.md | 12 - docs/EduResourceResource.md | 42 - docs/FlatLocales.md | 12 - docs/GroupApi.md | 239 - docs/GroupDetails.md | 36 - docs/GroupType.md | 12 - docs/LicenseSources.md | 12 - docs/LmsName.md | 12 - docs/MicrosoftGraphAssignment.md | 33 - docs/ScoreCreationBuilderData.md | 30 - docs/ScoreCreationBuilderDataScoreData.md | 34 - ...ionBuilderDataScoreDataInstrumentsInner.md | 33 - docs/ScoreLicense.md | 12 - docs/TutteoProduct.md | 12 - docs/{ => reference}/AccountApi.md | 3 +- docs/reference/AddGroupUser200Response.md | 29 + docs/reference/AddGroupUserRequest.md | 29 + docs/{ => reference}/ApiAccessToken.md | 4 +- docs/reference/AppScopes.md | 55 + docs/reference/Assignment.md | 54 + .../AssignmentCapabilities.md} | 18 +- ...nmentCapabilitiesCanPublishInClassError.md | 31 + docs/{ => reference}/AssignmentCopy.md | 4 +- docs/reference/AssignmentCopyResponse.md | 54 + docs/reference/AssignmentCopyToClass.md | 32 + .../AssignmentCopyToResourceLibrary.md | 31 + docs/reference/AssignmentGroup.md | 33 + docs/{ => reference}/AssignmentSubmission.md | 6 +- .../AssignmentSubmissionComment.md | 4 +- .../AssignmentSubmissionCommentCreation.md | 4 +- .../AssignmentSubmissionComments.md | 4 +- .../AssignmentSubmissionHistory.md | 4 +- .../AssignmentSubmissionHistoryAttachment.md | 4 +- .../AssignmentSubmissionHistoryState.md | 13 +- .../AssignmentSubmissionLti.md | 8 +- .../reference/AssignmentSubmissionPlayback.md | 31 + .../AssignmentSubmissionState.md | 11 +- .../AssignmentSubmissionStudentsMode.md | 13 + .../AssignmentSubmissionUpdate.md | 5 +- docs/reference/AssignmentType.md | 23 + docs/reference/AssignmentUpdate.md | 51 + docs/{ => reference}/ClassApi.md | 354 +- docs/reference/ClassAssignment.md | 69 + .../ClassAssignmentAllOfCanvas.md} | 16 +- docs/reference/ClassAssignmentAllOfLti.md | 30 + .../ClassAssignmentAllOfMfc.md} | 16 +- docs/reference/ClassAssignmentUpdate.md | 58 + ...assAssignmentUpdateAllOfGoogleClassroom.md | 30 + ...lassAssignmentUpdateAllOfMicrosoftGraph.md | 30 + .../ClassAttachmentCreation.md | 9 +- docs/{ => reference}/ClassCreation.md | 4 +- docs/{ => reference}/ClassDetails.md | 11 +- docs/{ => reference}/ClassDetailsCanvas.md | 4 +- docs/{ => reference}/ClassDetailsClever.md | 4 +- .../ClassDetailsGoogleClassroom.md | 4 +- .../ClassDetailsGoogleDrive.md | 4 +- docs/{ => reference}/ClassDetailsIssues.md | 4 +- .../ClassDetailsIssuesSyncInner.md | 4 +- docs/{ => reference}/ClassDetailsLti.md | 7 +- docs/{ => reference}/ClassDetailsMfc.md | 4 +- .../ClassDetailsMicrosoftGraph.md | 4 +- docs/{ => reference}/ClassGradeLevel.md | 13 +- docs/{ => reference}/ClassRoles.md | 7 +- docs/{ => reference}/ClassState.md | 11 +- docs/{ => reference}/ClassUpdate.md | 4 +- docs/{ => reference}/Collection.md | 20 +- docs/{ => reference}/CollectionApi.md | 94 +- docs/{ => reference}/CollectionApp.md | 4 +- .../{ => reference}/CollectionCapabilities.md | 4 +- docs/reference/CollectionContents.md | 30 + docs/{ => reference}/CollectionCreation.md | 8 +- .../{ => reference}/CollectionModification.md | 6 +- docs/reference/CollectionPrivacy.md | 11 + docs/reference/CollectionType.md | 23 + .../CreateLtiConfiguration200Response.md | 29 + docs/reference/CreditTransaction.md | 38 + docs/{ => reference}/EduLibrary.md | 12 +- docs/{ => reference}/EduResource.md | 10 +- .../EduResourceAssignmentCreation.md | 30 + .../EduResourceCapabilities.md | 5 +- docs/{ => reference}/EduResourceCopy.md | 4 +- docs/{ => reference}/EduResourceCreation.md | 7 +- docs/reference/EduResourceFolder.md | 32 + docs/{ => reference}/EduResourceLtiLink.md | 4 +- docs/{ => reference}/EduResourceMove.md | 4 +- docs/{ => reference}/EduResourcePrivacy.md | 9 +- docs/reference/EduResourceResource.md | 55 + docs/{ => reference}/EduResourceType.md | 7 +- docs/{ => reference}/EduResourceUpdate.md | 10 +- docs/{ => reference}/EduResourceUseInClass.md | 4 +- docs/{ => reference}/EduResourcesApi.md | 42 +- docs/{ => reference}/FlatErrorResponse.md | 5 +- .../GoogleClassroomCoursework.md | 4 +- .../GoogleClassroomSubmission.md | 4 +- docs/reference/Grade.md | 35 + docs/{ => reference}/Group.md | 6 +- docs/reference/GroupApi.md | 731 ++ docs/reference/GroupCreation.md | 32 + docs/reference/GroupDetails.md | 40 + docs/reference/GroupType.md | 19 + docs/{ => reference}/LicenseMode.md | 7 +- docs/reference/LicenseSources.md | 25 + docs/reference/LmsName.md | 25 + docs/reference/LtiConfiguration.md | 64 + docs/reference/LtiConfiguration1p1.md | 41 + .../reference/LtiConfiguration1p1AllOfTool.md | 35 + docs/reference/LtiConfiguration1p3.md | 60 + docs/reference/LtiConfiguration1p3Base.md | 43 + ...tiConfiguration1p3BaseSupportedServices.md | 32 + ...onfiguration1p3BaseSupportedServicesAgs.md | 33 + ...tion1p3BaseSupportedServicesDeepLinking.md | 31 + ...nfiguration1p3BaseSupportedServicesNrps.md | 32 + docs/reference/LtiConfiguration1p3BaseTool.md | 35 + .../LtiConfiguration1p3Deployment.md | 55 + docs/reference/LtiConfiguration1p3Dynamic.md | 55 + docs/reference/LtiConfiguration1p3Manual.md | 51 + docs/reference/LtiConfigurationBase.md | 36 + docs/reference/LtiConfigurationCreate.md | 44 + docs/reference/LtiConfigurationCreate1p1.md | 32 + .../LtiConfigurationCreate1p3Deployment.md | 34 + .../LtiConfigurationCreate1p3Dynamic.md | 32 + ...nfigurationCreate1p3DynamicPlatformInfo.md | 31 + .../LtiConfigurationCreate1p3Manual.md | 38 + docs/reference/LtiConfigurationUpdate.md | 38 + .../LtiConfigurationUpdateDeployment.md | 32 + .../LtiConfigurationUpdateStandalone.md | 37 + docs/{ => reference}/LtiCredentials.md | 5 +- .../{ => reference}/LtiCredentialsCreation.md | 4 +- docs/{ => reference}/MediaAttachment.md | 12 +- docs/{ => reference}/MediaScoreSharingMode.md | 11 +- docs/reference/MicrosoftGraphAssignment.md | 36 + .../MicrosoftGraphSubmission.md | 4 +- docs/reference/OMRApi.md | 1052 ++ docs/reference/OmrCapabilities.md | 43 + docs/reference/OmrDetailsStepData.md | 32 + docs/reference/OmrDetailsSubmission.md | 33 + docs/reference/OmrDetectedInstrument.md | 36 + docs/reference/OmrImportedMetadata.md | 33 + docs/reference/OmrInstrumentOverride.md | 34 + docs/reference/OmrJob.md | 45 + docs/reference/OmrJobCreation.md | 36 + docs/reference/OmrJobFileMetadata.md | 35 + docs/reference/OmrJobFileUpload.md | 31 + docs/reference/OmrJobFileUploadResult.md | 31 + docs/reference/OmrJobInputFile.md | 31 + docs/reference/OmrJobOutput.md | 13 + docs/reference/OmrJobProgress.md | 32 + docs/reference/OmrJobResult.md | 31 + docs/reference/OmrJobRetention.md | 31 + docs/reference/OmrJobStatus.md | 21 + docs/reference/OmrLocaleDetails.md | 31 + docs/reference/OmrPendingStep.md | 31 + docs/reference/OmrStepName.md | 11 + docs/{ => reference}/OrganizationApi.md | 346 +- .../{ => reference}/OrganizationInvitation.md | 5 +- .../OrganizationInvitationCreation.md | 4 +- docs/{ => reference}/OrganizationRoles.md | 11 +- .../OrganizationUserAccessTokenCreation.md | 4 +- docs/reference/RenameGroupRequest.md | 29 + docs/{ => reference}/ResourceCollaborator.md | 7 +- .../ResourceCollaboratorCreation.md | 4 +- docs/{ => reference}/ResourceRights.md | 6 +- docs/{ => reference}/ScoreApi.md | 212 +- docs/{ => reference}/ScoreComment.md | 18 +- docs/{ => reference}/ScoreCommentContext.md | 4 +- docs/{ => reference}/ScoreCommentCreation.md | 6 +- .../{ => reference}/ScoreCommentModeration.md | 4 +- docs/{ => reference}/ScoreCommentUpdate.md | 6 +- docs/{ => reference}/ScoreCommentsCounts.md | 7 +- docs/{ => reference}/ScoreCreation.md | 15 +- docs/reference/ScoreCreationBuilderData.md | 33 + ...coreCreationBuilderDataAllOfBuilderData.md | 30 + ...nBuilderDataAllOfBuilderDataLayoutData.md} | 16 +- ...ionBuilderDataAllOfBuilderDataScoreData.md | 34 + ...ataAllOfBuilderDataScoreDataInstruments.md | 33 + docs/reference/ScoreCreationCommon.md | 32 + docs/reference/ScoreCreationFileImport.md | 36 + .../ScoreCreationGoogleDriveImport.md | 33 + docs/{ => reference}/ScoreCreationType.md | 9 +- docs/{ => reference}/ScoreDetails.md | 19 +- docs/reference/ScoreDetailsAllOfMe.md | 31 + docs/{ => reference}/ScoreFork.md | 6 +- docs/reference/ScoreLicense.md | 25 + docs/{ => reference}/ScoreLikesCounts.md | 13 +- docs/{ => reference}/ScoreModification.md | 6 +- docs/{ => reference}/ScorePlaysCounts.md | 7 +- docs/{ => reference}/ScorePrivacy.md | 11 +- docs/{ => reference}/ScoreRevision.md | 9 +- docs/{ => reference}/ScoreRevisionCreation.md | 4 +- .../ScoreRevisionStatistics.md | 4 +- docs/{ => reference}/ScoreSource.md | 4 +- docs/reference/ScoreSummary.md | 35 + docs/{ => reference}/ScoreTrack.md | 10 +- docs/{ => reference}/ScoreTrackCreation.md | 8 +- docs/reference/ScoreTrackCreationResponse.md | 30 + docs/{ => reference}/ScoreTrackPoint.md | 6 +- docs/{ => reference}/ScoreTrackPurpose.md | 7 +- docs/{ => reference}/ScoreTrackState.md | 9 +- docs/{ => reference}/ScoreTrackType.md | 11 +- docs/{ => reference}/ScoreTrackUpdate.md | 7 +- docs/{ => reference}/ScoreViewsCounts.md | 7 +- docs/{ => reference}/Task.md | 9 +- docs/{ => reference}/TaskApi.md | 3 +- docs/{ => reference}/TaskExportOptions.md | 4 +- docs/{ => reference}/TaskProgress.md | 4 +- docs/{ => reference}/TaskResult.md | 4 +- docs/reference/TeachingTheme.md | 27 + docs/reference/TutteoProduct.md | 17 + docs/{ => reference}/UserAdminUpdate.md | 4 +- docs/{ => reference}/UserApi.md | 26 +- docs/{ => reference}/UserAzureDetails.md | 4 +- docs/reference/UserBasics.md | 38 + .../UserCommunityProfileLinks.md | 4 +- docs/{ => reference}/UserCreation.md | 6 +- docs/{ => reference}/UserDetails.md | 14 +- docs/{ => reference}/UserDetailsAdmin.md | 10 +- .../UserDetailsAdminAllOfLicense.md} | 18 +- docs/{ => reference}/UserPublic.md | 11 +- docs/{ => reference}/UserPublicSummary.md | 7 +- docs/{ => reference}/UserSigninLink.md | 5 +- .../{ => reference}/UserSigninLinkCreation.md | 4 +- flat_api/__init__.py | 640 +- flat_api/_retry.py | 67 + flat_api/aio/__init__.py | 461 + flat_api/aio/api/__init__.py | 14 + flat_api/aio/api/account_api.py | 305 + flat_api/aio/api/class_api.py | 9485 +++++++++++++++++ flat_api/aio/api/collection_api.py | 2803 +++++ flat_api/aio/api/edu_resources_api.py | 3509 ++++++ flat_api/aio/api/group_api.py | 2629 +++++ flat_api/aio/api/omr_api.py | 3646 +++++++ flat_api/aio/api/organization_api.py | 4997 +++++++++ flat_api/aio/api/score_api.py | 9310 ++++++++++++++++ flat_api/aio/api/task_api.py | 302 + flat_api/aio/api/user_api.py | 999 ++ flat_api/aio/api_client.py | 823 ++ flat_api/aio/api_response.py | 21 + flat_api/aio/configuration.py | 627 ++ flat_api/aio/exceptions.py | 219 + flat_api/aio/models/__init__.py | 214 + .../aio/models/add_group_user200_response.py | 102 + flat_api/aio/models/add_group_user_request.py | 102 + flat_api/aio/models/api_access_token.py | 114 + flat_api/aio/models/app_scopes.py | 59 + flat_api/aio/models/assignment.py | 184 + .../aio/models/assignment_capabilities.py | 114 + ...capabilities_can_publish_in_class_error.py | 104 + flat_api/aio/models/assignment_copy.py | 138 + .../aio/models/assignment_copy_response.py | 186 + .../aio/models/assignment_copy_to_class.py | 107 + .../assignment_copy_to_resource_library.py | 104 + flat_api/aio/models/assignment_group.py | 108 + flat_api/aio/models/assignment_submission.py | 181 + .../models/assignment_submission_comment.py | 115 + .../assignment_submission_comment_creation.py | 102 + .../models/assignment_submission_comments.py | 104 + .../models/assignment_submission_history.py | 142 + ...ssignment_submission_history_attachment.py | 106 + .../assignment_submission_history_state.py | 41 + .../aio/models/assignment_submission_lti.py | 111 + .../models/assignment_submission_playback.py | 104 + .../aio/models/assignment_submission_state.py | 40 + .../assignment_submission_students_mode.py | 38 + .../models/assignment_submission_update.py | 146 + flat_api/aio/models/assignment_type.py | 43 + flat_api/aio/models/assignment_update.py | 200 + flat_api/aio/models/class_assignment.py | 270 + .../models/class_assignment_all_of_canvas.py | 104 + .../aio/models/class_assignment_all_of_lti.py | 102 + .../aio/models/class_assignment_all_of_mfc.py | 104 + .../aio/models/class_assignment_update.py | 235 + ...signment_update_all_of_google_classroom.py | 107 + ...ssignment_update_all_of_microsoft_graph.py | 107 + .../aio/models/class_attachment_creation.py | 131 + flat_api/aio/models/class_creation.py | 128 + flat_api/aio/models/class_details.py | 208 + flat_api/aio/models/class_details_canvas.py | 104 + flat_api/aio/models/class_details_clever.py | 125 + .../models/class_details_google_classroom.py | 104 + .../aio/models/class_details_google_drive.py | 104 + flat_api/aio/models/class_details_issues.py | 110 + .../models/class_details_issues_sync_inner.py | 116 + flat_api/aio/models/class_details_lti.py | 108 + flat_api/aio/models/class_details_mfc.py | 104 + .../models/class_details_microsoft_graph.py | 102 + flat_api/aio/models/class_grade_level.py | 41 + flat_api/aio/models/class_roles.py | 38 + flat_api/aio/models/class_state.py | 40 + flat_api/aio/models/class_update.py | 128 + flat_api/aio/models/collection.py | 167 + flat_api/aio/models/collection_app.py | 106 + .../aio/models/collection_capabilities.py | 110 + flat_api/aio/models/collection_contents.py | 102 + flat_api/aio/models/collection_creation.py | 106 + .../aio/models/collection_modification.py | 106 + flat_api/aio/models/collection_privacy.py | 37 + flat_api/aio/models/collection_type.py | 43 + .../create_lti_configuration200_response.py | 155 + flat_api/aio/models/credit_transaction.py | 150 + flat_api/aio/models/edu_library.py | 122 + flat_api/aio/models/edu_resource.py | 143 + .../edu_resource_assignment_creation.py | 103 + .../aio/models/edu_resource_capabilities.py | 108 + flat_api/aio/models/edu_resource_copy.py | 102 + flat_api/aio/models/edu_resource_creation.py | 118 + flat_api/aio/models/edu_resource_folder.py | 107 + flat_api/aio/models/edu_resource_lti_link.py | 102 + flat_api/aio/models/edu_resource_move.py | 102 + flat_api/aio/models/edu_resource_privacy.py | 39 + flat_api/aio/models/edu_resource_resource.py | 138 + flat_api/aio/models/edu_resource_type.py | 38 + flat_api/aio/models/edu_resource_update.py | 116 + .../aio/models/edu_resource_use_in_class.py | 104 + flat_api/aio/models/flat_error_response.py | 110 + .../aio/models/google_classroom_coursework.py | 113 + .../aio/models/google_classroom_submission.py | 106 + flat_api/aio/models/grade.py | 49 + flat_api/aio/models/group.py | 116 + flat_api/aio/models/group_creation.py | 115 + flat_api/aio/models/group_details.py | 124 + flat_api/aio/models/group_type.py | 41 + flat_api/aio/models/license_mode.py | 38 + flat_api/aio/models/license_sources.py | 44 + flat_api/aio/models/lms_name.py | 44 + flat_api/aio/models/lti_configuration.py | 142 + flat_api/aio/models/lti_configuration1p1.py | 148 + .../lti_configuration1p1_all_of_tool.py | 112 + flat_api/aio/models/lti_configuration1p3.py | 152 + .../aio/models/lti_configuration1p3_base.py | 158 + ...onfiguration1p3_base_supported_services.py | 118 + ...guration1p3_base_supported_services_ags.py | 108 + ...p3_base_supported_services_deep_linking.py | 104 + ...uration1p3_base_supported_services_nrps.py | 106 + .../models/lti_configuration1p3_base_tool.py | 112 + .../models/lti_configuration1p3_deployment.py | 200 + .../models/lti_configuration1p3_dynamic.py | 205 + .../aio/models/lti_configuration1p3_manual.py | 192 + flat_api/aio/models/lti_configuration_base.py | 139 + .../aio/models/lti_configuration_create.py | 169 + .../aio/models/lti_configuration_create1p1.py | 113 + .../lti_configuration_create1p3_deployment.py | 117 + .../lti_configuration_create1p3_dynamic.py | 117 + ...uration_create1p3_dynamic_platform_info.py | 104 + .../lti_configuration_create1p3_manual.py | 125 + .../aio/models/lti_configuration_update.py | 135 + .../lti_configuration_update_deployment.py | 106 + .../lti_configuration_update_standalone.py | 116 + flat_api/aio/models/lti_credentials.py | 122 + .../aio/models/lti_credentials_creation.py | 106 + flat_api/aio/models/media_attachment.py | 156 + .../aio/models/media_score_sharing_mode.py | 40 + .../aio/models/microsoft_graph_assignment.py | 135 + .../aio/models/microsoft_graph_submission.py | 104 + flat_api/aio/models/omr_capabilities.py | 138 + flat_api/aio/models/omr_details_step_data.py | 121 + flat_api/aio/models/omr_details_submission.py | 111 + .../aio/models/omr_detected_instrument.py | 124 + flat_api/aio/models/omr_imported_metadata.py | 108 + .../aio/models/omr_instrument_override.py | 108 + flat_api/aio/models/omr_job.py | 162 + flat_api/aio/models/omr_job_creation.py | 124 + flat_api/aio/models/omr_job_file_metadata.py | 112 + flat_api/aio/models/omr_job_file_upload.py | 104 + .../aio/models/omr_job_file_upload_result.py | 104 + flat_api/aio/models/omr_job_input_file.py | 104 + flat_api/aio/models/omr_job_output.py | 38 + flat_api/aio/models/omr_job_progress.py | 106 + flat_api/aio/models/omr_job_result.py | 104 + flat_api/aio/models/omr_job_retention.py | 105 + flat_api/aio/models/omr_job_status.py | 42 + flat_api/aio/models/omr_locale_details.py | 104 + flat_api/aio/models/omr_pending_step.py | 109 + flat_api/aio/models/omr_step_name.py | 37 + .../aio/models/organization_invitation.py | 127 + .../organization_invitation_creation.py | 114 + flat_api/aio/models/organization_roles.py | 40 + ...organization_user_access_token_creation.py | 103 + flat_api/aio/models/rename_group_request.py | 102 + flat_api/aio/models/resource_collaborator.py | 145 + .../models/resource_collaborator_creation.py | 114 + flat_api/aio/models/resource_rights.py | 120 + flat_api/aio/models/score_comment.py | 148 + flat_api/aio/models/score_comment_context.py | 116 + flat_api/aio/models/score_comment_creation.py | 116 + .../aio/models/score_comment_moderation.py | 114 + flat_api/aio/models/score_comment_update.py | 113 + flat_api/aio/models/score_comments_counts.py | 110 + flat_api/aio/models/score_creation.py | 152 + .../aio/models/score_creation_builder_data.py | 115 + ...eation_builder_data_all_of_builder_data.py | 112 + ...r_data_all_of_builder_data_layout_data.py} | 40 +- ...der_data_all_of_builder_data_score_data.py | 120 + ...of_builder_data_score_data_instruments.py} | 42 +- flat_api/aio/models/score_creation_common.py | 109 + .../aio/models/score_creation_file_import.py | 127 + .../score_creation_google_drive_import.py | 115 + flat_api/aio/models/score_creation_type.py | 39 + flat_api/aio/models/score_details.py | 229 + .../aio/models/score_details_all_of_me.py | 104 + flat_api/aio/models/score_fork.py | 111 + flat_api/aio/models/score_license.py | 44 + flat_api/aio/models/score_likes_counts.py | 108 + flat_api/aio/models/score_modification.py | 178 + flat_api/aio/models/score_plays_counts.py | 108 + flat_api/aio/models/score_privacy.py | 40 + flat_api/aio/models/score_revision.py | 123 + .../aio/models/score_revision_creation.py | 118 + .../aio/models/score_revision_statistics.py | 109 + flat_api/aio/models/score_source.py | 102 + flat_api/aio/models/score_summary.py | 117 + flat_api/aio/models/score_track.py | 138 + flat_api/aio/models/score_track_creation.py | 122 + .../models/score_track_creation_response.py | 106 + flat_api/aio/models/score_track_point.py | 114 + flat_api/aio/models/score_track_purpose.py | 38 + flat_api/aio/models/score_track_state.py | 39 + flat_api/aio/models/score_track_type.py | 40 + flat_api/aio/models/score_track_update.py | 120 + flat_api/aio/models/score_views_counts.py | 108 + flat_api/aio/models/task.py | 155 + flat_api/aio/models/task_export_options.py | 102 + flat_api/aio/models/task_progress.py | 104 + flat_api/aio/models/task_result.py | 104 + flat_api/aio/models/teaching_theme.py | 45 + flat_api/aio/models/tutteo_product.py | 40 + flat_api/aio/models/user_admin_update.py | 114 + flat_api/aio/models/user_azure_details.py | 106 + flat_api/aio/models/user_basics.py | 133 + .../models/user_community_profile_links.py | 142 + flat_api/aio/models/user_creation.py | 125 + flat_api/aio/models/user_details.py | 195 + flat_api/aio/models/user_details_admin.py | 153 + .../user_details_admin_all_of_license.py | 113 + flat_api/aio/models/user_public.py | 172 + flat_api/aio/models/user_public_summary.py | 138 + flat_api/aio/models/user_signin_link.py | 107 + .../aio/models/user_signin_link_creation.py | 102 + flat_api/aio/rest.py | 264 + flat_api/api/__init__.py | 1 + flat_api/api/account_api.py | 25 +- flat_api/api/class_api.py | 2726 +++-- flat_api/api/collection_api.py | 388 +- flat_api/api/edu_resources_api.py | 313 +- flat_api/api/group_api.py | 2041 +++- flat_api/api/omr_api.py | 3646 +++++++ flat_api/api/organization_api.py | 1419 ++- flat_api/api/score_api.py | 827 +- flat_api/api/task_api.py | 25 +- flat_api/api/user_api.py | 186 +- flat_api/api_client.py | 183 +- flat_api/client.py | 78 + flat_api/configuration.py | 306 +- flat_api/errors.py | 137 + flat_api/exceptions.py | 33 +- flat_api/models/__init__.py | 97 +- flat_api/models/add_group_user200_response.py | 102 + flat_api/models/add_group_user_request.py | 102 + flat_api/models/api_access_token.py | 34 +- flat_api/models/app_scopes.py | 6 +- flat_api/models/assignment.py | 87 +- ...bilities.py => assignment_capabilities.py} | 46 +- ...capabilities_can_publish_in_class_error.py | 104 + flat_api/models/assignment_copy.py | 179 +- flat_api/models/assignment_copy_response.py | 85 +- ...capabilities_can_publish_in_class_error.py | 90 - flat_api/models/assignment_copy_to_class.py | 107 + .../assignment_copy_to_resource_library.py | 104 + flat_api/models/assignment_group.py | 108 + flat_api/models/assignment_submission.py | 52 +- .../models/assignment_submission_comment.py | 34 +- .../assignment_submission_comment_creation.py | 34 +- .../models/assignment_submission_comments.py | 34 +- .../models/assignment_submission_history.py | 34 +- ...ssignment_submission_history_attachment.py | 34 +- .../assignment_submission_history_state.py | 4 +- flat_api/models/assignment_submission_lti.py | 53 +- .../models/assignment_submission_playback.py | 104 + .../assignment_submission_playback_inner.py | 90 - .../models/assignment_submission_state.py | 4 +- .../assignment_submission_students_mode.py | 38 + .../models/assignment_submission_update.py | 52 +- flat_api/models/assignment_type.py | 5 +- flat_api/models/assignment_update.py | 81 +- flat_api/models/class_assignment.py | 126 +- .../models/class_assignment_all_of_canvas.py | 104 + .../models/class_assignment_all_of_lti.py | 102 + .../models/class_assignment_all_of_mfc.py | 104 + flat_api/models/class_assignment_canvas.py | 90 - flat_api/models/class_assignment_lti.py | 88 - flat_api/models/class_assignment_mfc.py | 90 - flat_api/models/class_assignment_update.py | 123 +- ...signment_update_all_of_google_classroom.py | 107 + ...ssignment_update_all_of_microsoft_graph.py | 107 + ...lass_assignment_update_google_classroom.py | 93 - ...class_assignment_update_microsoft_graph.py | 93 - flat_api/models/class_attachment_creation.py | 52 +- flat_api/models/class_creation.py | 34 +- flat_api/models/class_details.py | 44 +- flat_api/models/class_details_canvas.py | 34 +- flat_api/models/class_details_clever.py | 34 +- .../models/class_details_google_classroom.py | 34 +- flat_api/models/class_details_google_drive.py | 34 +- flat_api/models/class_details_issues.py | 40 +- .../models/class_details_issues_sync_inner.py | 38 +- flat_api/models/class_details_lti.py | 42 +- flat_api/models/class_details_mfc.py | 34 +- .../models/class_details_microsoft_graph.py | 34 +- flat_api/models/class_grade_level.py | 4 +- flat_api/models/class_roles.py | 4 +- flat_api/models/class_state.py | 5 +- flat_api/models/class_update.py | 34 +- flat_api/models/collection.py | 68 +- flat_api/models/collection_app.py | 34 +- flat_api/models/collection_capabilities.py | 34 +- flat_api/models/collection_contents.py | 102 + flat_api/models/collection_creation.py | 42 +- flat_api/models/collection_modification.py | 38 +- flat_api/models/collection_privacy.py | 6 +- flat_api/models/collection_type.py | 11 +- .../create_lti_configuration200_response.py | 155 + flat_api/models/credit_transaction.py | 150 + flat_api/models/edu_library.py | 54 +- flat_api/models/edu_resource.py | 52 +- .../edu_resource_assignment_creation.py | 103 + flat_api/models/edu_resource_capabilities.py | 40 +- flat_api/models/edu_resource_copy.py | 34 +- flat_api/models/edu_resource_creation.py | 48 +- flat_api/models/edu_resource_folder.py | 107 + flat_api/models/edu_resource_lti_link.py | 34 +- flat_api/models/edu_resource_move.py | 34 +- flat_api/models/edu_resource_privacy.py | 4 +- flat_api/models/edu_resource_resource.py | 219 +- flat_api/models/edu_resource_type.py | 4 +- flat_api/models/edu_resource_update.py | 52 +- flat_api/models/edu_resource_use_in_class.py | 34 +- flat_api/models/flat_error_response.py | 40 +- flat_api/models/flat_locales.py | 54 - .../models/google_classroom_coursework.py | 34 +- .../models/google_classroom_submission.py | 34 +- flat_api/models/grade.py | 49 + flat_api/models/group.py | 47 +- flat_api/models/group_creation.py | 115 + flat_api/models/group_details.py | 60 +- flat_api/models/group_type.py | 8 +- flat_api/models/license_mode.py | 4 +- flat_api/models/license_sources.py | 4 +- flat_api/models/lms_name.py | 4 +- flat_api/models/lti_configuration.py | 142 + flat_api/models/lti_configuration1p1.py | 148 + .../lti_configuration1p1_all_of_tool.py | 112 + flat_api/models/lti_configuration1p3.py | 152 + flat_api/models/lti_configuration1p3_base.py | 158 + ...onfiguration1p3_base_supported_services.py | 118 + ...guration1p3_base_supported_services_ags.py | 108 + ...p3_base_supported_services_deep_linking.py | 104 + ...uration1p3_base_supported_services_nrps.py | 106 + .../models/lti_configuration1p3_base_tool.py | 112 + .../models/lti_configuration1p3_deployment.py | 200 + .../models/lti_configuration1p3_dynamic.py | 205 + .../models/lti_configuration1p3_manual.py | 192 + flat_api/models/lti_configuration_base.py | 139 + flat_api/models/lti_configuration_create.py | 169 + .../models/lti_configuration_create1p1.py | 113 + .../lti_configuration_create1p3_deployment.py | 117 + .../lti_configuration_create1p3_dynamic.py | 117 + ...uration_create1p3_dynamic_platform_info.py | 104 + .../lti_configuration_create1p3_manual.py | 125 + flat_api/models/lti_configuration_update.py | 135 + .../lti_configuration_update_deployment.py | 106 + .../lti_configuration_update_standalone.py | 116 + flat_api/models/lti_credentials.py | 40 +- flat_api/models/lti_credentials_creation.py | 34 +- flat_api/models/media_attachment.py | 56 +- flat_api/models/media_score_sharing_mode.py | 4 +- flat_api/models/microsoft_graph_assignment.py | 75 +- flat_api/models/microsoft_graph_submission.py | 34 +- flat_api/models/omr_capabilities.py | 138 + flat_api/models/omr_details_step_data.py | 121 + flat_api/models/omr_details_submission.py | 111 + flat_api/models/omr_detected_instrument.py | 124 + flat_api/models/omr_imported_metadata.py | 108 + flat_api/models/omr_instrument_override.py | 108 + flat_api/models/omr_job.py | 162 + flat_api/models/omr_job_creation.py | 124 + flat_api/models/omr_job_file_metadata.py | 112 + flat_api/models/omr_job_file_upload.py | 104 + flat_api/models/omr_job_file_upload_result.py | 104 + flat_api/models/omr_job_input_file.py | 104 + flat_api/models/omr_job_output.py | 38 + flat_api/models/omr_job_progress.py | 106 + flat_api/models/omr_job_result.py | 104 + flat_api/models/omr_job_retention.py | 105 + flat_api/models/omr_job_status.py | 42 + flat_api/models/omr_locale_details.py | 104 + flat_api/models/omr_pending_step.py | 109 + flat_api/models/omr_step_name.py | 37 + flat_api/models/organization_invitation.py | 38 +- .../organization_invitation_creation.py | 38 +- flat_api/models/organization_roles.py | 6 +- ...organization_user_access_token_creation.py | 34 +- flat_api/models/rename_group_request.py | 102 + flat_api/models/resource_collaborator.py | 38 +- .../models/resource_collaborator_creation.py | 34 +- flat_api/models/resource_rights.py | 36 +- flat_api/models/score_comment.py | 51 +- flat_api/models/score_comment_context.py | 34 +- flat_api/models/score_comment_creation.py | 36 +- flat_api/models/score_comment_moderation.py | 34 +- flat_api/models/score_comment_update.py | 36 +- flat_api/models/score_comments_counts.py | 42 +- flat_api/models/score_creation.py | 219 +- .../models/score_creation_builder_data.py | 65 +- ...eation_builder_data_all_of_builder_data.py | 112 + ...er_data_all_of_builder_data_layout_data.py | 126 + ...der_data_all_of_builder_data_score_data.py | 120 + ..._of_builder_data_score_data_instruments.py | 110 + .../score_creation_builder_data_score_data.py | 106 - flat_api/models/score_creation_common.py | 109 + flat_api/models/score_creation_file_import.py | 127 + .../score_creation_google_drive_import.py | 115 + flat_api/models/score_creation_type.py | 5 +- flat_api/models/score_details.py | 68 +- flat_api/models/score_details_all_of_me.py | 104 + flat_api/models/score_fork.py | 38 +- flat_api/models/score_license.py | 5 +- flat_api/models/score_likes_counts.py | 54 +- flat_api/models/score_modification.py | 42 +- flat_api/models/score_plays_counts.py | 42 +- flat_api/models/score_privacy.py | 4 +- flat_api/models/score_revision.py | 44 +- flat_api/models/score_revision_creation.py | 36 +- flat_api/models/score_revision_statistics.py | 34 +- flat_api/models/score_source.py | 34 +- flat_api/models/score_summary.py | 117 + flat_api/models/score_track.py | 46 +- flat_api/models/score_track_creation.py | 48 +- .../models/score_track_creation_response.py | 106 + flat_api/models/score_track_point.py | 37 +- flat_api/models/score_track_purpose.py | 4 +- flat_api/models/score_track_state.py | 4 +- flat_api/models/score_track_type.py | 4 +- flat_api/models/score_track_update.py | 49 +- flat_api/models/score_views_counts.py | 42 +- flat_api/models/task.py | 61 +- flat_api/models/task_export_options.py | 34 +- flat_api/models/task_progress.py | 34 +- flat_api/models/task_result.py | 34 +- flat_api/models/teaching_theme.py | 45 + flat_api/models/tutteo_product.py | 6 +- flat_api/models/user_admin_update.py | 44 +- flat_api/models/user_azure_details.py | 34 +- flat_api/models/user_basics.py | 133 + .../models/user_community_profile_links.py | 34 +- flat_api/models/user_creation.py | 50 +- flat_api/models/user_details.py | 65 +- flat_api/models/user_details_admin.py | 55 +- .../user_details_admin_all_of_license.py | 113 + flat_api/models/user_details_admin_license.py | 99 - flat_api/models/user_public.py | 53 +- flat_api/models/user_public_summary.py | 43 +- flat_api/models/user_signin_link.py | 38 +- flat_api/models/user_signin_link_creation.py | 34 +- flat_api/oauth.py | 145 + flat_api/pagination.py | 73 + flat_api/rest.py | 76 +- pyproject.toml | 62 +- requirements.txt | 10 +- setup.cfg | 2 - setup.py | 60 - test-requirements.txt | 5 - test/__init__.py | 0 test/test_account_api.py | 39 - test/test_api_access_token.py | 59 - test/test_app_scopes.py | 34 - test/test_assignment.py | 88 - test/test_assignment_copy.py | 58 - test/test_assignment_copy_response.py | 89 - ...t_assignment_copy_response_capabilities.py | 62 - ...capabilities_can_publish_in_class_error.py | 55 - test/test_assignment_submission.py | 98 - test/test_assignment_submission_comment.py | 58 - ..._assignment_submission_comment_creation.py | 53 - test/test_assignment_submission_comments.py | 53 - test/test_assignment_submission_history.py | 73 - ...ssignment_submission_history_attachment.py | 54 - ...est_assignment_submission_history_state.py | 34 - test/test_assignment_submission_lti.py | 53 - ...st_assignment_submission_playback_inner.py | 55 - test/test_assignment_submission_state.py | 34 - test/test_assignment_submission_update.py | 61 - test/test_assignment_type.py | 34 - test/test_assignment_update.py | 64 - test/test_class_api.py | 242 - test/test_class_assignment.py | 112 - test/test_class_assignment_canvas.py | 53 - test/test_class_assignment_lti.py | 52 - test/test_class_assignment_mfc.py | 53 - test/test_class_assignment_update.py | 77 - ...lass_assignment_update_google_classroom.py | 52 - ...class_assignment_update_microsoft_graph.py | 54 - test/test_class_attachment_creation.py | 58 - test/test_class_creation.py | 59 - test/test_class_details.py | 103 - test/test_class_details_canvas.py | 53 - test/test_class_details_clever.py | 58 - test/test_class_details_google_classroom.py | 53 - test/test_class_details_google_drive.py | 53 - test/test_class_details_issues.py | 57 - test/test_class_details_issues_sync_inner.py | 54 - test/test_class_details_lti.py | 54 - test/test_class_details_mfc.py | 53 - test/test_class_details_microsoft_graph.py | 52 - test/test_class_grade_level.py | 34 - test/test_class_roles.py | 34 - test/test_class_state.py | 34 - test/test_class_update.py | 58 - test/test_collection.py | 146 - test/test_collection_api.py | 95 - test/test_collection_app.py | 54 - test/test_collection_capabilities.py | 61 - test/test_collection_creation.py | 55 - test/test_collection_modification.py | 53 - test/test_collection_privacy.py | 34 - test/test_collection_type.py | 34 - test/test_edu_library.py | 55 - test/test_edu_resource.py | 97 - test/test_edu_resource_capabilities.py | 54 - test/test_edu_resource_copy.py | 53 - test/test_edu_resource_creation.py | 56 - test/test_edu_resource_lti_link.py | 53 - test/test_edu_resource_move.py | 53 - test/test_edu_resource_privacy.py | 34 - test/test_edu_resource_resource.py | 88 - test/test_edu_resource_type.py | 34 - test/test_edu_resource_update.py | 53 - test/test_edu_resource_use_in_class.py | 54 - test/test_edu_resources_api.py | 116 - test/test_flat_error_response.py | 57 - test/test_flat_locales.py | 34 - test/test_google_classroom_coursework.py | 55 - test/test_google_classroom_submission.py | 57 - test/test_group.py | 58 - test/test_group_api.py | 53 - test/test_group_details.py | 58 - test/test_group_type.py | 34 - test/test_license_mode.py | 34 - test/test_license_sources.py | 34 - test/test_lms_name.py | 34 - test/test_lti_credentials.py | 60 - test/test_lti_credentials_creation.py | 55 - test/test_media_attachment.py | 74 - test/test_media_score_sharing_mode.py | 34 - test/test_microsoft_graph_assignment.py | 57 - test/test_microsoft_graph_submission.py | 55 - test/test_organization_api.py | 123 - test/test_organization_invitation.py | 66 - test/test_organization_invitation_creation.py | 53 - test/test_organization_roles.py | 34 - ...organization_user_access_token_creation.py | 57 - test/test_resource_collaborator.py | 102 - test/test_resource_collaborator_creation.py | 58 - test/test_resource_rights.py | 60 - test/test_score_api.py | 242 - test/test_score_comment.py | 71 - test/test_score_comment_context.py | 69 - test/test_score_comment_creation.py | 60 - test/test_score_comment_moderation.py | 53 - test/test_score_comment_update.py | 55 - test/test_score_comments_counts.py | 55 - test/test_score_creation.py | 83 - test/test_score_creation_builder_data.py | 88 - ...score_creation_builder_data_layout_data.py | 59 - ..._score_creation_builder_data_score_data.py | 72 - ...ilder_data_score_data_instruments_inner.py | 58 - test/test_score_creation_type.py | 34 - test/test_score_details.py | 216 - test/test_score_fork.py | 54 - test/test_score_license.py | 34 - test/test_score_likes_counts.py | 57 - test/test_score_modification.py | 65 - test/test_score_plays_counts.py | 54 - test/test_score_privacy.py | 34 - test/test_score_revision.py | 61 - test/test_score_revision_creation.py | 56 - test/test_score_revision_statistics.py | 55 - test/test_score_source.py | 52 - test/test_score_track.py | 75 - test/test_score_track_creation.py | 59 - test/test_score_track_point.py | 56 - test/test_score_track_purpose.py | 34 - test/test_score_track_state.py | 34 - test/test_score_track_type.py | 34 - test/test_score_track_update.py | 57 - test/test_score_views_counts.py | 54 - test/test_task.py | 70 - test/test_task_api.py | 39 - test/test_task_export_options.py | 54 - test/test_task_progress.py | 53 - test/test_task_result.py | 53 - test/test_tutteo_product.py | 34 - test/test_user_admin_update.py | 57 - test/test_user_api.py | 53 - test/test_user_azure_details.py | 54 - test/test_user_community_profile_links.py | 57 - test/test_user_creation.py | 60 - test/test_user_details.py | 101 - test/test_user_details_admin.py | 83 - test/test_user_details_admin_license.py | 56 - test/test_user_public.py | 90 - test/test_user_public_summary.py | 72 - test/test_user_signin_link.py | 53 - test/test_user_signin_link_creation.py | 52 - tools/emit_inventory.py | 112 + tools/generate.sh | 87 + tools/openapi-config-async.json | 9 + tools/openapi-config.json | 9 + tools/patches/10_async_merge.py | 42 + tools/patches/20_errors.py | 159 + tools/patches/30_retry.py | 77 + tools/patches/40_pagination.py | 83 + tools/patches/50_oauth.py | 155 + tools/patches/60_client.py | 88 + tools/patches/70_docs.py | 64 + tools/patches/80_user_agent.py | 56 + tools/patches/90_exports.py | 77 + tools/patches/95_py_typed.py | 24 + tools/smoke.py | 94 + tox.ini | 9 - 856 files changed, 95624 insertions(+), 15447 deletions(-) create mode 100644 .DS_Store create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/python-push.yml delete mode 100644 .github/workflows/python.yml create mode 100644 .github/workflows/release.yml create mode 100644 .github/workflows/tag-on-merge.yml create mode 100644 .sdkgen.yaml create mode 100644 MIGRATION.md create mode 100644 OPERATIONS.json create mode 100644 QUICKSTART.md create mode 100644 VERSION delete mode 100644 docs/AppScopes.md delete mode 100644 docs/Assignment.md delete mode 100644 docs/AssignmentCopyResponse.md delete mode 100644 docs/AssignmentCopyResponseCapabilitiesCanPublishInClassError.md delete mode 100644 docs/AssignmentSubmissionPlaybackInner.md delete mode 100644 docs/AssignmentType.md delete mode 100644 docs/AssignmentUpdate.md delete mode 100644 docs/ClassAssignment.md delete mode 100644 docs/ClassAssignmentLti.md delete mode 100644 docs/ClassAssignmentUpdate.md delete mode 100644 docs/ClassAssignmentUpdateGoogleClassroom.md delete mode 100644 docs/ClassAssignmentUpdateMicrosoftGraph.md delete mode 100644 docs/CollectionPrivacy.md delete mode 100644 docs/CollectionType.md delete mode 100644 docs/EduResourceResource.md delete mode 100644 docs/FlatLocales.md delete mode 100644 docs/GroupApi.md delete mode 100644 docs/GroupDetails.md delete mode 100644 docs/GroupType.md delete mode 100644 docs/LicenseSources.md delete mode 100644 docs/LmsName.md delete mode 100644 docs/MicrosoftGraphAssignment.md delete mode 100644 docs/ScoreCreationBuilderData.md delete mode 100644 docs/ScoreCreationBuilderDataScoreData.md delete mode 100644 docs/ScoreCreationBuilderDataScoreDataInstrumentsInner.md delete mode 100644 docs/ScoreLicense.md delete mode 100644 docs/TutteoProduct.md rename docs/{ => reference}/AccountApi.md (97%) create mode 100644 docs/reference/AddGroupUser200Response.md create mode 100644 docs/reference/AddGroupUserRequest.md rename docs/{ => reference}/ApiAccessToken.md (92%) create mode 100644 docs/reference/AppScopes.md create mode 100644 docs/reference/Assignment.md rename docs/{AssignmentCopyResponseCapabilities.md => reference/AssignmentCapabilities.md} (51%) create mode 100644 docs/reference/AssignmentCapabilitiesCanPublishInClassError.md rename docs/{ => reference}/AssignmentCopy.md (93%) create mode 100644 docs/reference/AssignmentCopyResponse.md create mode 100644 docs/reference/AssignmentCopyToClass.md create mode 100644 docs/reference/AssignmentCopyToResourceLibrary.md create mode 100644 docs/reference/AssignmentGroup.md rename docs/{ => reference}/AssignmentSubmission.md (91%) rename docs/{ => reference}/AssignmentSubmissionComment.md (89%) rename docs/{ => reference}/AssignmentSubmissionCommentCreation.md (83%) rename docs/{ => reference}/AssignmentSubmissionComments.md (86%) rename docs/{ => reference}/AssignmentSubmissionHistory.md (93%) rename docs/{ => reference}/AssignmentSubmissionHistoryAttachment.md (85%) rename docs/{ => reference}/AssignmentSubmissionHistoryState.md (57%) rename docs/{ => reference}/AssignmentSubmissionLti.md (66%) create mode 100644 docs/reference/AssignmentSubmissionPlayback.md rename docs/{ => reference}/AssignmentSubmissionState.md (60%) create mode 100644 docs/reference/AssignmentSubmissionStudentsMode.md rename docs/{ => reference}/AssignmentSubmissionUpdate.md (85%) create mode 100644 docs/reference/AssignmentType.md create mode 100644 docs/reference/AssignmentUpdate.md rename docs/{ => reference}/ClassApi.md (87%) create mode 100644 docs/reference/ClassAssignment.md rename docs/{ClassAssignmentCanvas.md => reference/ClassAssignmentAllOfCanvas.md} (51%) create mode 100644 docs/reference/ClassAssignmentAllOfLti.md rename docs/{ClassAssignmentMfc.md => reference/ClassAssignmentAllOfMfc.md} (53%) create mode 100644 docs/reference/ClassAssignmentUpdate.md create mode 100644 docs/reference/ClassAssignmentUpdateAllOfGoogleClassroom.md create mode 100644 docs/reference/ClassAssignmentUpdateAllOfMicrosoftGraph.md rename docs/{ => reference}/ClassAttachmentCreation.md (80%) rename docs/{ => reference}/ClassCreation.md (91%) rename docs/{ => reference}/ClassDetails.md (89%) rename docs/{ => reference}/ClassDetailsCanvas.md (88%) rename docs/{ => reference}/ClassDetailsClever.md (91%) rename docs/{ => reference}/ClassDetailsGoogleClassroom.md (86%) rename docs/{ => reference}/ClassDetailsGoogleDrive.md (88%) rename docs/{ => reference}/ClassDetailsIssues.md (88%) rename docs/{ => reference}/ClassDetailsIssuesSyncInner.md (86%) rename docs/{ => reference}/ClassDetailsLti.md (77%) rename docs/{ => reference}/ClassDetailsMfc.md (89%) rename docs/{ => reference}/ClassDetailsMicrosoftGraph.md (85%) rename docs/{ => reference}/ClassGradeLevel.md (53%) rename docs/{ => reference}/ClassRoles.md (66%) rename docs/{ => reference}/ClassState.md (58%) rename docs/{ => reference}/ClassUpdate.md (92%) rename docs/{ => reference}/Collection.md (64%) rename docs/{ => reference}/CollectionApi.md (77%) rename docs/{ => reference}/CollectionApp.md (90%) rename docs/{ => reference}/CollectionCapabilities.md (92%) create mode 100644 docs/reference/CollectionContents.md rename docs/{ => reference}/CollectionCreation.md (77%) rename docs/{ => reference}/CollectionModification.md (83%) create mode 100644 docs/reference/CollectionPrivacy.md create mode 100644 docs/reference/CollectionType.md create mode 100644 docs/reference/CreateLtiConfiguration200Response.md create mode 100644 docs/reference/CreditTransaction.md rename docs/{ => reference}/EduLibrary.md (72%) rename docs/{ => reference}/EduResource.md (69%) create mode 100644 docs/reference/EduResourceAssignmentCreation.md rename docs/{ => reference}/EduResourceCapabilities.md (78%) rename docs/{ => reference}/EduResourceCopy.md (89%) rename docs/{ => reference}/EduResourceCreation.md (68%) create mode 100644 docs/reference/EduResourceFolder.md rename docs/{ => reference}/EduResourceLtiLink.md (87%) rename docs/{ => reference}/EduResourceMove.md (89%) rename docs/{ => reference}/EduResourcePrivacy.md (63%) create mode 100644 docs/reference/EduResourceResource.md rename docs/{ => reference}/EduResourceType.md (66%) rename docs/{ => reference}/EduResourceUpdate.md (55%) rename docs/{ => reference}/EduResourceUseInClass.md (88%) rename docs/{ => reference}/EduResourcesApi.md (89%) rename docs/{ => reference}/FlatErrorResponse.md (66%) rename docs/{ => reference}/GoogleClassroomCoursework.md (88%) rename docs/{ => reference}/GoogleClassroomSubmission.md (88%) create mode 100644 docs/reference/Grade.md rename docs/{ => reference}/Group.md (75%) create mode 100644 docs/reference/GroupApi.md create mode 100644 docs/reference/GroupCreation.md create mode 100644 docs/reference/GroupDetails.md create mode 100644 docs/reference/GroupType.md rename docs/{ => reference}/LicenseMode.md (64%) create mode 100644 docs/reference/LicenseSources.md create mode 100644 docs/reference/LmsName.md create mode 100644 docs/reference/LtiConfiguration.md create mode 100644 docs/reference/LtiConfiguration1p1.md create mode 100644 docs/reference/LtiConfiguration1p1AllOfTool.md create mode 100644 docs/reference/LtiConfiguration1p3.md create mode 100644 docs/reference/LtiConfiguration1p3Base.md create mode 100644 docs/reference/LtiConfiguration1p3BaseSupportedServices.md create mode 100644 docs/reference/LtiConfiguration1p3BaseSupportedServicesAgs.md create mode 100644 docs/reference/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md create mode 100644 docs/reference/LtiConfiguration1p3BaseSupportedServicesNrps.md create mode 100644 docs/reference/LtiConfiguration1p3BaseTool.md create mode 100644 docs/reference/LtiConfiguration1p3Deployment.md create mode 100644 docs/reference/LtiConfiguration1p3Dynamic.md create mode 100644 docs/reference/LtiConfiguration1p3Manual.md create mode 100644 docs/reference/LtiConfigurationBase.md create mode 100644 docs/reference/LtiConfigurationCreate.md create mode 100644 docs/reference/LtiConfigurationCreate1p1.md create mode 100644 docs/reference/LtiConfigurationCreate1p3Deployment.md create mode 100644 docs/reference/LtiConfigurationCreate1p3Dynamic.md create mode 100644 docs/reference/LtiConfigurationCreate1p3DynamicPlatformInfo.md create mode 100644 docs/reference/LtiConfigurationCreate1p3Manual.md create mode 100644 docs/reference/LtiConfigurationUpdate.md create mode 100644 docs/reference/LtiConfigurationUpdateDeployment.md create mode 100644 docs/reference/LtiConfigurationUpdateStandalone.md rename docs/{ => reference}/LtiCredentials.md (70%) rename docs/{ => reference}/LtiCredentialsCreation.md (87%) rename docs/{ => reference}/MediaAttachment.md (81%) rename docs/{ => reference}/MediaScoreSharingMode.md (65%) create mode 100644 docs/reference/MicrosoftGraphAssignment.md rename docs/{ => reference}/MicrosoftGraphSubmission.md (86%) create mode 100644 docs/reference/OMRApi.md create mode 100644 docs/reference/OmrCapabilities.md create mode 100644 docs/reference/OmrDetailsStepData.md create mode 100644 docs/reference/OmrDetailsSubmission.md create mode 100644 docs/reference/OmrDetectedInstrument.md create mode 100644 docs/reference/OmrImportedMetadata.md create mode 100644 docs/reference/OmrInstrumentOverride.md create mode 100644 docs/reference/OmrJob.md create mode 100644 docs/reference/OmrJobCreation.md create mode 100644 docs/reference/OmrJobFileMetadata.md create mode 100644 docs/reference/OmrJobFileUpload.md create mode 100644 docs/reference/OmrJobFileUploadResult.md create mode 100644 docs/reference/OmrJobInputFile.md create mode 100644 docs/reference/OmrJobOutput.md create mode 100644 docs/reference/OmrJobProgress.md create mode 100644 docs/reference/OmrJobResult.md create mode 100644 docs/reference/OmrJobRetention.md create mode 100644 docs/reference/OmrJobStatus.md create mode 100644 docs/reference/OmrLocaleDetails.md create mode 100644 docs/reference/OmrPendingStep.md create mode 100644 docs/reference/OmrStepName.md rename docs/{ => reference}/OrganizationApi.md (73%) rename docs/{ => reference}/OrganizationInvitation.md (87%) rename docs/{ => reference}/OrganizationInvitationCreation.md (86%) rename docs/{ => reference}/OrganizationRoles.md (62%) rename docs/{ => reference}/OrganizationUserAccessTokenCreation.md (84%) create mode 100644 docs/reference/RenameGroupRequest.md rename docs/{ => reference}/ResourceCollaborator.md (87%) rename docs/{ => reference}/ResourceCollaboratorCreation.md (91%) rename docs/{ => reference}/ResourceRights.md (92%) rename docs/{ => reference}/ScoreApi.md (89%) rename docs/{ => reference}/ScoreComment.md (81%) rename docs/{ => reference}/ScoreCommentContext.md (91%) rename docs/{ => reference}/ScoreCommentCreation.md (79%) rename docs/{ => reference}/ScoreCommentModeration.md (88%) rename docs/{ => reference}/ScoreCommentUpdate.md (76%) rename docs/{ => reference}/ScoreCommentsCounts.md (75%) rename docs/{ => reference}/ScoreCreation.md (64%) create mode 100644 docs/reference/ScoreCreationBuilderData.md create mode 100644 docs/reference/ScoreCreationBuilderDataAllOfBuilderData.md rename docs/{ScoreCreationBuilderDataLayoutData.md => reference/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md} (60%) create mode 100644 docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md create mode 100644 docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md create mode 100644 docs/reference/ScoreCreationCommon.md create mode 100644 docs/reference/ScoreCreationFileImport.md create mode 100644 docs/reference/ScoreCreationGoogleDriveImport.md rename docs/{ => reference}/ScoreCreationType.md (67%) rename docs/{ => reference}/ScoreDetails.md (76%) create mode 100644 docs/reference/ScoreDetailsAllOfMe.md rename docs/{ => reference}/ScoreFork.md (76%) create mode 100644 docs/reference/ScoreLicense.md rename docs/{ => reference}/ScoreLikesCounts.md (73%) rename docs/{ => reference}/ScoreModification.md (91%) rename docs/{ => reference}/ScorePlaysCounts.md (77%) rename docs/{ => reference}/ScorePrivacy.md (89%) rename docs/{ => reference}/ScoreRevision.md (81%) rename docs/{ => reference}/ScoreRevisionCreation.md (92%) rename docs/{ => reference}/ScoreRevisionStatistics.md (89%) rename docs/{ => reference}/ScoreSource.md (90%) create mode 100644 docs/reference/ScoreSummary.md rename docs/{ => reference}/ScoreTrack.md (81%) rename docs/{ => reference}/ScoreTrackCreation.md (85%) create mode 100644 docs/reference/ScoreTrackCreationResponse.md rename docs/{ => reference}/ScoreTrackPoint.md (84%) rename docs/{ => reference}/ScoreTrackPurpose.md (66%) rename docs/{ => reference}/ScoreTrackState.md (65%) rename docs/{ => reference}/ScoreTrackType.md (60%) rename docs/{ => reference}/ScoreTrackUpdate.md (80%) rename docs/{ => reference}/ScoreViewsCounts.md (77%) rename docs/{ => reference}/Task.md (65%) rename docs/{ => reference}/TaskApi.md (98%) rename docs/{ => reference}/TaskExportOptions.md (87%) rename docs/{ => reference}/TaskProgress.md (90%) rename docs/{ => reference}/TaskResult.md (90%) create mode 100644 docs/reference/TeachingTheme.md create mode 100644 docs/reference/TutteoProduct.md rename docs/{ => reference}/UserAdminUpdate.md (91%) rename docs/{ => reference}/UserApi.md (76%) rename docs/{ => reference}/UserAzureDetails.md (89%) create mode 100644 docs/reference/UserBasics.md rename docs/{ => reference}/UserCommunityProfileLinks.md (89%) rename docs/{ => reference}/UserCreation.md (82%) rename docs/{ => reference}/UserDetails.md (70%) rename docs/{ => reference}/UserDetailsAdmin.md (76%) rename docs/{UserDetailsAdminLicense.md => reference/UserDetailsAdminAllOfLicense.md} (55%) rename docs/{ => reference}/UserPublic.md (83%) rename docs/{ => reference}/UserPublicSummary.md (88%) rename docs/{ => reference}/UserSigninLink.md (80%) rename docs/{ => reference}/UserSigninLinkCreation.md (86%) create mode 100644 flat_api/_retry.py create mode 100644 flat_api/aio/__init__.py create mode 100644 flat_api/aio/api/__init__.py create mode 100644 flat_api/aio/api/account_api.py create mode 100644 flat_api/aio/api/class_api.py create mode 100644 flat_api/aio/api/collection_api.py create mode 100644 flat_api/aio/api/edu_resources_api.py create mode 100644 flat_api/aio/api/group_api.py create mode 100644 flat_api/aio/api/omr_api.py create mode 100644 flat_api/aio/api/organization_api.py create mode 100644 flat_api/aio/api/score_api.py create mode 100644 flat_api/aio/api/task_api.py create mode 100644 flat_api/aio/api/user_api.py create mode 100644 flat_api/aio/api_client.py create mode 100644 flat_api/aio/api_response.py create mode 100644 flat_api/aio/configuration.py create mode 100644 flat_api/aio/exceptions.py create mode 100644 flat_api/aio/models/__init__.py create mode 100644 flat_api/aio/models/add_group_user200_response.py create mode 100644 flat_api/aio/models/add_group_user_request.py create mode 100644 flat_api/aio/models/api_access_token.py create mode 100644 flat_api/aio/models/app_scopes.py create mode 100644 flat_api/aio/models/assignment.py create mode 100644 flat_api/aio/models/assignment_capabilities.py create mode 100644 flat_api/aio/models/assignment_capabilities_can_publish_in_class_error.py create mode 100644 flat_api/aio/models/assignment_copy.py create mode 100644 flat_api/aio/models/assignment_copy_response.py create mode 100644 flat_api/aio/models/assignment_copy_to_class.py create mode 100644 flat_api/aio/models/assignment_copy_to_resource_library.py create mode 100644 flat_api/aio/models/assignment_group.py create mode 100644 flat_api/aio/models/assignment_submission.py create mode 100644 flat_api/aio/models/assignment_submission_comment.py create mode 100644 flat_api/aio/models/assignment_submission_comment_creation.py create mode 100644 flat_api/aio/models/assignment_submission_comments.py create mode 100644 flat_api/aio/models/assignment_submission_history.py create mode 100644 flat_api/aio/models/assignment_submission_history_attachment.py create mode 100644 flat_api/aio/models/assignment_submission_history_state.py create mode 100644 flat_api/aio/models/assignment_submission_lti.py create mode 100644 flat_api/aio/models/assignment_submission_playback.py create mode 100644 flat_api/aio/models/assignment_submission_state.py create mode 100644 flat_api/aio/models/assignment_submission_students_mode.py create mode 100644 flat_api/aio/models/assignment_submission_update.py create mode 100644 flat_api/aio/models/assignment_type.py create mode 100644 flat_api/aio/models/assignment_update.py create mode 100644 flat_api/aio/models/class_assignment.py create mode 100644 flat_api/aio/models/class_assignment_all_of_canvas.py create mode 100644 flat_api/aio/models/class_assignment_all_of_lti.py create mode 100644 flat_api/aio/models/class_assignment_all_of_mfc.py create mode 100644 flat_api/aio/models/class_assignment_update.py create mode 100644 flat_api/aio/models/class_assignment_update_all_of_google_classroom.py create mode 100644 flat_api/aio/models/class_assignment_update_all_of_microsoft_graph.py create mode 100644 flat_api/aio/models/class_attachment_creation.py create mode 100644 flat_api/aio/models/class_creation.py create mode 100644 flat_api/aio/models/class_details.py create mode 100644 flat_api/aio/models/class_details_canvas.py create mode 100644 flat_api/aio/models/class_details_clever.py create mode 100644 flat_api/aio/models/class_details_google_classroom.py create mode 100644 flat_api/aio/models/class_details_google_drive.py create mode 100644 flat_api/aio/models/class_details_issues.py create mode 100644 flat_api/aio/models/class_details_issues_sync_inner.py create mode 100644 flat_api/aio/models/class_details_lti.py create mode 100644 flat_api/aio/models/class_details_mfc.py create mode 100644 flat_api/aio/models/class_details_microsoft_graph.py create mode 100644 flat_api/aio/models/class_grade_level.py create mode 100644 flat_api/aio/models/class_roles.py create mode 100644 flat_api/aio/models/class_state.py create mode 100644 flat_api/aio/models/class_update.py create mode 100644 flat_api/aio/models/collection.py create mode 100644 flat_api/aio/models/collection_app.py create mode 100644 flat_api/aio/models/collection_capabilities.py create mode 100644 flat_api/aio/models/collection_contents.py create mode 100644 flat_api/aio/models/collection_creation.py create mode 100644 flat_api/aio/models/collection_modification.py create mode 100644 flat_api/aio/models/collection_privacy.py create mode 100644 flat_api/aio/models/collection_type.py create mode 100644 flat_api/aio/models/create_lti_configuration200_response.py create mode 100644 flat_api/aio/models/credit_transaction.py create mode 100644 flat_api/aio/models/edu_library.py create mode 100644 flat_api/aio/models/edu_resource.py create mode 100644 flat_api/aio/models/edu_resource_assignment_creation.py create mode 100644 flat_api/aio/models/edu_resource_capabilities.py create mode 100644 flat_api/aio/models/edu_resource_copy.py create mode 100644 flat_api/aio/models/edu_resource_creation.py create mode 100644 flat_api/aio/models/edu_resource_folder.py create mode 100644 flat_api/aio/models/edu_resource_lti_link.py create mode 100644 flat_api/aio/models/edu_resource_move.py create mode 100644 flat_api/aio/models/edu_resource_privacy.py create mode 100644 flat_api/aio/models/edu_resource_resource.py create mode 100644 flat_api/aio/models/edu_resource_type.py create mode 100644 flat_api/aio/models/edu_resource_update.py create mode 100644 flat_api/aio/models/edu_resource_use_in_class.py create mode 100644 flat_api/aio/models/flat_error_response.py create mode 100644 flat_api/aio/models/google_classroom_coursework.py create mode 100644 flat_api/aio/models/google_classroom_submission.py create mode 100644 flat_api/aio/models/grade.py create mode 100644 flat_api/aio/models/group.py create mode 100644 flat_api/aio/models/group_creation.py create mode 100644 flat_api/aio/models/group_details.py create mode 100644 flat_api/aio/models/group_type.py create mode 100644 flat_api/aio/models/license_mode.py create mode 100644 flat_api/aio/models/license_sources.py create mode 100644 flat_api/aio/models/lms_name.py create mode 100644 flat_api/aio/models/lti_configuration.py create mode 100644 flat_api/aio/models/lti_configuration1p1.py create mode 100644 flat_api/aio/models/lti_configuration1p1_all_of_tool.py create mode 100644 flat_api/aio/models/lti_configuration1p3.py create mode 100644 flat_api/aio/models/lti_configuration1p3_base.py create mode 100644 flat_api/aio/models/lti_configuration1p3_base_supported_services.py create mode 100644 flat_api/aio/models/lti_configuration1p3_base_supported_services_ags.py create mode 100644 flat_api/aio/models/lti_configuration1p3_base_supported_services_deep_linking.py create mode 100644 flat_api/aio/models/lti_configuration1p3_base_supported_services_nrps.py create mode 100644 flat_api/aio/models/lti_configuration1p3_base_tool.py create mode 100644 flat_api/aio/models/lti_configuration1p3_deployment.py create mode 100644 flat_api/aio/models/lti_configuration1p3_dynamic.py create mode 100644 flat_api/aio/models/lti_configuration1p3_manual.py create mode 100644 flat_api/aio/models/lti_configuration_base.py create mode 100644 flat_api/aio/models/lti_configuration_create.py create mode 100644 flat_api/aio/models/lti_configuration_create1p1.py create mode 100644 flat_api/aio/models/lti_configuration_create1p3_deployment.py create mode 100644 flat_api/aio/models/lti_configuration_create1p3_dynamic.py create mode 100644 flat_api/aio/models/lti_configuration_create1p3_dynamic_platform_info.py create mode 100644 flat_api/aio/models/lti_configuration_create1p3_manual.py create mode 100644 flat_api/aio/models/lti_configuration_update.py create mode 100644 flat_api/aio/models/lti_configuration_update_deployment.py create mode 100644 flat_api/aio/models/lti_configuration_update_standalone.py create mode 100644 flat_api/aio/models/lti_credentials.py create mode 100644 flat_api/aio/models/lti_credentials_creation.py create mode 100644 flat_api/aio/models/media_attachment.py create mode 100644 flat_api/aio/models/media_score_sharing_mode.py create mode 100644 flat_api/aio/models/microsoft_graph_assignment.py create mode 100644 flat_api/aio/models/microsoft_graph_submission.py create mode 100644 flat_api/aio/models/omr_capabilities.py create mode 100644 flat_api/aio/models/omr_details_step_data.py create mode 100644 flat_api/aio/models/omr_details_submission.py create mode 100644 flat_api/aio/models/omr_detected_instrument.py create mode 100644 flat_api/aio/models/omr_imported_metadata.py create mode 100644 flat_api/aio/models/omr_instrument_override.py create mode 100644 flat_api/aio/models/omr_job.py create mode 100644 flat_api/aio/models/omr_job_creation.py create mode 100644 flat_api/aio/models/omr_job_file_metadata.py create mode 100644 flat_api/aio/models/omr_job_file_upload.py create mode 100644 flat_api/aio/models/omr_job_file_upload_result.py create mode 100644 flat_api/aio/models/omr_job_input_file.py create mode 100644 flat_api/aio/models/omr_job_output.py create mode 100644 flat_api/aio/models/omr_job_progress.py create mode 100644 flat_api/aio/models/omr_job_result.py create mode 100644 flat_api/aio/models/omr_job_retention.py create mode 100644 flat_api/aio/models/omr_job_status.py create mode 100644 flat_api/aio/models/omr_locale_details.py create mode 100644 flat_api/aio/models/omr_pending_step.py create mode 100644 flat_api/aio/models/omr_step_name.py create mode 100644 flat_api/aio/models/organization_invitation.py create mode 100644 flat_api/aio/models/organization_invitation_creation.py create mode 100644 flat_api/aio/models/organization_roles.py create mode 100644 flat_api/aio/models/organization_user_access_token_creation.py create mode 100644 flat_api/aio/models/rename_group_request.py create mode 100644 flat_api/aio/models/resource_collaborator.py create mode 100644 flat_api/aio/models/resource_collaborator_creation.py create mode 100644 flat_api/aio/models/resource_rights.py create mode 100644 flat_api/aio/models/score_comment.py create mode 100644 flat_api/aio/models/score_comment_context.py create mode 100644 flat_api/aio/models/score_comment_creation.py create mode 100644 flat_api/aio/models/score_comment_moderation.py create mode 100644 flat_api/aio/models/score_comment_update.py create mode 100644 flat_api/aio/models/score_comments_counts.py create mode 100644 flat_api/aio/models/score_creation.py create mode 100644 flat_api/aio/models/score_creation_builder_data.py create mode 100644 flat_api/aio/models/score_creation_builder_data_all_of_builder_data.py rename flat_api/{models/score_creation_builder_data_layout_data.py => aio/models/score_creation_builder_data_all_of_builder_data_layout_data.py} (61%) create mode 100644 flat_api/aio/models/score_creation_builder_data_all_of_builder_data_score_data.py rename flat_api/{models/score_creation_builder_data_score_data_instruments_inner.py => aio/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py} (50%) create mode 100644 flat_api/aio/models/score_creation_common.py create mode 100644 flat_api/aio/models/score_creation_file_import.py create mode 100644 flat_api/aio/models/score_creation_google_drive_import.py create mode 100644 flat_api/aio/models/score_creation_type.py create mode 100644 flat_api/aio/models/score_details.py create mode 100644 flat_api/aio/models/score_details_all_of_me.py create mode 100644 flat_api/aio/models/score_fork.py create mode 100644 flat_api/aio/models/score_license.py create mode 100644 flat_api/aio/models/score_likes_counts.py create mode 100644 flat_api/aio/models/score_modification.py create mode 100644 flat_api/aio/models/score_plays_counts.py create mode 100644 flat_api/aio/models/score_privacy.py create mode 100644 flat_api/aio/models/score_revision.py create mode 100644 flat_api/aio/models/score_revision_creation.py create mode 100644 flat_api/aio/models/score_revision_statistics.py create mode 100644 flat_api/aio/models/score_source.py create mode 100644 flat_api/aio/models/score_summary.py create mode 100644 flat_api/aio/models/score_track.py create mode 100644 flat_api/aio/models/score_track_creation.py create mode 100644 flat_api/aio/models/score_track_creation_response.py create mode 100644 flat_api/aio/models/score_track_point.py create mode 100644 flat_api/aio/models/score_track_purpose.py create mode 100644 flat_api/aio/models/score_track_state.py create mode 100644 flat_api/aio/models/score_track_type.py create mode 100644 flat_api/aio/models/score_track_update.py create mode 100644 flat_api/aio/models/score_views_counts.py create mode 100644 flat_api/aio/models/task.py create mode 100644 flat_api/aio/models/task_export_options.py create mode 100644 flat_api/aio/models/task_progress.py create mode 100644 flat_api/aio/models/task_result.py create mode 100644 flat_api/aio/models/teaching_theme.py create mode 100644 flat_api/aio/models/tutteo_product.py create mode 100644 flat_api/aio/models/user_admin_update.py create mode 100644 flat_api/aio/models/user_azure_details.py create mode 100644 flat_api/aio/models/user_basics.py create mode 100644 flat_api/aio/models/user_community_profile_links.py create mode 100644 flat_api/aio/models/user_creation.py create mode 100644 flat_api/aio/models/user_details.py create mode 100644 flat_api/aio/models/user_details_admin.py create mode 100644 flat_api/aio/models/user_details_admin_all_of_license.py create mode 100644 flat_api/aio/models/user_public.py create mode 100644 flat_api/aio/models/user_public_summary.py create mode 100644 flat_api/aio/models/user_signin_link.py create mode 100644 flat_api/aio/models/user_signin_link_creation.py create mode 100644 flat_api/aio/rest.py create mode 100644 flat_api/api/omr_api.py create mode 100644 flat_api/client.py create mode 100644 flat_api/errors.py create mode 100644 flat_api/models/add_group_user200_response.py create mode 100644 flat_api/models/add_group_user_request.py rename flat_api/models/{assignment_copy_response_capabilities.py => assignment_capabilities.py} (50%) create mode 100644 flat_api/models/assignment_capabilities_can_publish_in_class_error.py delete mode 100644 flat_api/models/assignment_copy_response_capabilities_can_publish_in_class_error.py create mode 100644 flat_api/models/assignment_copy_to_class.py create mode 100644 flat_api/models/assignment_copy_to_resource_library.py create mode 100644 flat_api/models/assignment_group.py create mode 100644 flat_api/models/assignment_submission_playback.py delete mode 100644 flat_api/models/assignment_submission_playback_inner.py create mode 100644 flat_api/models/assignment_submission_students_mode.py create mode 100644 flat_api/models/class_assignment_all_of_canvas.py create mode 100644 flat_api/models/class_assignment_all_of_lti.py create mode 100644 flat_api/models/class_assignment_all_of_mfc.py delete mode 100644 flat_api/models/class_assignment_canvas.py delete mode 100644 flat_api/models/class_assignment_lti.py delete mode 100644 flat_api/models/class_assignment_mfc.py create mode 100644 flat_api/models/class_assignment_update_all_of_google_classroom.py create mode 100644 flat_api/models/class_assignment_update_all_of_microsoft_graph.py delete mode 100644 flat_api/models/class_assignment_update_google_classroom.py delete mode 100644 flat_api/models/class_assignment_update_microsoft_graph.py create mode 100644 flat_api/models/collection_contents.py create mode 100644 flat_api/models/create_lti_configuration200_response.py create mode 100644 flat_api/models/credit_transaction.py create mode 100644 flat_api/models/edu_resource_assignment_creation.py create mode 100644 flat_api/models/edu_resource_folder.py delete mode 100644 flat_api/models/flat_locales.py create mode 100644 flat_api/models/grade.py create mode 100644 flat_api/models/group_creation.py create mode 100644 flat_api/models/lti_configuration.py create mode 100644 flat_api/models/lti_configuration1p1.py create mode 100644 flat_api/models/lti_configuration1p1_all_of_tool.py create mode 100644 flat_api/models/lti_configuration1p3.py create mode 100644 flat_api/models/lti_configuration1p3_base.py create mode 100644 flat_api/models/lti_configuration1p3_base_supported_services.py create mode 100644 flat_api/models/lti_configuration1p3_base_supported_services_ags.py create mode 100644 flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.py create mode 100644 flat_api/models/lti_configuration1p3_base_supported_services_nrps.py create mode 100644 flat_api/models/lti_configuration1p3_base_tool.py create mode 100644 flat_api/models/lti_configuration1p3_deployment.py create mode 100644 flat_api/models/lti_configuration1p3_dynamic.py create mode 100644 flat_api/models/lti_configuration1p3_manual.py create mode 100644 flat_api/models/lti_configuration_base.py create mode 100644 flat_api/models/lti_configuration_create.py create mode 100644 flat_api/models/lti_configuration_create1p1.py create mode 100644 flat_api/models/lti_configuration_create1p3_deployment.py create mode 100644 flat_api/models/lti_configuration_create1p3_dynamic.py create mode 100644 flat_api/models/lti_configuration_create1p3_dynamic_platform_info.py create mode 100644 flat_api/models/lti_configuration_create1p3_manual.py create mode 100644 flat_api/models/lti_configuration_update.py create mode 100644 flat_api/models/lti_configuration_update_deployment.py create mode 100644 flat_api/models/lti_configuration_update_standalone.py create mode 100644 flat_api/models/omr_capabilities.py create mode 100644 flat_api/models/omr_details_step_data.py create mode 100644 flat_api/models/omr_details_submission.py create mode 100644 flat_api/models/omr_detected_instrument.py create mode 100644 flat_api/models/omr_imported_metadata.py create mode 100644 flat_api/models/omr_instrument_override.py create mode 100644 flat_api/models/omr_job.py create mode 100644 flat_api/models/omr_job_creation.py create mode 100644 flat_api/models/omr_job_file_metadata.py create mode 100644 flat_api/models/omr_job_file_upload.py create mode 100644 flat_api/models/omr_job_file_upload_result.py create mode 100644 flat_api/models/omr_job_input_file.py create mode 100644 flat_api/models/omr_job_output.py create mode 100644 flat_api/models/omr_job_progress.py create mode 100644 flat_api/models/omr_job_result.py create mode 100644 flat_api/models/omr_job_retention.py create mode 100644 flat_api/models/omr_job_status.py create mode 100644 flat_api/models/omr_locale_details.py create mode 100644 flat_api/models/omr_pending_step.py create mode 100644 flat_api/models/omr_step_name.py create mode 100644 flat_api/models/rename_group_request.py create mode 100644 flat_api/models/score_creation_builder_data_all_of_builder_data.py create mode 100644 flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.py create mode 100644 flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.py create mode 100644 flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py delete mode 100644 flat_api/models/score_creation_builder_data_score_data.py create mode 100644 flat_api/models/score_creation_common.py create mode 100644 flat_api/models/score_creation_file_import.py create mode 100644 flat_api/models/score_creation_google_drive_import.py create mode 100644 flat_api/models/score_details_all_of_me.py create mode 100644 flat_api/models/score_summary.py create mode 100644 flat_api/models/score_track_creation_response.py create mode 100644 flat_api/models/teaching_theme.py create mode 100644 flat_api/models/user_basics.py create mode 100644 flat_api/models/user_details_admin_all_of_license.py delete mode 100644 flat_api/models/user_details_admin_license.py create mode 100644 flat_api/oauth.py create mode 100644 flat_api/pagination.py delete mode 100644 setup.cfg delete mode 100644 setup.py delete mode 100644 test-requirements.txt delete mode 100644 test/__init__.py delete mode 100644 test/test_account_api.py delete mode 100644 test/test_api_access_token.py delete mode 100644 test/test_app_scopes.py delete mode 100644 test/test_assignment.py delete mode 100644 test/test_assignment_copy.py delete mode 100644 test/test_assignment_copy_response.py delete mode 100644 test/test_assignment_copy_response_capabilities.py delete mode 100644 test/test_assignment_copy_response_capabilities_can_publish_in_class_error.py delete mode 100644 test/test_assignment_submission.py delete mode 100644 test/test_assignment_submission_comment.py delete mode 100644 test/test_assignment_submission_comment_creation.py delete mode 100644 test/test_assignment_submission_comments.py delete mode 100644 test/test_assignment_submission_history.py delete mode 100644 test/test_assignment_submission_history_attachment.py delete mode 100644 test/test_assignment_submission_history_state.py delete mode 100644 test/test_assignment_submission_lti.py delete mode 100644 test/test_assignment_submission_playback_inner.py delete mode 100644 test/test_assignment_submission_state.py delete mode 100644 test/test_assignment_submission_update.py delete mode 100644 test/test_assignment_type.py delete mode 100644 test/test_assignment_update.py delete mode 100644 test/test_class_api.py delete mode 100644 test/test_class_assignment.py delete mode 100644 test/test_class_assignment_canvas.py delete mode 100644 test/test_class_assignment_lti.py delete mode 100644 test/test_class_assignment_mfc.py delete mode 100644 test/test_class_assignment_update.py delete mode 100644 test/test_class_assignment_update_google_classroom.py delete mode 100644 test/test_class_assignment_update_microsoft_graph.py delete mode 100644 test/test_class_attachment_creation.py delete mode 100644 test/test_class_creation.py delete mode 100644 test/test_class_details.py delete mode 100644 test/test_class_details_canvas.py delete mode 100644 test/test_class_details_clever.py delete mode 100644 test/test_class_details_google_classroom.py delete mode 100644 test/test_class_details_google_drive.py delete mode 100644 test/test_class_details_issues.py delete mode 100644 test/test_class_details_issues_sync_inner.py delete mode 100644 test/test_class_details_lti.py delete mode 100644 test/test_class_details_mfc.py delete mode 100644 test/test_class_details_microsoft_graph.py delete mode 100644 test/test_class_grade_level.py delete mode 100644 test/test_class_roles.py delete mode 100644 test/test_class_state.py delete mode 100644 test/test_class_update.py delete mode 100644 test/test_collection.py delete mode 100644 test/test_collection_api.py delete mode 100644 test/test_collection_app.py delete mode 100644 test/test_collection_capabilities.py delete mode 100644 test/test_collection_creation.py delete mode 100644 test/test_collection_modification.py delete mode 100644 test/test_collection_privacy.py delete mode 100644 test/test_collection_type.py delete mode 100644 test/test_edu_library.py delete mode 100644 test/test_edu_resource.py delete mode 100644 test/test_edu_resource_capabilities.py delete mode 100644 test/test_edu_resource_copy.py delete mode 100644 test/test_edu_resource_creation.py delete mode 100644 test/test_edu_resource_lti_link.py delete mode 100644 test/test_edu_resource_move.py delete mode 100644 test/test_edu_resource_privacy.py delete mode 100644 test/test_edu_resource_resource.py delete mode 100644 test/test_edu_resource_type.py delete mode 100644 test/test_edu_resource_update.py delete mode 100644 test/test_edu_resource_use_in_class.py delete mode 100644 test/test_edu_resources_api.py delete mode 100644 test/test_flat_error_response.py delete mode 100644 test/test_flat_locales.py delete mode 100644 test/test_google_classroom_coursework.py delete mode 100644 test/test_google_classroom_submission.py delete mode 100644 test/test_group.py delete mode 100644 test/test_group_api.py delete mode 100644 test/test_group_details.py delete mode 100644 test/test_group_type.py delete mode 100644 test/test_license_mode.py delete mode 100644 test/test_license_sources.py delete mode 100644 test/test_lms_name.py delete mode 100644 test/test_lti_credentials.py delete mode 100644 test/test_lti_credentials_creation.py delete mode 100644 test/test_media_attachment.py delete mode 100644 test/test_media_score_sharing_mode.py delete mode 100644 test/test_microsoft_graph_assignment.py delete mode 100644 test/test_microsoft_graph_submission.py delete mode 100644 test/test_organization_api.py delete mode 100644 test/test_organization_invitation.py delete mode 100644 test/test_organization_invitation_creation.py delete mode 100644 test/test_organization_roles.py delete mode 100644 test/test_organization_user_access_token_creation.py delete mode 100644 test/test_resource_collaborator.py delete mode 100644 test/test_resource_collaborator_creation.py delete mode 100644 test/test_resource_rights.py delete mode 100644 test/test_score_api.py delete mode 100644 test/test_score_comment.py delete mode 100644 test/test_score_comment_context.py delete mode 100644 test/test_score_comment_creation.py delete mode 100644 test/test_score_comment_moderation.py delete mode 100644 test/test_score_comment_update.py delete mode 100644 test/test_score_comments_counts.py delete mode 100644 test/test_score_creation.py delete mode 100644 test/test_score_creation_builder_data.py delete mode 100644 test/test_score_creation_builder_data_layout_data.py delete mode 100644 test/test_score_creation_builder_data_score_data.py delete mode 100644 test/test_score_creation_builder_data_score_data_instruments_inner.py delete mode 100644 test/test_score_creation_type.py delete mode 100644 test/test_score_details.py delete mode 100644 test/test_score_fork.py delete mode 100644 test/test_score_license.py delete mode 100644 test/test_score_likes_counts.py delete mode 100644 test/test_score_modification.py delete mode 100644 test/test_score_plays_counts.py delete mode 100644 test/test_score_privacy.py delete mode 100644 test/test_score_revision.py delete mode 100644 test/test_score_revision_creation.py delete mode 100644 test/test_score_revision_statistics.py delete mode 100644 test/test_score_source.py delete mode 100644 test/test_score_track.py delete mode 100644 test/test_score_track_creation.py delete mode 100644 test/test_score_track_point.py delete mode 100644 test/test_score_track_purpose.py delete mode 100644 test/test_score_track_state.py delete mode 100644 test/test_score_track_type.py delete mode 100644 test/test_score_track_update.py delete mode 100644 test/test_score_views_counts.py delete mode 100644 test/test_task.py delete mode 100644 test/test_task_api.py delete mode 100644 test/test_task_export_options.py delete mode 100644 test/test_task_progress.py delete mode 100644 test/test_task_result.py delete mode 100644 test/test_tutteo_product.py delete mode 100644 test/test_user_admin_update.py delete mode 100644 test/test_user_api.py delete mode 100644 test/test_user_azure_details.py delete mode 100644 test/test_user_community_profile_links.py delete mode 100644 test/test_user_creation.py delete mode 100644 test/test_user_details.py delete mode 100644 test/test_user_details_admin.py delete mode 100644 test/test_user_details_admin_license.py delete mode 100644 test/test_user_public.py delete mode 100644 test/test_user_public_summary.py delete mode 100644 test/test_user_signin_link.py delete mode 100644 test/test_user_signin_link_creation.py create mode 100755 tools/emit_inventory.py create mode 100755 tools/generate.sh create mode 100644 tools/openapi-config-async.json create mode 100644 tools/openapi-config.json create mode 100644 tools/patches/10_async_merge.py create mode 100644 tools/patches/20_errors.py create mode 100644 tools/patches/30_retry.py create mode 100644 tools/patches/40_pagination.py create mode 100644 tools/patches/50_oauth.py create mode 100644 tools/patches/60_client.py create mode 100644 tools/patches/70_docs.py create mode 100644 tools/patches/80_user_agent.py create mode 100644 tools/patches/90_exports.py create mode 100755 tools/patches/95_py_typed.py create mode 100644 tools/smoke.py delete mode 100644 tox.ini diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..a5d6bf148c43bf1d69ce46624b4570d4d6633dda GIT binary patch literal 8196 zcmeHMziSjh6n+y|Z%qgU5l!c|7LlYoEo5_CY_1W~SebZxn;&}T9{C0776gez#6n0b zSftRx+QLE*;Xv?Dv9uDu`Ej{7?%r|Nh~gXA`S#|$H}9KoCbxNeM5Jo_ttFy)A_{S7 zoSQ*c(zIP)g*N3zBA`M%wKtbmldRJ%c*=k%APR^AqJStM3j8e!;F+ykIOMr+tzs|c__gSp7ONUrbO1tRSD8cFy>_Y0VuCX!No3E+yD6C$v`!QmEzBl7V`21gM z{^!B}!0gKb=c_*Up7~bJ@7;&n)9%c&c+RKXgXdR2zw7(~wQv#=+U41)@+Rdrp8L+x z)Bb*+#q!K$cAl4J*LB{IHmGgR;hH_4UjFL!w`D$@N40vdH+A`o{<|&A#rcf#^LW+X zYhFSBBzb%)4;Q$N^Ekfse4vLrg*<B~mdH(AikR}RDuE04PGOz3ZmErII zC!bg%L;+FYpHV;s_0@U}bX{#-Ag*ie2-i9;-LzkB(S)Eg3lNSL-2I)kBKdQhlVND%B literal 0 HcmV?d00001 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0190fd7 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,36 @@ +name: CI + +# Build and load checks. Everything that needs a credential runs elsewhere and reports +# back as a commit status, so no secret is reachable from this workflow. + +on: + pull_request: + push: + branches: [master, main] + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: build (python ${{ matrix.python }}) + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ['3.11', '3.12', '3.13'] + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + - name: Import the installed package + # `--with .` installs this package into a throwaway environment, so this exercises the + # path a user takes and proves the dependency list in pyproject.toml is complete. Run + # from RUNNER_TEMP, or the import would resolve to the source directory instead of what + # was installed. + run: cd "$RUNNER_TEMP" && uv run --no-project --python ${{ matrix.python }} --with "$GITHUB_WORKSPACE" python -c "import flat_api; print(flat_api.__version__)" + - name: Compile every module + run: uv run --no-project --python ${{ matrix.python }} python -m compileall -q flat_api diff --git a/.github/workflows/python-push.yml b/.github/workflows/python-push.yml deleted file mode 100644 index 6a19390..0000000 --- a/.github/workflows/python-push.yml +++ /dev/null @@ -1,39 +0,0 @@ -on: - push: - branches: - - master - -permissions: - contents: write - pull-requests: write - packages: write - -name: release-please - -jobs: - release-please: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Set up Python - uses: actions/setup-python@v3 - with: - python-version: '3.x' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install build - - name: Build package - run: python -m build - - uses: google-github-actions/release-please-action@v4 - id: release - with: - release-type: python - package-name: flat_api - bump-minor-pre-major: true - - name: Publish package - uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 - with: - user: __token__ - password: ${{ secrets.PYPI_API_TOKEN }} - if: ${{ steps.release.outputs.release_created }} \ No newline at end of file diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml deleted file mode 100644 index 3db3c3f..0000000 --- a/.github/workflows/python.yml +++ /dev/null @@ -1,38 +0,0 @@ -# NOTE: This file is auto generated by OpenAPI Generator. -# URL: https://openapi-generator.tech -# -# ref: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python - -name: flat_api Python package - -on: [push, pull_request] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] - - steps: - - uses: actions/checkout@v3 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - 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 - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - pytest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..10e8d24 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Release + +# Publishing is triggered by a version tag and nothing else (FR-019a). The tag is created by +# tag-on-merge.yml, so the approval -> merge -> tag -> publish ordering is enforced by the +# platform rather than by convention (FR-007f). + +on: + push: + tags: ['[0-9]+.[0-9]+.[0-9]+'] + +permissions: + contents: read + id-token: write # OIDC for PyPI trusted publishing and provenance (FR-021a, FR-021b) + +jobs: + publish: + runs-on: ubuntu-latest + environment: pypi + steps: + - uses: actions/checkout@v4 + - uses: astral-sh/setup-uv@v5 + with: + python-version: '3.12' + + - name: The tag must match the packaged version + run: | + TAG="${GITHUB_REF_NAME}" + PKG="$(cat VERSION)" + [ "$TAG" = "$PKG" ] || { echo "tag $TAG != VERSION $PKG"; exit 1; } + + - run: uv build + + # Assert the artifact, not just the file. setuptools derives the version from VERSION, but a + # broken pyproject.toml still builds: it silently produced flat_api-0.0.0 once. PyPI never + # lets a version be replaced, so this has to fail here rather than after the upload. + - name: The built artifact must carry the tagged version + run: | + TAG="${GITHUB_REF_NAME}" + test -f "dist/flat_api-${TAG}-py3-none-any.whl" || { + echo "no wheel for ${TAG}; dist/ holds:"; ls dist/; exit 1; + } + test -f "dist/flat_api-${TAG}.tar.gz" || { + echo "no sdist for ${TAG}; dist/ holds:"; ls dist/; exit 1; + } + + # No long-lived token exists: PyPI trusts this repository and workflow by OIDC. + - name: Publish to PyPI (trusted publishing) + uses: pypa/gh-action-pypi-publish@release/v1 + with: + attestations: true diff --git a/.github/workflows/tag-on-merge.yml b/.github/workflows/tag-on-merge.yml new file mode 100644 index 0000000..198952d --- /dev/null +++ b/.github/workflows/tag-on-merge.yml @@ -0,0 +1,38 @@ +name: Tag on merge + +# Merging is what creates the version tag, and the tag is what publishes (FR-007f, FR-019a). +# A breaking release waits for a human to merge, which is how the FR-019 approval is expressed. + +on: + push: + branches: [master, main] + +permissions: + contents: write + +jobs: + tag: + runs-on: ubuntu-latest + steps: + # SDK_RELEASE_TOKEN, not the automatic GITHUB_TOKEN. GitHub does not start a workflow run for + # an event created with GITHUB_TOKEN, so a tag pushed with it would never trigger release.yml + # and nothing would ever publish. That failure is silent: the tag appears, the release + # workflow simply never runs. Needs contents:write on this repository. + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.SDK_RELEASE_TOKEN }} + - name: Tag the version if it is new + run: | + test -n "${{ secrets.SDK_RELEASE_TOKEN }}" || { + echo "SDK_RELEASE_TOKEN is not set: the tag would not trigger release.yml"; exit 1; + } + VERSION="$(cat VERSION)" + if git rev-parse "$VERSION" >/dev/null 2>&1; then + echo "Tag $VERSION already exists, nothing to do." + exit 0 + fi + git config user.name "Flat SDK bot" + git config user.email "developers@flat.io" + git tag -a "$VERSION" -m "Release $VERSION" + git push origin "$VERSION" diff --git a/.gitignore b/.gitignore index 2fba2c4..6829ade 100644 --- a/.gitignore +++ b/.gitignore @@ -65,3 +65,12 @@ target/ # Virtualenv .venv + +# generation scratch tree (tools/generate.sh) +.sdkgen-scratch/ +.openapi-spec.yaml + +# build and tooling artifacts +.venv/ +.pytest_cache/ +.coverage diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 0844651..d93f826 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -1,147 +1,4 @@ -.github/workflows/python.yml -.gitlab-ci.yml -README.md -docs/AccountApi.md -docs/ApiAccessToken.md -docs/AppScopes.md -docs/Assignment.md -docs/AssignmentCopy.md -docs/AssignmentCopyResponse.md -docs/AssignmentCopyResponseCapabilities.md -docs/AssignmentCopyResponseCapabilitiesCanPublishInClassError.md -docs/AssignmentSubmission.md -docs/AssignmentSubmissionComment.md -docs/AssignmentSubmissionCommentCreation.md -docs/AssignmentSubmissionComments.md -docs/AssignmentSubmissionHistory.md -docs/AssignmentSubmissionHistoryAttachment.md -docs/AssignmentSubmissionHistoryState.md -docs/AssignmentSubmissionLti.md -docs/AssignmentSubmissionPlaybackInner.md -docs/AssignmentSubmissionState.md -docs/AssignmentSubmissionUpdate.md -docs/AssignmentType.md -docs/AssignmentUpdate.md -docs/ClassApi.md -docs/ClassAssignment.md -docs/ClassAssignmentCanvas.md -docs/ClassAssignmentLti.md -docs/ClassAssignmentMfc.md -docs/ClassAssignmentUpdate.md -docs/ClassAssignmentUpdateGoogleClassroom.md -docs/ClassAssignmentUpdateMicrosoftGraph.md -docs/ClassAttachmentCreation.md -docs/ClassCreation.md -docs/ClassDetails.md -docs/ClassDetailsCanvas.md -docs/ClassDetailsClever.md -docs/ClassDetailsGoogleClassroom.md -docs/ClassDetailsGoogleDrive.md -docs/ClassDetailsIssues.md -docs/ClassDetailsIssuesSyncInner.md -docs/ClassDetailsLti.md -docs/ClassDetailsMfc.md -docs/ClassDetailsMicrosoftGraph.md -docs/ClassGradeLevel.md -docs/ClassRoles.md -docs/ClassState.md -docs/ClassUpdate.md -docs/Collection.md -docs/CollectionApi.md -docs/CollectionApp.md -docs/CollectionCapabilities.md -docs/CollectionCreation.md -docs/CollectionModification.md -docs/CollectionPrivacy.md -docs/CollectionType.md -docs/EduLibrary.md -docs/EduResource.md -docs/EduResourceCapabilities.md -docs/EduResourceCopy.md -docs/EduResourceCreation.md -docs/EduResourceLtiLink.md -docs/EduResourceMove.md -docs/EduResourcePrivacy.md -docs/EduResourceResource.md -docs/EduResourceType.md -docs/EduResourceUpdate.md -docs/EduResourceUseInClass.md -docs/EduResourcesApi.md -docs/FlatErrorResponse.md -docs/FlatLocales.md -docs/GoogleClassroomCoursework.md -docs/GoogleClassroomSubmission.md -docs/Group.md -docs/GroupApi.md -docs/GroupDetails.md -docs/GroupType.md -docs/LicenseMode.md -docs/LicenseSources.md -docs/LmsName.md -docs/LtiCredentials.md -docs/LtiCredentialsCreation.md -docs/MediaAttachment.md -docs/MediaScoreSharingMode.md -docs/MicrosoftGraphAssignment.md -docs/MicrosoftGraphSubmission.md -docs/OrganizationApi.md -docs/OrganizationInvitation.md -docs/OrganizationInvitationCreation.md -docs/OrganizationRoles.md -docs/OrganizationUserAccessTokenCreation.md -docs/ResourceCollaborator.md -docs/ResourceCollaboratorCreation.md -docs/ResourceRights.md -docs/ScoreApi.md -docs/ScoreComment.md -docs/ScoreCommentContext.md -docs/ScoreCommentCreation.md -docs/ScoreCommentModeration.md -docs/ScoreCommentUpdate.md -docs/ScoreCommentsCounts.md -docs/ScoreCreation.md -docs/ScoreCreationBuilderData.md -docs/ScoreCreationBuilderDataLayoutData.md -docs/ScoreCreationBuilderDataScoreData.md -docs/ScoreCreationBuilderDataScoreDataInstrumentsInner.md -docs/ScoreCreationType.md -docs/ScoreDetails.md -docs/ScoreFork.md -docs/ScoreLicense.md -docs/ScoreLikesCounts.md -docs/ScoreModification.md -docs/ScorePlaysCounts.md -docs/ScorePrivacy.md -docs/ScoreRevision.md -docs/ScoreRevisionCreation.md -docs/ScoreRevisionStatistics.md -docs/ScoreSource.md -docs/ScoreTrack.md -docs/ScoreTrackCreation.md -docs/ScoreTrackPoint.md -docs/ScoreTrackPurpose.md -docs/ScoreTrackState.md -docs/ScoreTrackType.md -docs/ScoreTrackUpdate.md -docs/ScoreViewsCounts.md -docs/Task.md -docs/TaskApi.md -docs/TaskExportOptions.md -docs/TaskProgress.md -docs/TaskResult.md -docs/TutteoProduct.md -docs/UserAdminUpdate.md -docs/UserApi.md -docs/UserAzureDetails.md -docs/UserCommunityProfileLinks.md -docs/UserCreation.md -docs/UserDetails.md -docs/UserDetailsAdmin.md -docs/UserDetailsAdminLicense.md -docs/UserPublic.md -docs/UserPublicSummary.md -docs/UserSigninLink.md -docs/UserSigninLinkCreation.md +.openapi-generator-ignore flat_api/__init__.py flat_api/api/__init__.py flat_api/api/account_api.py @@ -149,6 +6,7 @@ flat_api/api/class_api.py flat_api/api/collection_api.py flat_api/api/edu_resources_api.py flat_api/api/group_api.py +flat_api/api/omr_api.py flat_api/api/organization_api.py flat_api/api/score_api.py flat_api/api/task_api.py @@ -156,15 +14,227 @@ flat_api/api/user_api.py flat_api/api_client.py flat_api/api_response.py flat_api/configuration.py +flat_api/docs/AccountApi.md +flat_api/docs/AddGroupUser200Response.md +flat_api/docs/AddGroupUserRequest.md +flat_api/docs/ApiAccessToken.md +flat_api/docs/AppScopes.md +flat_api/docs/Assignment.md +flat_api/docs/AssignmentCapabilities.md +flat_api/docs/AssignmentCapabilitiesCanPublishInClassError.md +flat_api/docs/AssignmentCopy.md +flat_api/docs/AssignmentCopyResponse.md +flat_api/docs/AssignmentCopyToClass.md +flat_api/docs/AssignmentCopyToResourceLibrary.md +flat_api/docs/AssignmentGroup.md +flat_api/docs/AssignmentSubmission.md +flat_api/docs/AssignmentSubmissionComment.md +flat_api/docs/AssignmentSubmissionCommentCreation.md +flat_api/docs/AssignmentSubmissionComments.md +flat_api/docs/AssignmentSubmissionHistory.md +flat_api/docs/AssignmentSubmissionHistoryAttachment.md +flat_api/docs/AssignmentSubmissionHistoryState.md +flat_api/docs/AssignmentSubmissionLti.md +flat_api/docs/AssignmentSubmissionPlayback.md +flat_api/docs/AssignmentSubmissionState.md +flat_api/docs/AssignmentSubmissionStudentsMode.md +flat_api/docs/AssignmentSubmissionUpdate.md +flat_api/docs/AssignmentType.md +flat_api/docs/AssignmentUpdate.md +flat_api/docs/ClassApi.md +flat_api/docs/ClassAssignment.md +flat_api/docs/ClassAssignmentAllOfCanvas.md +flat_api/docs/ClassAssignmentAllOfLti.md +flat_api/docs/ClassAssignmentAllOfMfc.md +flat_api/docs/ClassAssignmentUpdate.md +flat_api/docs/ClassAssignmentUpdateAllOfGoogleClassroom.md +flat_api/docs/ClassAssignmentUpdateAllOfMicrosoftGraph.md +flat_api/docs/ClassAttachmentCreation.md +flat_api/docs/ClassCreation.md +flat_api/docs/ClassDetails.md +flat_api/docs/ClassDetailsCanvas.md +flat_api/docs/ClassDetailsClever.md +flat_api/docs/ClassDetailsGoogleClassroom.md +flat_api/docs/ClassDetailsGoogleDrive.md +flat_api/docs/ClassDetailsIssues.md +flat_api/docs/ClassDetailsIssuesSyncInner.md +flat_api/docs/ClassDetailsLti.md +flat_api/docs/ClassDetailsMfc.md +flat_api/docs/ClassDetailsMicrosoftGraph.md +flat_api/docs/ClassGradeLevel.md +flat_api/docs/ClassRoles.md +flat_api/docs/ClassState.md +flat_api/docs/ClassUpdate.md +flat_api/docs/Collection.md +flat_api/docs/CollectionApi.md +flat_api/docs/CollectionApp.md +flat_api/docs/CollectionCapabilities.md +flat_api/docs/CollectionContents.md +flat_api/docs/CollectionCreation.md +flat_api/docs/CollectionModification.md +flat_api/docs/CollectionPrivacy.md +flat_api/docs/CollectionType.md +flat_api/docs/CreateLtiConfiguration200Response.md +flat_api/docs/CreditTransaction.md +flat_api/docs/EduLibrary.md +flat_api/docs/EduResource.md +flat_api/docs/EduResourceAssignmentCreation.md +flat_api/docs/EduResourceCapabilities.md +flat_api/docs/EduResourceCopy.md +flat_api/docs/EduResourceCreation.md +flat_api/docs/EduResourceFolder.md +flat_api/docs/EduResourceLtiLink.md +flat_api/docs/EduResourceMove.md +flat_api/docs/EduResourcePrivacy.md +flat_api/docs/EduResourceResource.md +flat_api/docs/EduResourceType.md +flat_api/docs/EduResourceUpdate.md +flat_api/docs/EduResourceUseInClass.md +flat_api/docs/EduResourcesApi.md +flat_api/docs/FlatErrorResponse.md +flat_api/docs/GoogleClassroomCoursework.md +flat_api/docs/GoogleClassroomSubmission.md +flat_api/docs/Grade.md +flat_api/docs/Group.md +flat_api/docs/GroupApi.md +flat_api/docs/GroupCreation.md +flat_api/docs/GroupDetails.md +flat_api/docs/GroupType.md +flat_api/docs/LicenseMode.md +flat_api/docs/LicenseSources.md +flat_api/docs/LmsName.md +flat_api/docs/LtiConfiguration.md +flat_api/docs/LtiConfiguration1p1.md +flat_api/docs/LtiConfiguration1p1AllOfTool.md +flat_api/docs/LtiConfiguration1p3.md +flat_api/docs/LtiConfiguration1p3Base.md +flat_api/docs/LtiConfiguration1p3BaseSupportedServices.md +flat_api/docs/LtiConfiguration1p3BaseSupportedServicesAgs.md +flat_api/docs/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md +flat_api/docs/LtiConfiguration1p3BaseSupportedServicesNrps.md +flat_api/docs/LtiConfiguration1p3BaseTool.md +flat_api/docs/LtiConfiguration1p3Deployment.md +flat_api/docs/LtiConfiguration1p3Dynamic.md +flat_api/docs/LtiConfiguration1p3Manual.md +flat_api/docs/LtiConfigurationBase.md +flat_api/docs/LtiConfigurationCreate.md +flat_api/docs/LtiConfigurationCreate1p1.md +flat_api/docs/LtiConfigurationCreate1p3Deployment.md +flat_api/docs/LtiConfigurationCreate1p3Dynamic.md +flat_api/docs/LtiConfigurationCreate1p3DynamicPlatformInfo.md +flat_api/docs/LtiConfigurationCreate1p3Manual.md +flat_api/docs/LtiConfigurationUpdate.md +flat_api/docs/LtiConfigurationUpdateDeployment.md +flat_api/docs/LtiConfigurationUpdateStandalone.md +flat_api/docs/LtiCredentials.md +flat_api/docs/LtiCredentialsCreation.md +flat_api/docs/MediaAttachment.md +flat_api/docs/MediaScoreSharingMode.md +flat_api/docs/MicrosoftGraphAssignment.md +flat_api/docs/MicrosoftGraphSubmission.md +flat_api/docs/OMRApi.md +flat_api/docs/OmrCapabilities.md +flat_api/docs/OmrDetailsStepData.md +flat_api/docs/OmrDetailsSubmission.md +flat_api/docs/OmrDetectedInstrument.md +flat_api/docs/OmrImportedMetadata.md +flat_api/docs/OmrInstrumentOverride.md +flat_api/docs/OmrJob.md +flat_api/docs/OmrJobCreation.md +flat_api/docs/OmrJobFileMetadata.md +flat_api/docs/OmrJobFileUpload.md +flat_api/docs/OmrJobFileUploadResult.md +flat_api/docs/OmrJobInputFile.md +flat_api/docs/OmrJobOutput.md +flat_api/docs/OmrJobProgress.md +flat_api/docs/OmrJobResult.md +flat_api/docs/OmrJobRetention.md +flat_api/docs/OmrJobStatus.md +flat_api/docs/OmrLocaleDetails.md +flat_api/docs/OmrPendingStep.md +flat_api/docs/OmrStepName.md +flat_api/docs/OrganizationApi.md +flat_api/docs/OrganizationInvitation.md +flat_api/docs/OrganizationInvitationCreation.md +flat_api/docs/OrganizationRoles.md +flat_api/docs/OrganizationUserAccessTokenCreation.md +flat_api/docs/RenameGroupRequest.md +flat_api/docs/ResourceCollaborator.md +flat_api/docs/ResourceCollaboratorCreation.md +flat_api/docs/ResourceRights.md +flat_api/docs/ScoreApi.md +flat_api/docs/ScoreComment.md +flat_api/docs/ScoreCommentContext.md +flat_api/docs/ScoreCommentCreation.md +flat_api/docs/ScoreCommentModeration.md +flat_api/docs/ScoreCommentUpdate.md +flat_api/docs/ScoreCommentsCounts.md +flat_api/docs/ScoreCreation.md +flat_api/docs/ScoreCreationBuilderData.md +flat_api/docs/ScoreCreationBuilderDataAllOfBuilderData.md +flat_api/docs/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md +flat_api/docs/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md +flat_api/docs/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md +flat_api/docs/ScoreCreationCommon.md +flat_api/docs/ScoreCreationFileImport.md +flat_api/docs/ScoreCreationGoogleDriveImport.md +flat_api/docs/ScoreCreationType.md +flat_api/docs/ScoreDetails.md +flat_api/docs/ScoreDetailsAllOfMe.md +flat_api/docs/ScoreFork.md +flat_api/docs/ScoreLicense.md +flat_api/docs/ScoreLikesCounts.md +flat_api/docs/ScoreModification.md +flat_api/docs/ScorePlaysCounts.md +flat_api/docs/ScorePrivacy.md +flat_api/docs/ScoreRevision.md +flat_api/docs/ScoreRevisionCreation.md +flat_api/docs/ScoreRevisionStatistics.md +flat_api/docs/ScoreSource.md +flat_api/docs/ScoreSummary.md +flat_api/docs/ScoreTrack.md +flat_api/docs/ScoreTrackCreation.md +flat_api/docs/ScoreTrackCreationResponse.md +flat_api/docs/ScoreTrackPoint.md +flat_api/docs/ScoreTrackPurpose.md +flat_api/docs/ScoreTrackState.md +flat_api/docs/ScoreTrackType.md +flat_api/docs/ScoreTrackUpdate.md +flat_api/docs/ScoreViewsCounts.md +flat_api/docs/Task.md +flat_api/docs/TaskApi.md +flat_api/docs/TaskExportOptions.md +flat_api/docs/TaskProgress.md +flat_api/docs/TaskResult.md +flat_api/docs/TeachingTheme.md +flat_api/docs/TutteoProduct.md +flat_api/docs/UserAdminUpdate.md +flat_api/docs/UserApi.md +flat_api/docs/UserAzureDetails.md +flat_api/docs/UserBasics.md +flat_api/docs/UserCommunityProfileLinks.md +flat_api/docs/UserCreation.md +flat_api/docs/UserDetails.md +flat_api/docs/UserDetailsAdmin.md +flat_api/docs/UserDetailsAdminAllOfLicense.md +flat_api/docs/UserPublic.md +flat_api/docs/UserPublicSummary.md +flat_api/docs/UserSigninLink.md +flat_api/docs/UserSigninLinkCreation.md flat_api/exceptions.py flat_api/models/__init__.py +flat_api/models/add_group_user200_response.py +flat_api/models/add_group_user_request.py flat_api/models/api_access_token.py flat_api/models/app_scopes.py flat_api/models/assignment.py +flat_api/models/assignment_capabilities.py +flat_api/models/assignment_capabilities_can_publish_in_class_error.py flat_api/models/assignment_copy.py flat_api/models/assignment_copy_response.py -flat_api/models/assignment_copy_response_capabilities.py -flat_api/models/assignment_copy_response_capabilities_can_publish_in_class_error.py +flat_api/models/assignment_copy_to_class.py +flat_api/models/assignment_copy_to_resource_library.py +flat_api/models/assignment_group.py flat_api/models/assignment_submission.py flat_api/models/assignment_submission_comment.py flat_api/models/assignment_submission_comment_creation.py @@ -173,18 +243,19 @@ flat_api/models/assignment_submission_history.py flat_api/models/assignment_submission_history_attachment.py flat_api/models/assignment_submission_history_state.py flat_api/models/assignment_submission_lti.py -flat_api/models/assignment_submission_playback_inner.py +flat_api/models/assignment_submission_playback.py flat_api/models/assignment_submission_state.py +flat_api/models/assignment_submission_students_mode.py flat_api/models/assignment_submission_update.py flat_api/models/assignment_type.py flat_api/models/assignment_update.py flat_api/models/class_assignment.py -flat_api/models/class_assignment_canvas.py -flat_api/models/class_assignment_lti.py -flat_api/models/class_assignment_mfc.py +flat_api/models/class_assignment_all_of_canvas.py +flat_api/models/class_assignment_all_of_lti.py +flat_api/models/class_assignment_all_of_mfc.py flat_api/models/class_assignment_update.py -flat_api/models/class_assignment_update_google_classroom.py -flat_api/models/class_assignment_update_microsoft_graph.py +flat_api/models/class_assignment_update_all_of_google_classroom.py +flat_api/models/class_assignment_update_all_of_microsoft_graph.py flat_api/models/class_attachment_creation.py flat_api/models/class_creation.py flat_api/models/class_details.py @@ -204,15 +275,20 @@ flat_api/models/class_update.py flat_api/models/collection.py flat_api/models/collection_app.py flat_api/models/collection_capabilities.py +flat_api/models/collection_contents.py flat_api/models/collection_creation.py flat_api/models/collection_modification.py flat_api/models/collection_privacy.py flat_api/models/collection_type.py +flat_api/models/create_lti_configuration200_response.py +flat_api/models/credit_transaction.py flat_api/models/edu_library.py flat_api/models/edu_resource.py +flat_api/models/edu_resource_assignment_creation.py flat_api/models/edu_resource_capabilities.py flat_api/models/edu_resource_copy.py flat_api/models/edu_resource_creation.py +flat_api/models/edu_resource_folder.py flat_api/models/edu_resource_lti_link.py flat_api/models/edu_resource_move.py flat_api/models/edu_resource_privacy.py @@ -221,25 +297,70 @@ flat_api/models/edu_resource_type.py flat_api/models/edu_resource_update.py flat_api/models/edu_resource_use_in_class.py flat_api/models/flat_error_response.py -flat_api/models/flat_locales.py flat_api/models/google_classroom_coursework.py flat_api/models/google_classroom_submission.py +flat_api/models/grade.py flat_api/models/group.py +flat_api/models/group_creation.py flat_api/models/group_details.py flat_api/models/group_type.py flat_api/models/license_mode.py flat_api/models/license_sources.py flat_api/models/lms_name.py +flat_api/models/lti_configuration.py +flat_api/models/lti_configuration1p1.py +flat_api/models/lti_configuration1p1_all_of_tool.py +flat_api/models/lti_configuration1p3.py +flat_api/models/lti_configuration1p3_base.py +flat_api/models/lti_configuration1p3_base_supported_services.py +flat_api/models/lti_configuration1p3_base_supported_services_ags.py +flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.py +flat_api/models/lti_configuration1p3_base_supported_services_nrps.py +flat_api/models/lti_configuration1p3_base_tool.py +flat_api/models/lti_configuration1p3_deployment.py +flat_api/models/lti_configuration1p3_dynamic.py +flat_api/models/lti_configuration1p3_manual.py +flat_api/models/lti_configuration_base.py +flat_api/models/lti_configuration_create.py +flat_api/models/lti_configuration_create1p1.py +flat_api/models/lti_configuration_create1p3_deployment.py +flat_api/models/lti_configuration_create1p3_dynamic.py +flat_api/models/lti_configuration_create1p3_dynamic_platform_info.py +flat_api/models/lti_configuration_create1p3_manual.py +flat_api/models/lti_configuration_update.py +flat_api/models/lti_configuration_update_deployment.py +flat_api/models/lti_configuration_update_standalone.py flat_api/models/lti_credentials.py flat_api/models/lti_credentials_creation.py flat_api/models/media_attachment.py flat_api/models/media_score_sharing_mode.py flat_api/models/microsoft_graph_assignment.py flat_api/models/microsoft_graph_submission.py +flat_api/models/omr_capabilities.py +flat_api/models/omr_details_step_data.py +flat_api/models/omr_details_submission.py +flat_api/models/omr_detected_instrument.py +flat_api/models/omr_imported_metadata.py +flat_api/models/omr_instrument_override.py +flat_api/models/omr_job.py +flat_api/models/omr_job_creation.py +flat_api/models/omr_job_file_metadata.py +flat_api/models/omr_job_file_upload.py +flat_api/models/omr_job_file_upload_result.py +flat_api/models/omr_job_input_file.py +flat_api/models/omr_job_output.py +flat_api/models/omr_job_progress.py +flat_api/models/omr_job_result.py +flat_api/models/omr_job_retention.py +flat_api/models/omr_job_status.py +flat_api/models/omr_locale_details.py +flat_api/models/omr_pending_step.py +flat_api/models/omr_step_name.py flat_api/models/organization_invitation.py flat_api/models/organization_invitation_creation.py flat_api/models/organization_roles.py flat_api/models/organization_user_access_token_creation.py +flat_api/models/rename_group_request.py flat_api/models/resource_collaborator.py flat_api/models/resource_collaborator_creation.py flat_api/models/resource_rights.py @@ -251,11 +372,16 @@ flat_api/models/score_comment_update.py flat_api/models/score_comments_counts.py flat_api/models/score_creation.py flat_api/models/score_creation_builder_data.py -flat_api/models/score_creation_builder_data_layout_data.py -flat_api/models/score_creation_builder_data_score_data.py -flat_api/models/score_creation_builder_data_score_data_instruments_inner.py +flat_api/models/score_creation_builder_data_all_of_builder_data.py +flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.py +flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.py +flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py +flat_api/models/score_creation_common.py +flat_api/models/score_creation_file_import.py +flat_api/models/score_creation_google_drive_import.py flat_api/models/score_creation_type.py flat_api/models/score_details.py +flat_api/models/score_details_all_of_me.py flat_api/models/score_fork.py flat_api/models/score_license.py flat_api/models/score_likes_counts.py @@ -266,8 +392,10 @@ flat_api/models/score_revision.py flat_api/models/score_revision_creation.py flat_api/models/score_revision_statistics.py flat_api/models/score_source.py +flat_api/models/score_summary.py flat_api/models/score_track.py flat_api/models/score_track_creation.py +flat_api/models/score_track_creation_response.py flat_api/models/score_track_point.py flat_api/models/score_track_purpose.py flat_api/models/score_track_state.py @@ -278,164 +406,227 @@ flat_api/models/task.py flat_api/models/task_export_options.py flat_api/models/task_progress.py flat_api/models/task_result.py +flat_api/models/teaching_theme.py flat_api/models/tutteo_product.py flat_api/models/user_admin_update.py flat_api/models/user_azure_details.py +flat_api/models/user_basics.py flat_api/models/user_community_profile_links.py flat_api/models/user_creation.py flat_api/models/user_details.py flat_api/models/user_details_admin.py -flat_api/models/user_details_admin_license.py +flat_api/models/user_details_admin_all_of_license.py flat_api/models/user_public.py flat_api/models/user_public_summary.py flat_api/models/user_signin_link.py flat_api/models/user_signin_link_creation.py -flat_api/py.typed flat_api/rest.py -pyproject.toml -requirements.txt -setup.cfg -test-requirements.txt -test/__init__.py -test/test_account_api.py -test/test_api_access_token.py -test/test_app_scopes.py -test/test_assignment.py -test/test_assignment_copy.py -test/test_assignment_copy_response.py -test/test_assignment_copy_response_capabilities.py -test/test_assignment_copy_response_capabilities_can_publish_in_class_error.py -test/test_assignment_submission.py -test/test_assignment_submission_comment.py -test/test_assignment_submission_comment_creation.py -test/test_assignment_submission_comments.py -test/test_assignment_submission_history.py -test/test_assignment_submission_history_attachment.py -test/test_assignment_submission_history_state.py -test/test_assignment_submission_lti.py -test/test_assignment_submission_playback_inner.py -test/test_assignment_submission_state.py -test/test_assignment_submission_update.py -test/test_assignment_type.py -test/test_assignment_update.py -test/test_class_api.py -test/test_class_assignment.py -test/test_class_assignment_canvas.py -test/test_class_assignment_lti.py -test/test_class_assignment_mfc.py -test/test_class_assignment_update.py -test/test_class_assignment_update_google_classroom.py -test/test_class_assignment_update_microsoft_graph.py -test/test_class_attachment_creation.py -test/test_class_creation.py -test/test_class_details.py -test/test_class_details_canvas.py -test/test_class_details_clever.py -test/test_class_details_google_classroom.py -test/test_class_details_google_drive.py -test/test_class_details_issues.py -test/test_class_details_issues_sync_inner.py -test/test_class_details_lti.py -test/test_class_details_mfc.py -test/test_class_details_microsoft_graph.py -test/test_class_grade_level.py -test/test_class_roles.py -test/test_class_state.py -test/test_class_update.py -test/test_collection.py -test/test_collection_api.py -test/test_collection_app.py -test/test_collection_capabilities.py -test/test_collection_creation.py -test/test_collection_modification.py -test/test_collection_privacy.py -test/test_collection_type.py -test/test_edu_library.py -test/test_edu_resource.py -test/test_edu_resource_capabilities.py -test/test_edu_resource_copy.py -test/test_edu_resource_creation.py -test/test_edu_resource_lti_link.py -test/test_edu_resource_move.py -test/test_edu_resource_privacy.py -test/test_edu_resource_resource.py -test/test_edu_resource_type.py -test/test_edu_resource_update.py -test/test_edu_resource_use_in_class.py -test/test_edu_resources_api.py -test/test_flat_error_response.py -test/test_flat_locales.py -test/test_google_classroom_coursework.py -test/test_google_classroom_submission.py -test/test_group.py -test/test_group_api.py -test/test_group_details.py -test/test_group_type.py -test/test_license_mode.py -test/test_license_sources.py -test/test_lms_name.py -test/test_lti_credentials.py -test/test_lti_credentials_creation.py -test/test_media_attachment.py -test/test_media_score_sharing_mode.py -test/test_microsoft_graph_assignment.py -test/test_microsoft_graph_submission.py -test/test_organization_api.py -test/test_organization_invitation.py -test/test_organization_invitation_creation.py -test/test_organization_roles.py -test/test_organization_user_access_token_creation.py -test/test_resource_collaborator.py -test/test_resource_collaborator_creation.py -test/test_resource_rights.py -test/test_score_api.py -test/test_score_comment.py -test/test_score_comment_context.py -test/test_score_comment_creation.py -test/test_score_comment_moderation.py -test/test_score_comment_update.py -test/test_score_comments_counts.py -test/test_score_creation.py -test/test_score_creation_builder_data.py -test/test_score_creation_builder_data_layout_data.py -test/test_score_creation_builder_data_score_data.py -test/test_score_creation_builder_data_score_data_instruments_inner.py -test/test_score_creation_type.py -test/test_score_details.py -test/test_score_fork.py -test/test_score_license.py -test/test_score_likes_counts.py -test/test_score_modification.py -test/test_score_plays_counts.py -test/test_score_privacy.py -test/test_score_revision.py -test/test_score_revision_creation.py -test/test_score_revision_statistics.py -test/test_score_source.py -test/test_score_track.py -test/test_score_track_creation.py -test/test_score_track_point.py -test/test_score_track_purpose.py -test/test_score_track_state.py -test/test_score_track_type.py -test/test_score_track_update.py -test/test_score_views_counts.py -test/test_task.py -test/test_task_api.py -test/test_task_export_options.py -test/test_task_progress.py -test/test_task_result.py -test/test_tutteo_product.py -test/test_user_admin_update.py -test/test_user_api.py -test/test_user_azure_details.py -test/test_user_community_profile_links.py -test/test_user_creation.py -test/test_user_details.py -test/test_user_details_admin.py -test/test_user_details_admin_license.py -test/test_user_public.py -test/test_user_public_summary.py -test/test_user_signin_link.py -test/test_user_signin_link_creation.py -tox.ini +flat_api/test/__init__.py +flat_api/test/test_account_api.py +flat_api/test/test_add_group_user200_response.py +flat_api/test/test_add_group_user_request.py +flat_api/test/test_api_access_token.py +flat_api/test/test_app_scopes.py +flat_api/test/test_assignment.py +flat_api/test/test_assignment_capabilities.py +flat_api/test/test_assignment_capabilities_can_publish_in_class_error.py +flat_api/test/test_assignment_copy.py +flat_api/test/test_assignment_copy_response.py +flat_api/test/test_assignment_copy_to_class.py +flat_api/test/test_assignment_copy_to_resource_library.py +flat_api/test/test_assignment_group.py +flat_api/test/test_assignment_submission.py +flat_api/test/test_assignment_submission_comment.py +flat_api/test/test_assignment_submission_comment_creation.py +flat_api/test/test_assignment_submission_comments.py +flat_api/test/test_assignment_submission_history.py +flat_api/test/test_assignment_submission_history_attachment.py +flat_api/test/test_assignment_submission_history_state.py +flat_api/test/test_assignment_submission_lti.py +flat_api/test/test_assignment_submission_playback.py +flat_api/test/test_assignment_submission_state.py +flat_api/test/test_assignment_submission_students_mode.py +flat_api/test/test_assignment_submission_update.py +flat_api/test/test_assignment_type.py +flat_api/test/test_assignment_update.py +flat_api/test/test_class_api.py +flat_api/test/test_class_assignment.py +flat_api/test/test_class_assignment_all_of_canvas.py +flat_api/test/test_class_assignment_all_of_lti.py +flat_api/test/test_class_assignment_all_of_mfc.py +flat_api/test/test_class_assignment_update.py +flat_api/test/test_class_assignment_update_all_of_google_classroom.py +flat_api/test/test_class_assignment_update_all_of_microsoft_graph.py +flat_api/test/test_class_attachment_creation.py +flat_api/test/test_class_creation.py +flat_api/test/test_class_details.py +flat_api/test/test_class_details_canvas.py +flat_api/test/test_class_details_clever.py +flat_api/test/test_class_details_google_classroom.py +flat_api/test/test_class_details_google_drive.py +flat_api/test/test_class_details_issues.py +flat_api/test/test_class_details_issues_sync_inner.py +flat_api/test/test_class_details_lti.py +flat_api/test/test_class_details_mfc.py +flat_api/test/test_class_details_microsoft_graph.py +flat_api/test/test_class_grade_level.py +flat_api/test/test_class_roles.py +flat_api/test/test_class_state.py +flat_api/test/test_class_update.py +flat_api/test/test_collection.py +flat_api/test/test_collection_api.py +flat_api/test/test_collection_app.py +flat_api/test/test_collection_capabilities.py +flat_api/test/test_collection_contents.py +flat_api/test/test_collection_creation.py +flat_api/test/test_collection_modification.py +flat_api/test/test_collection_privacy.py +flat_api/test/test_collection_type.py +flat_api/test/test_create_lti_configuration200_response.py +flat_api/test/test_credit_transaction.py +flat_api/test/test_edu_library.py +flat_api/test/test_edu_resource.py +flat_api/test/test_edu_resource_assignment_creation.py +flat_api/test/test_edu_resource_capabilities.py +flat_api/test/test_edu_resource_copy.py +flat_api/test/test_edu_resource_creation.py +flat_api/test/test_edu_resource_folder.py +flat_api/test/test_edu_resource_lti_link.py +flat_api/test/test_edu_resource_move.py +flat_api/test/test_edu_resource_privacy.py +flat_api/test/test_edu_resource_resource.py +flat_api/test/test_edu_resource_type.py +flat_api/test/test_edu_resource_update.py +flat_api/test/test_edu_resource_use_in_class.py +flat_api/test/test_edu_resources_api.py +flat_api/test/test_flat_error_response.py +flat_api/test/test_google_classroom_coursework.py +flat_api/test/test_google_classroom_submission.py +flat_api/test/test_grade.py +flat_api/test/test_group.py +flat_api/test/test_group_api.py +flat_api/test/test_group_creation.py +flat_api/test/test_group_details.py +flat_api/test/test_group_type.py +flat_api/test/test_license_mode.py +flat_api/test/test_license_sources.py +flat_api/test/test_lms_name.py +flat_api/test/test_lti_configuration.py +flat_api/test/test_lti_configuration1p1.py +flat_api/test/test_lti_configuration1p1_all_of_tool.py +flat_api/test/test_lti_configuration1p3.py +flat_api/test/test_lti_configuration1p3_base.py +flat_api/test/test_lti_configuration1p3_base_supported_services.py +flat_api/test/test_lti_configuration1p3_base_supported_services_ags.py +flat_api/test/test_lti_configuration1p3_base_supported_services_deep_linking.py +flat_api/test/test_lti_configuration1p3_base_supported_services_nrps.py +flat_api/test/test_lti_configuration1p3_base_tool.py +flat_api/test/test_lti_configuration1p3_deployment.py +flat_api/test/test_lti_configuration1p3_dynamic.py +flat_api/test/test_lti_configuration1p3_manual.py +flat_api/test/test_lti_configuration_base.py +flat_api/test/test_lti_configuration_create.py +flat_api/test/test_lti_configuration_create1p1.py +flat_api/test/test_lti_configuration_create1p3_deployment.py +flat_api/test/test_lti_configuration_create1p3_dynamic.py +flat_api/test/test_lti_configuration_create1p3_dynamic_platform_info.py +flat_api/test/test_lti_configuration_create1p3_manual.py +flat_api/test/test_lti_configuration_update.py +flat_api/test/test_lti_configuration_update_deployment.py +flat_api/test/test_lti_configuration_update_standalone.py +flat_api/test/test_lti_credentials.py +flat_api/test/test_lti_credentials_creation.py +flat_api/test/test_media_attachment.py +flat_api/test/test_media_score_sharing_mode.py +flat_api/test/test_microsoft_graph_assignment.py +flat_api/test/test_microsoft_graph_submission.py +flat_api/test/test_omr_api.py +flat_api/test/test_omr_capabilities.py +flat_api/test/test_omr_details_step_data.py +flat_api/test/test_omr_details_submission.py +flat_api/test/test_omr_detected_instrument.py +flat_api/test/test_omr_imported_metadata.py +flat_api/test/test_omr_instrument_override.py +flat_api/test/test_omr_job.py +flat_api/test/test_omr_job_creation.py +flat_api/test/test_omr_job_file_metadata.py +flat_api/test/test_omr_job_file_upload.py +flat_api/test/test_omr_job_file_upload_result.py +flat_api/test/test_omr_job_input_file.py +flat_api/test/test_omr_job_output.py +flat_api/test/test_omr_job_progress.py +flat_api/test/test_omr_job_result.py +flat_api/test/test_omr_job_retention.py +flat_api/test/test_omr_job_status.py +flat_api/test/test_omr_locale_details.py +flat_api/test/test_omr_pending_step.py +flat_api/test/test_omr_step_name.py +flat_api/test/test_organization_api.py +flat_api/test/test_organization_invitation.py +flat_api/test/test_organization_invitation_creation.py +flat_api/test/test_organization_roles.py +flat_api/test/test_organization_user_access_token_creation.py +flat_api/test/test_rename_group_request.py +flat_api/test/test_resource_collaborator.py +flat_api/test/test_resource_collaborator_creation.py +flat_api/test/test_resource_rights.py +flat_api/test/test_score_api.py +flat_api/test/test_score_comment.py +flat_api/test/test_score_comment_context.py +flat_api/test/test_score_comment_creation.py +flat_api/test/test_score_comment_moderation.py +flat_api/test/test_score_comment_update.py +flat_api/test/test_score_comments_counts.py +flat_api/test/test_score_creation.py +flat_api/test/test_score_creation_builder_data.py +flat_api/test/test_score_creation_builder_data_all_of_builder_data.py +flat_api/test/test_score_creation_builder_data_all_of_builder_data_layout_data.py +flat_api/test/test_score_creation_builder_data_all_of_builder_data_score_data.py +flat_api/test/test_score_creation_builder_data_all_of_builder_data_score_data_instruments.py +flat_api/test/test_score_creation_common.py +flat_api/test/test_score_creation_file_import.py +flat_api/test/test_score_creation_google_drive_import.py +flat_api/test/test_score_creation_type.py +flat_api/test/test_score_details.py +flat_api/test/test_score_details_all_of_me.py +flat_api/test/test_score_fork.py +flat_api/test/test_score_license.py +flat_api/test/test_score_likes_counts.py +flat_api/test/test_score_modification.py +flat_api/test/test_score_plays_counts.py +flat_api/test/test_score_privacy.py +flat_api/test/test_score_revision.py +flat_api/test/test_score_revision_creation.py +flat_api/test/test_score_revision_statistics.py +flat_api/test/test_score_source.py +flat_api/test/test_score_summary.py +flat_api/test/test_score_track.py +flat_api/test/test_score_track_creation.py +flat_api/test/test_score_track_creation_response.py +flat_api/test/test_score_track_point.py +flat_api/test/test_score_track_purpose.py +flat_api/test/test_score_track_state.py +flat_api/test/test_score_track_type.py +flat_api/test/test_score_track_update.py +flat_api/test/test_score_views_counts.py +flat_api/test/test_task.py +flat_api/test/test_task_api.py +flat_api/test/test_task_export_options.py +flat_api/test/test_task_progress.py +flat_api/test/test_task_result.py +flat_api/test/test_teaching_theme.py +flat_api/test/test_tutteo_product.py +flat_api/test/test_user_admin_update.py +flat_api/test/test_user_api.py +flat_api/test/test_user_azure_details.py +flat_api/test/test_user_basics.py +flat_api/test/test_user_community_profile_links.py +flat_api/test/test_user_creation.py +flat_api/test/test_user_details.py +flat_api/test/test_user_details_admin.py +flat_api/test/test_user_details_admin_all_of_license.py +flat_api/test/test_user_public.py +flat_api/test/test_user_public_summary.py +flat_api/test/test_user_signin_link.py +flat_api/test/test_user_signin_link_creation.py +flat_api_README.md diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 8b23b8d..0783219 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -7.3.0 \ No newline at end of file +7.24.0 diff --git a/.sdkgen.yaml b/.sdkgen.yaml new file mode 100644 index 0000000..577e278 --- /dev/null +++ b/.sdkgen.yaml @@ -0,0 +1,36 @@ +schema_version: 1 + +language: python +package_name: flat-api +registry: pypi + +generator: + name: python + version: 7.24.0 + config: tools/openapi-config.json + # The generator emits sync OR async, never both (T001 spike). The async pass is merged into the + # same package by tools/patches/ so the SDK exposes FlatClient and AsyncFlatClient. + extra_passes: + - name: python + config: tools/openapi-config-async.json + +generated_paths: + - flat_api/** + - docs/reference/** + - .openapi-generator/** + - OPERATIONS.json + +version_file: + path: flat_api/__init__.py + pattern: '__version__ = "(?P[0-9]+\.[0-9]+\.[0-9]+)"' + +runtime_matrix: + - version: '3.11' + upstream_eol: 2027-10-31 + - version: '3.12' + upstream_eol: 2028-10-31 + - version: '3.13' + upstream_eol: 2029-10-31 + +smoke: + entrypoint: tools/smoke.py diff --git a/MIGRATION.md b/MIGRATION.md new file mode 100644 index 0000000..6f79d0b --- /dev/null +++ b/MIGRATION.md @@ -0,0 +1,45 @@ +# Migrating to 2.0.0 + +Version 2.0.0 is a full regeneration of this client against the current Flat API. The previous +release line (1.1.x) was generated in 2024 or earlier and is missing everything the API has +shipped since. + +The previous major stays installable and is deprecated on PyPI, not withdrawn. Nothing breaks +until you choose to upgrade. + +## Why upgrade + +- **Complete API coverage.** All 119 public operations, verified automatically on every release. + The old client predates a great deal of the API, including OMR. +- **It stays current.** Releases are now automatic, tied to specification releases. +- **Typed errors, retries, pagination and OAuth refresh**, none of which the old client had. +- **Modern runtimes and full type information.** + +## What breaks + +1. **Package layout changed.** Import from the package root rather than reaching into internals. +2. **Errors are typed.** Code that inspected status codes or parsed message strings should branch on + the error class instead. Note that rate limiting is HTTP 403, not 429. +3. **Supported runtimes moved up** to Python 3.11, 3.12 and 3.13. End-of-life runtimes are no longer supported. +4. **Manual pagination is unnecessary.** Hand-rolled cursor loops still work, but the built-in + iterator is correct in cases hand-rolled loops usually miss. +5. **Model names follow the specification.** A few renames follow schema names upstream. + +## How to upgrade + +1. Raise your runtime to a supported version. +2. Bump the dependency: `pip install flat-api`. +3. Replace status-code checks with typed error handling. +4. Replace manual paging loops with the built-in iterator. +5. Run your tests. Anything unresolved is likely a model rename; check + [the reference](docs/reference/). + +## Staying on 1.1.x + +It keeps working and stays installable. It will not receive new API capability, and it is not +regenerated when the API changes. If you need something added to the API after early 2024, you need +2.0.0. + +## Problems + +Open an issue on this repository, or email developers@flat.io. diff --git a/OPERATIONS.json b/OPERATIONS.json new file mode 100644 index 0000000..5e16041 --- /dev/null +++ b/OPERATIONS.json @@ -0,0 +1,1218 @@ +{ + "schema_version": 1, + "spec_version": "2.26.0", + "generator": { + "name": "python", + "version": "7.24.0" + }, + "operations": [ + { + "operation_id": "activateClass", + "method": "post", + "path": "/classes/{class}/activate", + "symbol": "class_api.activate_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "addClassUser", + "method": "put", + "path": "/classes/{class}/users/{user}", + "symbol": "class_api.add_class_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "addGroupUser", + "method": "post", + "path": "/groups/{group}/users", + "symbol": "group_api.add_group_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "addOmrJobFile", + "method": "post", + "path": "/omr/jobs/{job}/files", + "symbol": "omr_api.add_omr_job_file", + "paginated": false, + "documented": true + }, + { + "operation_id": "addScoreCollaborator", + "method": "post", + "path": "/scores/{score}/collaborators", + "symbol": "score_api.add_score_collaborator", + "paginated": false, + "documented": true + }, + { + "operation_id": "addScoreToCollection", + "method": "put", + "path": "/collections/{collection}/scores/{score}", + "symbol": "collection_api.add_score_to_collection", + "paginated": false, + "documented": true + }, + { + "operation_id": "addScoreTrack", + "method": "post", + "path": "/scores/{score}/tracks", + "symbol": "score_api.add_score_track", + "paginated": false, + "documented": true + }, + { + "operation_id": "archiveAssignment", + "method": "post", + "path": "/classes/{class}/assignments/{assignment}/archive", + "symbol": "class_api.archive_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "archiveClass", + "method": "post", + "path": "/classes/{class}/archive", + "symbol": "class_api.archive_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "cancelOmrJob", + "method": "post", + "path": "/omr/jobs/{job}/cancel", + "symbol": "omr_api.cancel_omr_job", + "paginated": false, + "documented": true + }, + { + "operation_id": "copyAssignment", + "method": "post", + "path": "/classes/{class}/assignments/{assignment}/copy", + "symbol": "class_api.copy_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "copyEduResource", + "method": "post", + "path": "/eduResources/{resource}/copy", + "symbol": "edu_resources_api.copy_edu_resource", + "paginated": false, + "documented": true + }, + { + "operation_id": "copyEduResourceToDemoClass", + "method": "post", + "path": "/eduResources/{resource}/copyToDemoClass", + "symbol": "edu_resources_api.copy_edu_resource_to_demo_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "countOrgaUsers", + "method": "get", + "path": "/organizations/users/count", + "symbol": "organization_api.count_orga_users", + "paginated": false, + "documented": true + }, + { + "operation_id": "createClass", + "method": "post", + "path": "/classes", + "symbol": "class_api.create_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "createClassAssignment", + "method": "post", + "path": "/classes/{class}/assignments", + "symbol": "class_api.create_class_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "createCollection", + "method": "post", + "path": "/collections", + "symbol": "collection_api.create_collection", + "paginated": false, + "documented": true + }, + { + "operation_id": "createEduResource", + "method": "post", + "path": "/eduResources", + "symbol": "edu_resources_api.create_edu_resource", + "paginated": false, + "documented": true + }, + { + "operation_id": "createEduResourceLtiLink", + "method": "post", + "path": "/eduResources/{resource}/createLtiLink", + "symbol": "edu_resources_api.create_edu_resource_lti_link", + "paginated": false, + "documented": true + }, + { + "operation_id": "createExportTask", + "method": "post", + "path": "/scores/{score}/revisions/{revision}/{format}/task", + "symbol": "score_api.create_export_task", + "paginated": false, + "documented": true + }, + { + "operation_id": "createGroup", + "method": "post", + "path": "/groups", + "symbol": "group_api.create_group", + "paginated": false, + "documented": true + }, + { + "operation_id": "createLtiConfiguration", + "method": "post", + "path": "/organizations/lti/configurations", + "symbol": "organization_api.create_lti_configuration", + "paginated": false, + "documented": true + }, + { + "operation_id": "createLtiCredentials", + "method": "post", + "path": "/organizations/lti/credentials", + "symbol": "organization_api.create_lti_credentials", + "paginated": false, + "documented": true + }, + { + "operation_id": "createOmrJob", + "method": "post", + "path": "/omr/jobs", + "symbol": "omr_api.create_omr_job", + "paginated": false, + "documented": true + }, + { + "operation_id": "createOrganizationInvitation", + "method": "post", + "path": "/organizations/invitations", + "symbol": "organization_api.create_organization_invitation", + "paginated": false, + "documented": true + }, + { + "operation_id": "createOrganizationUser", + "method": "post", + "path": "/organizations/users", + "symbol": "organization_api.create_organization_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "createOrganizationUserAccessToken", + "method": "post", + "path": "/organizations/users/{user}/accessToken", + "symbol": "organization_api.create_organization_user_access_token", + "paginated": false, + "documented": true + }, + { + "operation_id": "createOrganizationUserSigninLink", + "method": "post", + "path": "/organizations/users/{user}/signinLink", + "symbol": "organization_api.create_organization_user_signin_link", + "paginated": false, + "documented": true + }, + { + "operation_id": "createScore", + "method": "post", + "path": "/scores", + "symbol": "score_api.create_score", + "paginated": false, + "documented": true + }, + { + "operation_id": "createScoreRevision", + "method": "post", + "path": "/scores/{score}/revisions", + "symbol": "score_api.create_score_revision", + "paginated": false, + "documented": true + }, + { + "operation_id": "createSubmission", + "method": "put", + "path": "/classes/{class}/assignments/{assignment}/submissions", + "symbol": "class_api.create_submission", + "paginated": false, + "documented": true + }, + { + "operation_id": "createTestStudentAccount", + "method": "post", + "path": "/classes/{class}/testStudent", + "symbol": "class_api.create_test_student_account", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteAssignment", + "method": "delete", + "path": "/classes/{class}/assignments/{assignment}", + "symbol": "class_api.delete_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteClassUser", + "method": "delete", + "path": "/classes/{class}/users/{user}", + "symbol": "class_api.delete_class_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteCollection", + "method": "delete", + "path": "/collections/{collection}", + "symbol": "collection_api.delete_collection", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteEduResource", + "method": "delete", + "path": "/eduResources/{resource}", + "symbol": "edu_resources_api.delete_edu_resource", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteGroup", + "method": "delete", + "path": "/groups/{group}", + "symbol": "group_api.delete_group", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteLtiConfiguration", + "method": "delete", + "path": "/organizations/lti/configurations/{configuration}", + "symbol": "organization_api.delete_lti_configuration", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteOmrJob", + "method": "delete", + "path": "/omr/jobs/{job}", + "symbol": "omr_api.delete_omr_job", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteScore", + "method": "delete", + "path": "/scores/{score}", + "symbol": "score_api.delete_score", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteScoreComment", + "method": "delete", + "path": "/scores/{score}/comments/{comment}", + "symbol": "score_api.delete_score_comment", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteScoreFromCollection", + "method": "delete", + "path": "/collections/{collection}/scores/{score}", + "symbol": "collection_api.delete_score_from_collection", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteScoreTrack", + "method": "delete", + "path": "/scores/{score}/tracks/{track}", + "symbol": "score_api.delete_score_track", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteSubmission", + "method": "delete", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}", + "symbol": "class_api.delete_submission", + "paginated": false, + "documented": true + }, + { + "operation_id": "deleteSubmissionComment", + "method": "delete", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}", + "symbol": "class_api.delete_submission_comment", + "paginated": false, + "documented": true + }, + { + "operation_id": "editCollection", + "method": "put", + "path": "/collections/{collection}", + "symbol": "collection_api.edit_collection", + "paginated": false, + "documented": true + }, + { + "operation_id": "editScore", + "method": "put", + "path": "/scores/{score}", + "symbol": "score_api.edit_score", + "paginated": false, + "documented": true + }, + { + "operation_id": "editSubmission", + "method": "put", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}", + "symbol": "class_api.edit_submission", + "paginated": false, + "documented": true + }, + { + "operation_id": "enrollClass", + "method": "post", + "path": "/classes/enroll/{enrollmentCode}", + "symbol": "class_api.enroll_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "exportSubmissionsReviewsAsCsv", + "method": "get", + "path": "/classes/{class}/assignments/{assignment}/submissions/csv", + "symbol": "class_api.export_submissions_reviews_as_csv", + "paginated": false, + "documented": true + }, + { + "operation_id": "exportSubmissionsReviewsAsExcel", + "method": "get", + "path": "/classes/{class}/assignments/{assignment}/submissions/excel", + "symbol": "class_api.export_submissions_reviews_as_excel", + "paginated": false, + "documented": true + }, + { + "operation_id": "forkScore", + "method": "post", + "path": "/scores/{score}/fork", + "symbol": "score_api.fork_score", + "paginated": false, + "documented": true + }, + { + "operation_id": "getAssignment", + "method": "get", + "path": "/classes/{class}/assignments/{assignment}", + "symbol": "class_api.get_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "getAuthenticatedUser", + "method": "get", + "path": "/me", + "symbol": "account_api.get_authenticated_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "getClass", + "method": "get", + "path": "/classes/{class}", + "symbol": "class_api.get_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "getCollection", + "method": "get", + "path": "/collections/{collection}", + "symbol": "collection_api.get_collection", + "paginated": false, + "documented": true + }, + { + "operation_id": "getEduResource", + "method": "get", + "path": "/eduResources/{resource}", + "symbol": "edu_resources_api.get_edu_resource", + "paginated": false, + "documented": true + }, + { + "operation_id": "getGroupDetails", + "method": "get", + "path": "/groups/{group}", + "symbol": "group_api.get_group_details", + "paginated": false, + "documented": true + }, + { + "operation_id": "getGroupScores", + "method": "get", + "path": "/groups/{group}/scores", + "symbol": "score_api.get_group_scores", + "paginated": false, + "documented": true + }, + { + "operation_id": "getOmrCapabilities", + "method": "get", + "path": "/omr/capabilities", + "symbol": "omr_api.get_omr_capabilities", + "paginated": false, + "documented": true + }, + { + "operation_id": "getOmrJob", + "method": "get", + "path": "/omr/jobs/{job}", + "symbol": "omr_api.get_omr_job", + "paginated": false, + "documented": true + }, + { + "operation_id": "getOmrJobExport", + "method": "get", + "path": "/omr/jobs/{job}/exports/{format}", + "symbol": "omr_api.get_omr_job_export", + "paginated": false, + "documented": true + }, + { + "operation_id": "getOmrJobFile", + "method": "get", + "path": "/omr/jobs/{job}/files/{index}", + "symbol": "omr_api.get_omr_job_file", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScore", + "method": "get", + "path": "/scores/{score}", + "symbol": "score_api.get_score", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreCollaborator", + "method": "get", + "path": "/scores/{score}/collaborators/{collaborator}", + "symbol": "score_api.get_score_collaborator", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreCollaborators", + "method": "get", + "path": "/scores/{score}/collaborators", + "symbol": "score_api.get_score_collaborators", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreComments", + "method": "get", + "path": "/scores/{score}/comments", + "symbol": "score_api.get_score_comments", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreRevision", + "method": "get", + "path": "/scores/{score}/revisions/{revision}", + "symbol": "score_api.get_score_revision", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreRevisionData", + "method": "get", + "path": "/scores/{score}/revisions/{revision}/{format}", + "symbol": "score_api.get_score_revision_data", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreRevisions", + "method": "get", + "path": "/scores/{score}/revisions", + "symbol": "score_api.get_score_revisions", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreSubmissions", + "method": "get", + "path": "/scores/{score}/submissions", + "symbol": "score_api.get_score_submissions", + "paginated": false, + "documented": true + }, + { + "operation_id": "getScoreTrack", + "method": "get", + "path": "/scores/{score}/tracks/{track}", + "symbol": "score_api.get_score_track", + "paginated": false, + "documented": true + }, + { + "operation_id": "getSubmission", + "method": "get", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}", + "symbol": "class_api.get_submission", + "paginated": false, + "documented": true + }, + { + "operation_id": "getSubmissionComments", + "method": "get", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}/comments", + "symbol": "class_api.get_submission_comments", + "paginated": false, + "documented": true + }, + { + "operation_id": "getSubmissionHistory", + "method": "get", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}/history", + "symbol": "class_api.get_submission_history", + "paginated": false, + "documented": true + }, + { + "operation_id": "getSubmissions", + "method": "get", + "path": "/classes/{class}/assignments/{assignment}/submissions", + "symbol": "class_api.get_submissions", + "paginated": false, + "documented": true + }, + { + "operation_id": "getTask", + "method": "get", + "path": "/tasks/{task}", + "symbol": "task_api.get_task", + "paginated": false, + "documented": true + }, + { + "operation_id": "getUser", + "method": "get", + "path": "/users/{user}", + "symbol": "user_api.get_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "getUserLikes", + "method": "get", + "path": "/users/{user}/likes", + "symbol": "user_api.get_user_likes", + "paginated": true, + "documented": true + }, + { + "operation_id": "getUserScores", + "method": "get", + "path": "/users/{user}/scores", + "symbol": "user_api.get_user_scores", + "paginated": true, + "documented": true + }, + { + "operation_id": "listAssignments", + "method": "get", + "path": "/classes/{class}/assignments", + "symbol": "class_api.list_assignments", + "paginated": false, + "documented": true + }, + { + "operation_id": "listBillingCreditsHistory", + "method": "get", + "path": "/billing/credits/history", + "symbol": "omr_api.list_billing_credits_history", + "paginated": true, + "documented": true + }, + { + "operation_id": "listClassStudentSubmissions", + "method": "get", + "path": "/classes/{class}/students/{user}/submissions", + "symbol": "class_api.list_class_student_submissions", + "paginated": false, + "documented": true + }, + { + "operation_id": "listClasses", + "method": "get", + "path": "/classes", + "symbol": "class_api.list_classes", + "paginated": false, + "documented": true + }, + { + "operation_id": "listCollectionScores", + "method": "get", + "path": "/collections/{collection}/scores", + "symbol": "collection_api.list_collection_scores", + "paginated": true, + "documented": true + }, + { + "operation_id": "listCollections", + "method": "get", + "path": "/collections", + "symbol": "collection_api.list_collections", + "paginated": true, + "documented": true + }, + { + "operation_id": "listEduLibraries", + "method": "get", + "path": "/eduResources/libraries", + "symbol": "edu_resources_api.list_edu_libraries", + "paginated": false, + "documented": true + }, + { + "operation_id": "listEduResources", + "method": "get", + "path": "/eduResources", + "symbol": "edu_resources_api.list_edu_resources", + "paginated": true, + "documented": true + }, + { + "operation_id": "listGroupUsers", + "method": "get", + "path": "/groups/{group}/users", + "symbol": "group_api.list_group_users", + "paginated": false, + "documented": true + }, + { + "operation_id": "listGroups", + "method": "get", + "path": "/groups", + "symbol": "group_api.list_groups", + "paginated": false, + "documented": false + }, + { + "operation_id": "listLtiConfigurations", + "method": "get", + "path": "/organizations/lti/configurations", + "symbol": "organization_api.list_lti_configurations", + "paginated": false, + "documented": true + }, + { + "operation_id": "listLtiCredentials", + "method": "get", + "path": "/organizations/lti/credentials", + "symbol": "organization_api.list_lti_credentials", + "paginated": false, + "documented": true + }, + { + "operation_id": "listOmrJobs", + "method": "get", + "path": "/omr/jobs", + "symbol": "omr_api.list_omr_jobs", + "paginated": true, + "documented": true + }, + { + "operation_id": "listOrganizationInvitations", + "method": "get", + "path": "/organizations/invitations", + "symbol": "organization_api.list_organization_invitations", + "paginated": true, + "documented": true + }, + { + "operation_id": "listOrganizationUsers", + "method": "get", + "path": "/organizations/users", + "symbol": "organization_api.list_organization_users", + "paginated": true, + "documented": true + }, + { + "operation_id": "listScoreTracks", + "method": "get", + "path": "/scores/{score}/tracks", + "symbol": "score_api.list_score_tracks", + "paginated": false, + "documented": true + }, + { + "operation_id": "markScoreCommentResolved", + "method": "put", + "path": "/scores/{score}/comments/{comment}/resolved", + "symbol": "score_api.mark_score_comment_resolved", + "paginated": false, + "documented": true + }, + { + "operation_id": "markScoreCommentUnresolved", + "method": "delete", + "path": "/scores/{score}/comments/{comment}/resolved", + "symbol": "score_api.mark_score_comment_unresolved", + "paginated": false, + "documented": true + }, + { + "operation_id": "moveEduResource", + "method": "post", + "path": "/eduResources/{resource}/move", + "symbol": "edu_resources_api.move_edu_resource", + "paginated": false, + "documented": true + }, + { + "operation_id": "postScoreComment", + "method": "post", + "path": "/scores/{score}/comments", + "symbol": "score_api.post_score_comment", + "paginated": false, + "documented": true + }, + { + "operation_id": "postSubmissionComment", + "method": "post", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}/comments", + "symbol": "class_api.post_submission_comment", + "paginated": false, + "documented": true + }, + { + "operation_id": "removeGroupUser", + "method": "delete", + "path": "/groups/{group}/users/{user}", + "symbol": "group_api.remove_group_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "removeOrganizationInvitation", + "method": "delete", + "path": "/organizations/invitations/{invitation}", + "symbol": "organization_api.remove_organization_invitation", + "paginated": false, + "documented": true + }, + { + "operation_id": "removeOrganizationUser", + "method": "delete", + "path": "/organizations/users/{user}", + "symbol": "organization_api.remove_organization_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "removeScoreCollaborator", + "method": "delete", + "path": "/scores/{score}/collaborators/{collaborator}", + "symbol": "score_api.remove_score_collaborator", + "paginated": false, + "documented": true + }, + { + "operation_id": "renameGroup", + "method": "put", + "path": "/groups/{group}", + "symbol": "group_api.rename_group", + "paginated": false, + "documented": true + }, + { + "operation_id": "revokeLtiCredentials", + "method": "delete", + "path": "/organizations/lti/credentials/{credentials}", + "symbol": "organization_api.revoke_lti_credentials", + "paginated": false, + "documented": true + }, + { + "operation_id": "startOmrJob", + "method": "post", + "path": "/omr/jobs/{job}/start", + "symbol": "omr_api.start_omr_job", + "paginated": false, + "documented": true + }, + { + "operation_id": "submitOmrJobStep", + "method": "post", + "path": "/omr/jobs/{job}/steps/{step}", + "symbol": "omr_api.submit_omr_job_step", + "paginated": false, + "documented": true + }, + { + "operation_id": "unarchiveAssignment", + "method": "delete", + "path": "/classes/{class}/assignments/{assignment}/archive", + "symbol": "class_api.unarchive_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "unarchiveClass", + "method": "delete", + "path": "/classes/{class}/archive", + "symbol": "class_api.unarchive_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "untrashCollection", + "method": "post", + "path": "/collections/{collection}/untrash", + "symbol": "collection_api.untrash_collection", + "paginated": false, + "documented": true + }, + { + "operation_id": "untrashScore", + "method": "post", + "path": "/scores/{score}/untrash", + "symbol": "score_api.untrash_score", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateClass", + "method": "put", + "path": "/classes/{class}", + "symbol": "class_api.update_class", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateClassAssignment", + "method": "put", + "path": "/classes/{class}/assignments/{assignment}", + "symbol": "class_api.update_class_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateEduResource", + "method": "put", + "path": "/eduResources/{resource}", + "symbol": "edu_resources_api.update_edu_resource", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateEduResourceAssignment", + "method": "put", + "path": "/eduResources/{resource}/assignment", + "symbol": "edu_resources_api.update_edu_resource_assignment", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateLtiConfiguration", + "method": "put", + "path": "/organizations/lti/configurations/{configuration}", + "symbol": "organization_api.update_lti_configuration", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateOrganizationUser", + "method": "put", + "path": "/organizations/users/{user}", + "symbol": "organization_api.update_organization_user", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateScoreComment", + "method": "put", + "path": "/scores/{score}/comments/{comment}", + "symbol": "score_api.update_score_comment", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateScoreTrack", + "method": "put", + "path": "/scores/{score}/tracks/{track}", + "symbol": "score_api.update_score_track", + "paginated": false, + "documented": true + }, + { + "operation_id": "updateSubmissionComment", + "method": "put", + "path": "/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}", + "symbol": "class_api.update_submission_comment", + "paginated": false, + "documented": true + }, + { + "operation_id": "useEduResourceInClass", + "method": "post", + "path": "/eduResources/{resource}/useInClass", + "symbol": "edu_resources_api.use_edu_resource_in_class", + "paginated": false, + "documented": true + } + ], + "models": [ + "AddGroupUser200Response", + "AddGroupUserRequest", + "ApiAccessToken", + "AppScopes", + "Assignment", + "AssignmentCapabilities", + "AssignmentCapabilitiesCanPublishInClassError", + "AssignmentCopy", + "AssignmentCopyResponse", + "AssignmentCopyToClass", + "AssignmentCopyToResourceLibrary", + "AssignmentGroup", + "AssignmentSubmission", + "AssignmentSubmissionComment", + "AssignmentSubmissionCommentCreation", + "AssignmentSubmissionComments", + "AssignmentSubmissionHistory", + "AssignmentSubmissionHistoryAttachment", + "AssignmentSubmissionHistoryState", + "AssignmentSubmissionLti", + "AssignmentSubmissionPlayback", + "AssignmentSubmissionState", + "AssignmentSubmissionStudentsMode", + "AssignmentSubmissionUpdate", + "AssignmentType", + "AssignmentUpdate", + "ClassAssignment", + "ClassAssignmentAllOfCanvas", + "ClassAssignmentAllOfLti", + "ClassAssignmentAllOfMfc", + "ClassAssignmentUpdate", + "ClassAssignmentUpdateAllOfGoogleClassroom", + "ClassAssignmentUpdateAllOfMicrosoftGraph", + "ClassAttachmentCreation", + "ClassCreation", + "ClassDetails", + "ClassDetailsCanvas", + "ClassDetailsClever", + "ClassDetailsGoogleClassroom", + "ClassDetailsGoogleDrive", + "ClassDetailsIssues", + "ClassDetailsIssuesSyncInner", + "ClassDetailsLti", + "ClassDetailsMfc", + "ClassDetailsMicrosoftGraph", + "ClassGradeLevel", + "ClassRoles", + "ClassState", + "ClassUpdate", + "Collection", + "CollectionApp", + "CollectionCapabilities", + "CollectionContents", + "CollectionCreation", + "CollectionModification", + "CollectionPrivacy", + "CollectionType", + "CreateLtiConfiguration200Response", + "CreditTransaction", + "EduLibrary", + "EduResource", + "EduResourceAssignmentCreation", + "EduResourceCapabilities", + "EduResourceCopy", + "EduResourceCreation", + "EduResourceFolder", + "EduResourceLtiLink", + "EduResourceMove", + "EduResourcePrivacy", + "EduResourceResource", + "EduResourceType", + "EduResourceUpdate", + "EduResourceUseInClass", + "FlatErrorResponse", + "GoogleClassroomCoursework", + "GoogleClassroomSubmission", + "Grade", + "Group", + "GroupCreation", + "GroupDetails", + "GroupType", + "LicenseMode", + "LicenseSources", + "LmsName", + "LtiConfiguration", + "LtiConfiguration1p1", + "LtiConfiguration1p1AllOfTool", + "LtiConfiguration1p3", + "LtiConfiguration1p3Base", + "LtiConfiguration1p3BaseSupportedServices", + "LtiConfiguration1p3BaseSupportedServicesAgs", + "LtiConfiguration1p3BaseSupportedServicesDeepLinking", + "LtiConfiguration1p3BaseSupportedServicesNrps", + "LtiConfiguration1p3BaseTool", + "LtiConfiguration1p3Deployment", + "LtiConfiguration1p3Dynamic", + "LtiConfiguration1p3Manual", + "LtiConfigurationBase", + "LtiConfigurationCreate", + "LtiConfigurationCreate1p1", + "LtiConfigurationCreate1p3Deployment", + "LtiConfigurationCreate1p3Dynamic", + "LtiConfigurationCreate1p3DynamicPlatformInfo", + "LtiConfigurationCreate1p3Manual", + "LtiConfigurationUpdate", + "LtiConfigurationUpdateDeployment", + "LtiConfigurationUpdateStandalone", + "LtiCredentials", + "LtiCredentialsCreation", + "MediaAttachment", + "MediaScoreSharingMode", + "MicrosoftGraphAssignment", + "MicrosoftGraphSubmission", + "OmrCapabilities", + "OmrDetailsStepData", + "OmrDetailsSubmission", + "OmrDetectedInstrument", + "OmrImportedMetadata", + "OmrInstrumentOverride", + "OmrJob", + "OmrJobCreation", + "OmrJobFileMetadata", + "OmrJobFileUpload", + "OmrJobFileUploadResult", + "OmrJobInputFile", + "OmrJobOutput", + "OmrJobProgress", + "OmrJobResult", + "OmrJobRetention", + "OmrJobStatus", + "OmrLocaleDetails", + "OmrPendingStep", + "OmrStepName", + "OrganizationInvitation", + "OrganizationInvitationCreation", + "OrganizationRoles", + "OrganizationUserAccessTokenCreation", + "RenameGroupRequest", + "ResourceCollaborator", + "ResourceCollaboratorCreation", + "ResourceRights", + "ScoreComment", + "ScoreCommentContext", + "ScoreCommentCreation", + "ScoreCommentModeration", + "ScoreCommentUpdate", + "ScoreCommentsCounts", + "ScoreCreation", + "ScoreCreationBuilderData", + "ScoreCreationBuilderDataAllOfBuilderData", + "ScoreCreationBuilderDataAllOfBuilderDataLayoutData", + "ScoreCreationBuilderDataAllOfBuilderDataScoreData", + "ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments", + "ScoreCreationCommon", + "ScoreCreationFileImport", + "ScoreCreationGoogleDriveImport", + "ScoreCreationType", + "ScoreDetails", + "ScoreDetailsAllOfMe", + "ScoreFork", + "ScoreLicense", + "ScoreLikesCounts", + "ScoreModification", + "ScorePlaysCounts", + "ScorePrivacy", + "ScoreRevision", + "ScoreRevisionCreation", + "ScoreRevisionStatistics", + "ScoreSource", + "ScoreSummary", + "ScoreTrack", + "ScoreTrackCreation", + "ScoreTrackCreationResponse", + "ScoreTrackPoint", + "ScoreTrackPurpose", + "ScoreTrackState", + "ScoreTrackType", + "ScoreTrackUpdate", + "ScoreViewsCounts", + "Task", + "TaskExportOptions", + "TaskProgress", + "TaskResult", + "TeachingTheme", + "TutteoProduct", + "UserAdminUpdate", + "UserAzureDetails", + "UserBasics", + "UserCommunityProfileLinks", + "UserCreation", + "UserDetails", + "UserDetailsAdmin", + "UserDetailsAdminAllOfLicense", + "UserPublic", + "UserPublicSummary", + "UserSigninLink", + "UserSigninLinkCreation" + ], + "scopes": [ + "account.education_profile", + "account.email", + "account.public_profile", + "collections", + "collections.add_scores", + "collections.readonly", + "edu.admin", + "edu.admin.lti", + "edu.admin.lti.readonly", + "edu.admin.users", + "edu.admin.users.readonly", + "edu.assignments", + "edu.assignments.readonly", + "edu.classes", + "edu.classes.readonly", + "edu.resources", + "edu.resources.readonly", + "notifications.readonly", + "omr", + "scores", + "scores.readonly", + "scores.social", + "tasks.readonly" + ] +} diff --git a/QUICKSTART.md b/QUICKSTART.md new file mode 100644 index 0000000..c17fd46 --- /dev/null +++ b/QUICKSTART.md @@ -0,0 +1,64 @@ +# Quickstart + +From nothing to your first authenticated call. + +## 1. Get a token + +Create a [Personal Access Token](https://flat.io/developers/apps). It behaves like an OAuth access +token scoped to your own account, which is all you need to start. + +## 2. Install + +```sh +pip install flat-api +``` + +Requires Python 3.11, 3.12 and 3.13. + +## 3. Call the API + +```python +from flat_api import FlatClient + +client = FlatClient(access_token="YOUR_TOKEN") +me = client.api_client # generated APIs hang off here +``` + +If that prints your account, you are done. + +## 4. Do something useful + +List your scores. The client handles paging for you: + +```python +from flat_api import paginate + +for score in paginate(api.get_user_scores_with_http_info, user="me"): + print(score.title) +``` + +## 5. Handle failure properly + +```python +from flat_api import FlatRateLimitError, FlatNotFoundError + +try: + ... +except FlatRateLimitError as exc: + print("retry after", exc.reset) +except FlatNotFoundError: + print("no such score") +``` + +Two things worth knowing about the Flat API specifically: + +- Rate limiting returns **403**, not 429, and carries no `Retry-After`. The reset time is in + `X-RateLimit-Reset`. The client already handles this; the note matters if you disable retries. +- The error `id` is only present on internal and backend errors. When you have one, quote it to + support: it makes diagnosis much faster. + +## Where next + +- [README](README.md) for the full feature tour +- [Per-operation reference](docs/reference/) +- [API documentation](https://flat.io/developers/docs/api/) diff --git a/README.md b/README.md index 6ab684f..1f73e49 100644 --- a/README.md +++ b/README.md @@ -1,372 +1,96 @@ -# Python Client for the Flat REST API +# Flat API client for Python -[![Python package](https://github.com/FlatIO/api-client-python/actions/workflows/python.yml/badge.svg)](https://github.com/FlatIO/api-client-python/actions/workflows/python.yml) - -The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: -- Creating and importing new music scores using MusicXML or MIDI files -- Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) -- Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. - -You can find the API reference including code samples and our OpenAPI Specification at the following url: [https://flat.io/developers/api/reference](https://flat.io/developers/api/reference). - -To request some API credentials, please visit [https://flat.io/developers](https://flat.io/developers). - -## Requirements. - -Python >= 3.7 - -## Installation & Usage -### pip install +Official client for the [Flat REST API](https://flat.io/developers/docs/api/), generated from Flat's +public OpenAPI specification and kept current automatically. ```sh -pip install flat_api +pip install flat-api ``` -or install from this repository +```python +from flat_api import FlatClient -```sh -pip install git+https://github.com/FlatIO/api-client-python.git +client = FlatClient(access_token="YOUR_TOKEN") +me = client.api_client # generated APIs hang off here ``` -Then import the package: -```python -import flat_api -``` +Get a token in seconds with a [Personal Access Token](https://flat.io/developers/apps); it works +exactly like an OAuth access token for your own account. -### Setuptools +## What this client does for you -Install via [Setuptools](http://pypi.python.org/pypi/setuptools). +- **Typed errors.** Branch on the error, not the status code. Flat returns HTTP 403 for both rate + limiting and authorization failures, so status alone cannot tell them apart. +- **Automatic retries.** Rate limits and server errors are retried with backoff. Flat sends no + `Retry-After`, so the client reads `X-RateLimit-Reset` instead. +- **Automatic pagination.** Eight collection endpoints are cursor-paginated with the cursor in a + `Link` header. You get an iterator; you never touch a cursor. +- **OAuth2 built in.** Authorization URLs, code exchange and transparent token refresh. +- **Full type information**, so your editor and your coding assistant both know the API. -```sh -python setup.py install --user -``` -(or `sudo python setup.py install` to install the package for all users) +### Pagination -Then import the package: ```python -import flat_api -``` +from flat_api import paginate -## Getting Started +for score in paginate(api.get_user_scores_with_http_info, user="me"): + print(score.title) +``` -Please follow the [installation procedure](#installation--usage) and then run the following: +### Errors ```python -from pprint import pprint -import flat_api -from flat_api.api import account_api - -configuration = flat_api.Configuration( - access_token = 'YOUR_ACCESS_TOKEN' -) - -# Enter a context with an instance of the API client -with flat_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = account_api.AccountApi(api_client) - - try: - # Get current user account - api_response = api_instance.get_authenticated_user() - pprint(api_response) - except flat_api.ApiException as e: - print("Exception when calling AccountApi->get_authenticated_user: %s\n" % e) +from flat_api import FlatRateLimitError, FlatNotFoundError + +try: + ... +except FlatRateLimitError as exc: + print("retry after", exc.reset) +except FlatNotFoundError: + print("no such score") ``` -## Documentation for API Endpoints - -All URIs are relative to *https://api.flat.io/v2* +### Asynchronous use -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -*AccountApi* | [**get_authenticated_user**](docs/AccountApi.md#get_authenticated_user) | **GET** /me | Get current user account -*ClassApi* | [**activate_class**](docs/ClassApi.md#activate_class) | **POST** /classes/{class}/activate | Activate the class -*ClassApi* | [**add_class_user**](docs/ClassApi.md#add_class_user) | **PUT** /classes/{class}/users/{user} | Add a user to the class -*ClassApi* | [**archive_assignment**](docs/ClassApi.md#archive_assignment) | **POST** /classes/{class}/assignments/{assignment}/archive | Archive the assignment -*ClassApi* | [**archive_class**](docs/ClassApi.md#archive_class) | **POST** /classes/{class}/archive | Archive the class -*ClassApi* | [**copy_assignment**](docs/ClassApi.md#copy_assignment) | **POST** /classes/{class}/assignments/{assignment}/copy | Copy an assignment -*ClassApi* | [**create_class**](docs/ClassApi.md#create_class) | **POST** /classes | Create a new class -*ClassApi* | [**create_class_assignment**](docs/ClassApi.md#create_class_assignment) | **POST** /classes/{class}/assignments | Assignment creation -*ClassApi* | [**create_submission**](docs/ClassApi.md#create_submission) | **PUT** /classes/{class}/assignments/{assignment}/submissions | Create or edit a submission -*ClassApi* | [**create_test_student_account**](docs/ClassApi.md#create_test_student_account) | **POST** /classes/{class}/testStudent | Create a test student account -*ClassApi* | [**delete_class_user**](docs/ClassApi.md#delete_class_user) | **DELETE** /classes/{class}/users/{user} | Remove a user from the class -*ClassApi* | [**delete_submission**](docs/ClassApi.md#delete_submission) | **DELETE** /classes/{class}/assignments/{assignment}/submissions/{submission} | Reset a submission -*ClassApi* | [**delete_submission_comment**](docs/ClassApi.md#delete_submission_comment) | **DELETE** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment} | Delete a feedback comment to a submission -*ClassApi* | [**edit_submission**](docs/ClassApi.md#edit_submission) | **PUT** /classes/{class}/assignments/{assignment}/submissions/{submission} | Edit a submission -*ClassApi* | [**enroll_class**](docs/ClassApi.md#enroll_class) | **POST** /classes/enroll/{enrollmentCode} | Join a class -*ClassApi* | [**export_submissions_reviews_as_csv**](docs/ClassApi.md#export_submissions_reviews_as_csv) | **GET** /classes/{class}/assignments/{assignment}/submissions/csv | CSV Grades exports -*ClassApi* | [**export_submissions_reviews_as_excel**](docs/ClassApi.md#export_submissions_reviews_as_excel) | **GET** /classes/{class}/assignments/{assignment}/submissions/excel | Excel Grades exports -*ClassApi* | [**get_class**](docs/ClassApi.md#get_class) | **GET** /classes/{class} | Get the details of a single class -*ClassApi* | [**get_score_submissions**](docs/ClassApi.md#get_score_submissions) | **GET** /scores/{score}/submissions | List submissions related to the score -*ClassApi* | [**get_submission**](docs/ClassApi.md#get_submission) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission} | Get a student submission -*ClassApi* | [**get_submission_comments**](docs/ClassApi.md#get_submission_comments) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments | List the feedback comments of a submission -*ClassApi* | [**get_submission_history**](docs/ClassApi.md#get_submission_history) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission}/history | Get the history of the submission -*ClassApi* | [**get_submissions**](docs/ClassApi.md#get_submissions) | **GET** /classes/{class}/assignments/{assignment}/submissions | List the students' submissions -*ClassApi* | [**list_assignments**](docs/ClassApi.md#list_assignments) | **GET** /classes/{class}/assignments | Assignments listing -*ClassApi* | [**list_class_student_submissions**](docs/ClassApi.md#list_class_student_submissions) | **GET** /classes/{class}/students/{user}/submissions | List the submissions for a student -*ClassApi* | [**list_classes**](docs/ClassApi.md#list_classes) | **GET** /classes | List the classes available for the current user -*ClassApi* | [**post_submission_comment**](docs/ClassApi.md#post_submission_comment) | **POST** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments | Add a feedback comment to a submission -*ClassApi* | [**unarchive_assignment**](docs/ClassApi.md#unarchive_assignment) | **DELETE** /classes/{class}/assignments/{assignment}/archive | Unarchive the assignment. -*ClassApi* | [**unarchive_class**](docs/ClassApi.md#unarchive_class) | **DELETE** /classes/{class}/archive | Unarchive the class -*ClassApi* | [**update_class**](docs/ClassApi.md#update_class) | **PUT** /classes/{class} | Update the class -*ClassApi* | [**update_submission_comment**](docs/ClassApi.md#update_submission_comment) | **PUT** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment} | Update a feedback comment to a submission -*CollectionApi* | [**add_score_to_collection**](docs/CollectionApi.md#add_score_to_collection) | **PUT** /collections/{collection}/scores/{score} | Add a score to the collection -*CollectionApi* | [**create_collection**](docs/CollectionApi.md#create_collection) | **POST** /collections | Create a new collection -*CollectionApi* | [**delete_collection**](docs/CollectionApi.md#delete_collection) | **DELETE** /collections/{collection} | Delete the collection -*CollectionApi* | [**delete_score_from_collection**](docs/CollectionApi.md#delete_score_from_collection) | **DELETE** /collections/{collection}/scores/{score} | Delete a score from the collection -*CollectionApi* | [**edit_collection**](docs/CollectionApi.md#edit_collection) | **PUT** /collections/{collection} | Update a collection's metadata -*CollectionApi* | [**get_collection**](docs/CollectionApi.md#get_collection) | **GET** /collections/{collection} | Get collection details -*CollectionApi* | [**list_collection_scores**](docs/CollectionApi.md#list_collection_scores) | **GET** /collections/{collection}/scores | List the scores contained in a collection -*CollectionApi* | [**list_collections**](docs/CollectionApi.md#list_collections) | **GET** /collections | List the collections -*CollectionApi* | [**untrash_collection**](docs/CollectionApi.md#untrash_collection) | **POST** /collections/{collection}/untrash | Untrash a collection -*EduResourcesApi* | [**copy_edu_resource**](docs/EduResourcesApi.md#copy_edu_resource) | **POST** /eduResources/{resource}/copy | Copy an education resource to a Resource Library -*EduResourcesApi* | [**copy_edu_resource_to_demo_class**](docs/EduResourcesApi.md#copy_edu_resource_to_demo_class) | **POST** /eduResources/{resource}/copyToDemoClass | Copy an education assignment to a teacher demo class -*EduResourcesApi* | [**create_edu_resource**](docs/EduResourcesApi.md#create_edu_resource) | **POST** /eduResources | Create a new education resource -*EduResourcesApi* | [**delete_edu_resource**](docs/EduResourcesApi.md#delete_edu_resource) | **DELETE** /eduResources/{resource} | Delete an education resource -*EduResourcesApi* | [**get_edu_resource**](docs/EduResourcesApi.md#get_edu_resource) | **GET** /eduResources/{resource} | Get an education resource -*EduResourcesApi* | [**list_edu_libraries**](docs/EduResourcesApi.md#list_edu_libraries) | **GET** /eduResources/libraries | List the education libraries -*EduResourcesApi* | [**list_edu_resources**](docs/EduResourcesApi.md#list_edu_resources) | **GET** /eduResources | List education resources in a library or folder -*EduResourcesApi* | [**move_edu_resource**](docs/EduResourcesApi.md#move_edu_resource) | **POST** /eduResources/{resource}/move | Move an education resource -*EduResourcesApi* | [**update_edu_resource**](docs/EduResourcesApi.md#update_edu_resource) | **PUT** /eduResources/{resource} | Update an education resource metadata -*EduResourcesApi* | [**update_edu_resource_assignment**](docs/EduResourcesApi.md#update_edu_resource_assignment) | **PUT** /eduResources/{resource}/assignment | Update an education resource assignment -*EduResourcesApi* | [**use_edu_resource_in_class**](docs/EduResourcesApi.md#use_edu_resource_in_class) | **POST** /eduResources/{resource}/useInClass | Use an education resource in a class -*GroupApi* | [**get_group_details**](docs/GroupApi.md#get_group_details) | **GET** /groups/{group} | Get group information -*GroupApi* | [**get_group_scores**](docs/GroupApi.md#get_group_scores) | **GET** /groups/{group}/scores | List group's scores -*GroupApi* | [**list_group_users**](docs/GroupApi.md#list_group_users) | **GET** /groups/{group}/users | List group's users -*OrganizationApi* | [**count_orga_users**](docs/OrganizationApi.md#count_orga_users) | **GET** /organizations/users/count | Count the organization users using the provided filters -*OrganizationApi* | [**create_lti_credentials**](docs/OrganizationApi.md#create_lti_credentials) | **POST** /organizations/lti/credentials | Create a new couple of LTI 1.x credentials -*OrganizationApi* | [**create_organization_invitation**](docs/OrganizationApi.md#create_organization_invitation) | **POST** /organizations/invitations | Create a new invitation to join the organization -*OrganizationApi* | [**create_organization_user**](docs/OrganizationApi.md#create_organization_user) | **POST** /organizations/users | Create a new user account -*OrganizationApi* | [**create_organization_user_access_token**](docs/OrganizationApi.md#create_organization_user_access_token) | **POST** /organizations/users/{user}/accessToken | Create a delegated API access token for an organization user -*OrganizationApi* | [**create_organization_user_signin_link**](docs/OrganizationApi.md#create_organization_user_signin_link) | **POST** /organizations/users/{user}/signinLink | Create a sign in link for an organization user -*OrganizationApi* | [**list_lti_credentials**](docs/OrganizationApi.md#list_lti_credentials) | **GET** /organizations/lti/credentials | List LTI 1.x credentials -*OrganizationApi* | [**list_organization_invitations**](docs/OrganizationApi.md#list_organization_invitations) | **GET** /organizations/invitations | List the organization invitations -*OrganizationApi* | [**list_organization_users**](docs/OrganizationApi.md#list_organization_users) | **GET** /organizations/users | List the organization users -*OrganizationApi* | [**remove_organization_invitation**](docs/OrganizationApi.md#remove_organization_invitation) | **DELETE** /organizations/invitations/{invitation} | Remove an organization invitation -*OrganizationApi* | [**remove_organization_user**](docs/OrganizationApi.md#remove_organization_user) | **DELETE** /organizations/users/{user} | Remove an account from Flat -*OrganizationApi* | [**revoke_lti_credentials**](docs/OrganizationApi.md#revoke_lti_credentials) | **DELETE** /organizations/lti/credentials/{credentials} | Revoke LTI 1.x credentials -*OrganizationApi* | [**update_organization_user**](docs/OrganizationApi.md#update_organization_user) | **PUT** /organizations/users/{user} | Update account information -*ScoreApi* | [**add_score_collaborator**](docs/ScoreApi.md#add_score_collaborator) | **POST** /scores/{score}/collaborators | Add a new collaborator -*ScoreApi* | [**add_score_track**](docs/ScoreApi.md#add_score_track) | **POST** /scores/{score}/tracks | Add a new video or audio track to the score -*ScoreApi* | [**create_export_task**](docs/ScoreApi.md#create_export_task) | **POST** /scores/{score}/revisions/{revision}/{format}/task | Create a new score export task -*ScoreApi* | [**create_score**](docs/ScoreApi.md#create_score) | **POST** /scores | Create a new score -*ScoreApi* | [**create_score_revision**](docs/ScoreApi.md#create_score_revision) | **POST** /scores/{score}/revisions | Create a new revision -*ScoreApi* | [**delete_score**](docs/ScoreApi.md#delete_score) | **DELETE** /scores/{score} | Delete a score -*ScoreApi* | [**delete_score_comment**](docs/ScoreApi.md#delete_score_comment) | **DELETE** /scores/{score}/comments/{comment} | Delete a comment -*ScoreApi* | [**delete_score_track**](docs/ScoreApi.md#delete_score_track) | **DELETE** /scores/{score}/tracks/{track} | Remove an audio or video track linked to the score -*ScoreApi* | [**edit_score**](docs/ScoreApi.md#edit_score) | **PUT** /scores/{score} | Edit a score's metadata -*ScoreApi* | [**fork_score**](docs/ScoreApi.md#fork_score) | **POST** /scores/{score}/fork | Fork a score -*ScoreApi* | [**ger_user_likes**](docs/ScoreApi.md#ger_user_likes) | **GET** /users/{user}/likes | List liked scores -*ScoreApi* | [**get_group_scores**](docs/ScoreApi.md#get_group_scores) | **GET** /groups/{group}/scores | List group's scores -*ScoreApi* | [**get_score**](docs/ScoreApi.md#get_score) | **GET** /scores/{score} | Get a score's metadata -*ScoreApi* | [**get_score_collaborator**](docs/ScoreApi.md#get_score_collaborator) | **GET** /scores/{score}/collaborators/{collaborator} | Get a collaborator -*ScoreApi* | [**get_score_collaborators**](docs/ScoreApi.md#get_score_collaborators) | **GET** /scores/{score}/collaborators | List the collaborators -*ScoreApi* | [**get_score_comments**](docs/ScoreApi.md#get_score_comments) | **GET** /scores/{score}/comments | List comments -*ScoreApi* | [**get_score_revision**](docs/ScoreApi.md#get_score_revision) | **GET** /scores/{score}/revisions/{revision} | Get a score revision -*ScoreApi* | [**get_score_revision_data**](docs/ScoreApi.md#get_score_revision_data) | **GET** /scores/{score}/revisions/{revision}/{format} | Get a score revision data -*ScoreApi* | [**get_score_revisions**](docs/ScoreApi.md#get_score_revisions) | **GET** /scores/{score}/revisions | List the revisions -*ScoreApi* | [**get_score_submissions**](docs/ScoreApi.md#get_score_submissions) | **GET** /scores/{score}/submissions | List submissions related to the score -*ScoreApi* | [**get_score_track**](docs/ScoreApi.md#get_score_track) | **GET** /scores/{score}/tracks/{track} | Retrieve the details of an audio or video track linked to a score -*ScoreApi* | [**get_user_scores**](docs/ScoreApi.md#get_user_scores) | **GET** /users/{user}/scores | List user's scores -*ScoreApi* | [**list_score_tracks**](docs/ScoreApi.md#list_score_tracks) | **GET** /scores/{score}/tracks | List the audio or video tracks linked to a score -*ScoreApi* | [**mark_score_comment_resolved**](docs/ScoreApi.md#mark_score_comment_resolved) | **PUT** /scores/{score}/comments/{comment}/resolved | Mark the comment as resolved -*ScoreApi* | [**mark_score_comment_unresolved**](docs/ScoreApi.md#mark_score_comment_unresolved) | **DELETE** /scores/{score}/comments/{comment}/resolved | Mark the comment as unresolved -*ScoreApi* | [**post_score_comment**](docs/ScoreApi.md#post_score_comment) | **POST** /scores/{score}/comments | Post a new comment -*ScoreApi* | [**remove_score_collaborator**](docs/ScoreApi.md#remove_score_collaborator) | **DELETE** /scores/{score}/collaborators/{collaborator} | Delete a collaborator -*ScoreApi* | [**untrash_score**](docs/ScoreApi.md#untrash_score) | **POST** /scores/{score}/untrash | Untrash a score -*ScoreApi* | [**update_score_comment**](docs/ScoreApi.md#update_score_comment) | **PUT** /scores/{score}/comments/{comment} | Update an existing comment -*ScoreApi* | [**update_score_track**](docs/ScoreApi.md#update_score_track) | **PUT** /scores/{score}/tracks/{track} | Update an audio or video track linked to a score -*TaskApi* | [**get_task**](docs/TaskApi.md#get_task) | **GET** /tasks/{task} | Get a task details -*UserApi* | [**ger_user_likes**](docs/UserApi.md#ger_user_likes) | **GET** /users/{user}/likes | List liked scores -*UserApi* | [**get_user**](docs/UserApi.md#get_user) | **GET** /users/{user} | Get a public user profile -*UserApi* | [**get_user_scores**](docs/UserApi.md#get_user_scores) | **GET** /users/{user}/scores | List user's scores +```python\nfrom flat_api import AsyncFlatClient +client = AsyncFlatClient(access_token="YOUR_TOKEN") +# every operation is awaitable\n``` -## Documentation For Models +## Supported versions - - [ApiAccessToken](docs/ApiAccessToken.md) - - [AppScopes](docs/AppScopes.md) - - [Assignment](docs/Assignment.md) - - [AssignmentCopy](docs/AssignmentCopy.md) - - [AssignmentCopyResponse](docs/AssignmentCopyResponse.md) - - [AssignmentCopyResponseCapabilities](docs/AssignmentCopyResponseCapabilities.md) - - [AssignmentCopyResponseCapabilitiesCanPublishInClassError](docs/AssignmentCopyResponseCapabilitiesCanPublishInClassError.md) - - [AssignmentSubmission](docs/AssignmentSubmission.md) - - [AssignmentSubmissionComment](docs/AssignmentSubmissionComment.md) - - [AssignmentSubmissionCommentCreation](docs/AssignmentSubmissionCommentCreation.md) - - [AssignmentSubmissionHistory](docs/AssignmentSubmissionHistory.md) - - [AssignmentSubmissionHistoryAttachment](docs/AssignmentSubmissionHistoryAttachment.md) - - [AssignmentSubmissionHistoryState](docs/AssignmentSubmissionHistoryState.md) - - [AssignmentSubmissionState](docs/AssignmentSubmissionState.md) - - [AssignmentSubmissionUpdate](docs/AssignmentSubmissionUpdate.md) - - [AssignmentSubmissionUpdateComments](docs/AssignmentSubmissionUpdateComments.md) - - [AssignmentType](docs/AssignmentType.md) - - [AssignmentUpdate](docs/AssignmentUpdate.md) - - [ClassAssignment](docs/ClassAssignment.md) - - [ClassAssignmentCanvas](docs/ClassAssignmentCanvas.md) - - [ClassAssignmentLti](docs/ClassAssignmentLti.md) - - [ClassAssignmentMfc](docs/ClassAssignmentMfc.md) - - [ClassAssignmentUpdate](docs/ClassAssignmentUpdate.md) - - [ClassAssignmentUpdateGoogleClassroom](docs/ClassAssignmentUpdateGoogleClassroom.md) - - [ClassAssignmentUpdateMicrosoftGraph](docs/ClassAssignmentUpdateMicrosoftGraph.md) - - [ClassAttachmentCreation](docs/ClassAttachmentCreation.md) - - [ClassCreation](docs/ClassCreation.md) - - [ClassDetails](docs/ClassDetails.md) - - [ClassDetailsCanvas](docs/ClassDetailsCanvas.md) - - [ClassDetailsClever](docs/ClassDetailsClever.md) - - [ClassDetailsGoogleClassroom](docs/ClassDetailsGoogleClassroom.md) - - [ClassDetailsGoogleDrive](docs/ClassDetailsGoogleDrive.md) - - [ClassDetailsIssues](docs/ClassDetailsIssues.md) - - [ClassDetailsIssuesSyncInner](docs/ClassDetailsIssuesSyncInner.md) - - [ClassDetailsLti](docs/ClassDetailsLti.md) - - [ClassDetailsMfc](docs/ClassDetailsMfc.md) - - [ClassDetailsMicrosoftGraph](docs/ClassDetailsMicrosoftGraph.md) - - [ClassGradeLevel](docs/ClassGradeLevel.md) - - [ClassRoles](docs/ClassRoles.md) - - [ClassState](docs/ClassState.md) - - [ClassUpdate](docs/ClassUpdate.md) - - [Collection](docs/Collection.md) - - [CollectionApp](docs/CollectionApp.md) - - [CollectionCapabilities](docs/CollectionCapabilities.md) - - [CollectionCreation](docs/CollectionCreation.md) - - [CollectionModification](docs/CollectionModification.md) - - [CollectionPrivacy](docs/CollectionPrivacy.md) - - [CollectionType](docs/CollectionType.md) - - [EduLibrary](docs/EduLibrary.md) - - [EduResource](docs/EduResource.md) - - [EduResourceCapabilities](docs/EduResourceCapabilities.md) - - [EduResourceCopy](docs/EduResourceCopy.md) - - [EduResourceCreation](docs/EduResourceCreation.md) - - [EduResourceMove](docs/EduResourceMove.md) - - [EduResourcePrivacy](docs/EduResourcePrivacy.md) - - [EduResourceResource](docs/EduResourceResource.md) - - [EduResourceType](docs/EduResourceType.md) - - [EduResourceUpdate](docs/EduResourceUpdate.md) - - [EduResourceUseInClass](docs/EduResourceUseInClass.md) - - [EduSkillsFocused](docs/EduSkillsFocused.md) - - [FlatErrorResponse](docs/FlatErrorResponse.md) - - [FlatLocales](docs/FlatLocales.md) - - [GoogleClassroomCoursework](docs/GoogleClassroomCoursework.md) - - [GoogleClassroomSubmission](docs/GoogleClassroomSubmission.md) - - [Group](docs/Group.md) - - [GroupDetails](docs/GroupDetails.md) - - [GroupType](docs/GroupType.md) - - [LicenseMode](docs/LicenseMode.md) - - [LicenseSources](docs/LicenseSources.md) - - [LmsName](docs/LmsName.md) - - [LtiCredentials](docs/LtiCredentials.md) - - [LtiCredentialsCreation](docs/LtiCredentialsCreation.md) - - [MediaAttachment](docs/MediaAttachment.md) - - [MediaScoreSharingMode](docs/MediaScoreSharingMode.md) - - [MicrosoftGraphAssignment](docs/MicrosoftGraphAssignment.md) - - [MicrosoftGraphSubmission](docs/MicrosoftGraphSubmission.md) - - [OrganizationInvitation](docs/OrganizationInvitation.md) - - [OrganizationInvitationCreation](docs/OrganizationInvitationCreation.md) - - [OrganizationRoles](docs/OrganizationRoles.md) - - [OrganizationUserAccessTokenCreation](docs/OrganizationUserAccessTokenCreation.md) - - [ResourceCollaborator](docs/ResourceCollaborator.md) - - [ResourceCollaboratorCreation](docs/ResourceCollaboratorCreation.md) - - [ResourceRights](docs/ResourceRights.md) - - [ScoreComment](docs/ScoreComment.md) - - [ScoreCommentContext](docs/ScoreCommentContext.md) - - [ScoreCommentCreation](docs/ScoreCommentCreation.md) - - [ScoreCommentModeration](docs/ScoreCommentModeration.md) - - [ScoreCommentUpdate](docs/ScoreCommentUpdate.md) - - [ScoreCommentsCounts](docs/ScoreCommentsCounts.md) - - [ScoreCreation](docs/ScoreCreation.md) - - [ScoreCreationBuilderData](docs/ScoreCreationBuilderData.md) - - [ScoreCreationBuilderDataLayoutData](docs/ScoreCreationBuilderDataLayoutData.md) - - [ScoreCreationBuilderDataScoreData](docs/ScoreCreationBuilderDataScoreData.md) - - [ScoreCreationBuilderDataScoreDataInstrumentsInner](docs/ScoreCreationBuilderDataScoreDataInstrumentsInner.md) - - [ScoreCreationType](docs/ScoreCreationType.md) - - [ScoreDetails](docs/ScoreDetails.md) - - [ScoreFork](docs/ScoreFork.md) - - [ScoreLicense](docs/ScoreLicense.md) - - [ScoreLikesCounts](docs/ScoreLikesCounts.md) - - [ScoreModification](docs/ScoreModification.md) - - [ScorePlaysCounts](docs/ScorePlaysCounts.md) - - [ScorePrivacy](docs/ScorePrivacy.md) - - [ScoreRevision](docs/ScoreRevision.md) - - [ScoreRevisionCreation](docs/ScoreRevisionCreation.md) - - [ScoreRevisionStatistics](docs/ScoreRevisionStatistics.md) - - [ScoreSource](docs/ScoreSource.md) - - [ScoreTrack](docs/ScoreTrack.md) - - [ScoreTrackCreation](docs/ScoreTrackCreation.md) - - [ScoreTrackPoint](docs/ScoreTrackPoint.md) - - [ScoreTrackState](docs/ScoreTrackState.md) - - [ScoreTrackType](docs/ScoreTrackType.md) - - [ScoreTrackUpdate](docs/ScoreTrackUpdate.md) - - [ScoreViewsCounts](docs/ScoreViewsCounts.md) - - [Task](docs/Task.md) - - [TaskExportOptions](docs/TaskExportOptions.md) - - [TaskProgress](docs/TaskProgress.md) - - [TaskResult](docs/TaskResult.md) - - [UserAdminUpdate](docs/UserAdminUpdate.md) - - [UserAzureDetails](docs/UserAzureDetails.md) - - [UserCommunityProfileLinks](docs/UserCommunityProfileLinks.md) - - [UserCreation](docs/UserCreation.md) - - [UserDetails](docs/UserDetails.md) - - [UserDetailsAdmin](docs/UserDetailsAdmin.md) - - [UserDetailsAdminLicense](docs/UserDetailsAdminLicense.md) - - [UserPublic](docs/UserPublic.md) - - [UserPublicSummary](docs/UserPublicSummary.md) - - [UserSigninLink](docs/UserSigninLink.md) - - [UserSigninLinkCreation](docs/UserSigninLinkCreation.md) +Python 3.11, 3.12 and 3.13. Versions past their upstream end of life are not supported; see +[MIGRATION.md](MIGRATION.md) if you are on an older runtime. +## Documentation -## Documentation For Authorization +- [Quickstart](QUICKSTART.md), install to first call +- [Per-operation reference](docs/reference/), generated +- [API documentation](https://flat.io/developers/docs/api/) +- [Migrating from 1.1.x](MIGRATION.md) +## Verifying this package -## OAuth2 +Every release carries a signed provenance attestation linking the package back to the commit, the +workflow run that built it, and the API specification version it was generated from. -- **Type**: OAuth -- **Flow**: accessCode -- **Authorization URL**: https://flat.io/auth/oauth -- **Scopes**: - - **account.public_profile**: Provides access to the basic person's public profile. Education profiles may be anonymized with this scope, you can request the scope `education_profile` to access to the a basic education account profile. - - **account.email**: Provices access to the person's email. - - **account.education_profile**: Provides access to the basic person's education profile and public organization information. - - **scores.readonly**: Allows read-only access to all a user's scores. You won't need this scope to read public scores. - - **scores.social**: Allow to post comments and like scores - - **scores**: Full, permissive scope to access all of a user's scores. - - **collections.readonly**: Allow read-only access to a user's collections. - - **collections.add_scores**: Allow to add scores to a user's collections. - - **collections**: Full, permissive scope to access all of a user's collections. - - **edu.resources**: Read-write access to the resource library. - - **edu.resources.readonly**: Read-only access to the resource library. - - **edu.classes**: Full, permissive scope to manage the classes. - - **edu.classes.readonly**: Read-only access to the classes. - - **edu.assignments**: Read-write access to the assignments and submissions. - - **edu.assignments.readonly**: Read-only access to the assignments and submissions. - - **edu.admin**: Full, permissive scope to manage all the admin of an organization. - - **edu.admin.lti**: Access and manage the LTI Credentials for an organization. - - **edu.admin.lti.readonly**: Read-only access to the LTI Credentials of an organization. - - **edu.admin.users**: Access and manage the users and invitations of the organization. - - **edu.admin.users.readonly**: Read-only access to the users and invitations of the organization. - - **tasks.readonly**: Read-only access to export tasks created by this account. - - -## Author +```sh +pip download --no-deps flat-api +gh attestation verify flat_api-*.whl --repo FlatIO/api-client-python +``` -developers@flat.io +Published through PyPI trusted publishing: no long-lived token exists that could publish under this +name. +## How this client is maintained -## Notes for Large OpenAPI documents -If the OpenAPI document is large, imports in flat_api.apis and flat_api.models may fail with a -RecursionError indicating the maximum recursion limit has been exceeded. In that case, there are a couple of solutions: +Generated from the public specification published at +[FlatIO/api-reference](https://github.com/FlatIO/api-reference). A new specification release +regenerates, validates and publishes this package automatically, so it never drifts from the API. -Solution 1: -Use specific imports for apis and models like: -- `from flat_api.api.default_api import DefaultApi` -- `from flat_api.model.pet import Pet` +Files under `docs/reference/` and the client sources are generated: edit the generator configuration +in `tools/`, not the output. -Solution 2: -Before importing the package, adjust the maximum recursion limit as shown below: -``` -import sys -sys.setrecursionlimit(1500) -import flat_api -from flat_api.apis import * -from flat_api.models import * -``` +## License +Apache 2.0. See [LICENSE](LICENSE). diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..227cea2 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +2.0.0 diff --git a/docs/AppScopes.md b/docs/AppScopes.md deleted file mode 100644 index 0f80a9a..0000000 --- a/docs/AppScopes.md +++ /dev/null @@ -1,12 +0,0 @@ -# AppScopes - -Available scopes - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/Assignment.md b/docs/Assignment.md deleted file mode 100644 index 3d984e9..0000000 --- a/docs/Assignment.md +++ /dev/null @@ -1,43 +0,0 @@ -# Assignment - -Assignment details - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Unique identifier of the assignment | -**type** | [**AssignmentType**](AssignmentType.md) | | -**capabilities** | [**AssignmentCopyResponseCapabilities**](AssignmentCopyResponseCapabilities.md) | | -**title** | **str** | Title of the assignment | -**description** | **str** | Description and content of the assignment | [optional] -**cover** | **str** | The URL of the cover to display | [optional] -**cover_file** | **str** | The id of the cover to display | [optional] -**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | | -**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] -**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] -**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] -**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] -**toolset** | **str** | The id of the associated toolset | [optional] -**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] - -## Example - -```python -from flat_api.models.assignment import Assignment - -# TODO update the JSON string below -json = "{}" -# create an instance of Assignment from a JSON string -assignment_instance = Assignment.from_json(json) -# print the JSON string representation of the object -print Assignment.to_json() - -# convert the object into a dict -assignment_dict = assignment_instance.to_dict() -# create an instance of Assignment from a dict -assignment_form_dict = assignment.from_dict(assignment_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/AssignmentCopyResponse.md b/docs/AssignmentCopyResponse.md deleted file mode 100644 index 61c427f..0000000 --- a/docs/AssignmentCopyResponse.md +++ /dev/null @@ -1,43 +0,0 @@ -# AssignmentCopyResponse - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Unique identifier of the assignment | -**type** | [**AssignmentType**](AssignmentType.md) | | -**capabilities** | [**AssignmentCopyResponseCapabilities**](AssignmentCopyResponseCapabilities.md) | | -**title** | **str** | Title of the assignment | -**description** | **str** | Description and content of the assignment | [optional] -**cover** | **str** | The URL of the cover to display | [optional] -**cover_file** | **str** | The id of the cover to display | [optional] -**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | | -**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] -**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] -**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] -**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] -**toolset** | **str** | The id of the associated toolset | [optional] -**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] -**resource** | **str** | If this assignment is stored as a resource in the Flat for Education Resource Library, the unique identifier of the resource. | [optional] - -## Example - -```python -from flat_api.models.assignment_copy_response import AssignmentCopyResponse - -# TODO update the JSON string below -json = "{}" -# create an instance of AssignmentCopyResponse from a JSON string -assignment_copy_response_instance = AssignmentCopyResponse.from_json(json) -# print the JSON string representation of the object -print AssignmentCopyResponse.to_json() - -# convert the object into a dict -assignment_copy_response_dict = assignment_copy_response_instance.to_dict() -# create an instance of AssignmentCopyResponse from a dict -assignment_copy_response_form_dict = assignment_copy_response.from_dict(assignment_copy_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/AssignmentCopyResponseCapabilitiesCanPublishInClassError.md b/docs/AssignmentCopyResponseCapabilitiesCanPublishInClassError.md deleted file mode 100644 index b9b420b..0000000 --- a/docs/AssignmentCopyResponseCapabilitiesCanPublishInClassError.md +++ /dev/null @@ -1,31 +0,0 @@ -# AssignmentCopyResponseCapabilitiesCanPublishInClassError - -If `canPublishInClass` and `canEdit` are false, the issue why this assignment cannot be published in a class - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **str** | A corresponding code for this error | -**message** | **str** | A printable and localized message for this error | - -## Example - -```python -from flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error import AssignmentCopyResponseCapabilitiesCanPublishInClassError - -# TODO update the JSON string below -json = "{}" -# create an instance of AssignmentCopyResponseCapabilitiesCanPublishInClassError from a JSON string -assignment_copy_response_capabilities_can_publish_in_class_error_instance = AssignmentCopyResponseCapabilitiesCanPublishInClassError.from_json(json) -# print the JSON string representation of the object -print AssignmentCopyResponseCapabilitiesCanPublishInClassError.to_json() - -# convert the object into a dict -assignment_copy_response_capabilities_can_publish_in_class_error_dict = assignment_copy_response_capabilities_can_publish_in_class_error_instance.to_dict() -# create an instance of AssignmentCopyResponseCapabilitiesCanPublishInClassError from a dict -assignment_copy_response_capabilities_can_publish_in_class_error_form_dict = assignment_copy_response_capabilities_can_publish_in_class_error.from_dict(assignment_copy_response_capabilities_can_publish_in_class_error_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/AssignmentSubmissionPlaybackInner.md b/docs/AssignmentSubmissionPlaybackInner.md deleted file mode 100644 index ad92cd1..0000000 --- a/docs/AssignmentSubmissionPlaybackInner.md +++ /dev/null @@ -1,31 +0,0 @@ -# AssignmentSubmissionPlaybackInner - -Playback used by student in this submission (used to limit the playback for the assignment) - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**score** | **str** | The score unique identifier | -**nb_play_attempt** | **float** | The number of playback used by the student | - -## Example - -```python -from flat_api.models.assignment_submission_playback_inner import AssignmentSubmissionPlaybackInner - -# TODO update the JSON string below -json = "{}" -# create an instance of AssignmentSubmissionPlaybackInner from a JSON string -assignment_submission_playback_inner_instance = AssignmentSubmissionPlaybackInner.from_json(json) -# print the JSON string representation of the object -print AssignmentSubmissionPlaybackInner.to_json() - -# convert the object into a dict -assignment_submission_playback_inner_dict = assignment_submission_playback_inner_instance.to_dict() -# create an instance of AssignmentSubmissionPlaybackInner from a dict -assignment_submission_playback_inner_form_dict = assignment_submission_playback_inner.from_dict(assignment_submission_playback_inner_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/AssignmentType.md b/docs/AssignmentType.md deleted file mode 100644 index 83e5742..0000000 --- a/docs/AssignmentType.md +++ /dev/null @@ -1,12 +0,0 @@ -# AssignmentType - -Type of the assignment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/AssignmentUpdate.md b/docs/AssignmentUpdate.md deleted file mode 100644 index 560191c..0000000 --- a/docs/AssignmentUpdate.md +++ /dev/null @@ -1,40 +0,0 @@ -# AssignmentUpdate - -Assignment Resource Editing - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**AssignmentType**](AssignmentType.md) | | [optional] -**title** | **str** | Title of the assignment | [optional] -**description** | **str** | Description and content of the assignment | [optional] -**attachments** | [**List[ClassAttachmentCreation]**](ClassAttachmentCreation.md) | | [optional] -**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] -**toolset** | **str** | The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. | [optional] -**cover_file** | **str** | The id of the cover to display | [optional] -**cover** | **str** | The URL of the cover to display | [optional] -**max_points** | **float** | If set, the grading will be enabled for the assignement with this value as the maximum of points | [optional] -**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] -**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] - -## Example - -```python -from flat_api.models.assignment_update import AssignmentUpdate - -# TODO update the JSON string below -json = "{}" -# create an instance of AssignmentUpdate from a JSON string -assignment_update_instance = AssignmentUpdate.from_json(json) -# print the JSON string representation of the object -print AssignmentUpdate.to_json() - -# convert the object into a dict -assignment_update_dict = assignment_update_instance.to_dict() -# create an instance of AssignmentUpdate from a dict -assignment_update_form_dict = assignment_update.from_dict(assignment_update_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/ClassAssignment.md b/docs/ClassAssignment.md deleted file mode 100644 index 1fe39f6..0000000 --- a/docs/ClassAssignment.md +++ /dev/null @@ -1,57 +0,0 @@ -# ClassAssignment - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Unique identifier of the assignment | -**type** | [**AssignmentType**](AssignmentType.md) | | -**capabilities** | [**AssignmentCopyResponseCapabilities**](AssignmentCopyResponseCapabilities.md) | | -**title** | **str** | Title of the assignment | -**description** | **str** | Description and content of the assignment | [optional] -**cover** | **str** | The URL of the cover to display | [optional] -**cover_file** | **str** | The id of the cover to display | [optional] -**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | | -**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] -**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] -**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] -**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] -**toolset** | **str** | The id of the associated toolset | [optional] -**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] -**creator** | **str** | The User unique identifier of the creator of this assignment | [optional] -**state** | **str** | State of the assignment | [optional] -**classroom** | **str** | The unique identifier of the class where this assignment was posted | [optional] -**creation_date** | **datetime** | The creation date of this assignment | [optional] -**scheduled_date** | **datetime** | The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. | [optional] -**due_date** | **datetime** | The due date of this assignment, late submissions will be marked as paste due. | [optional] -**assignee_mode** | **str** | Possible modes of assigning assignments | [optional] -**assigned_students** | **List[str]** | Identifiers for the students that have access to the assignment | [optional] -**submissions** | [**List[AssignmentSubmission]**](AssignmentSubmission.md) | | [optional] -**google_classroom** | [**GoogleClassroomCoursework**](GoogleClassroomCoursework.md) | | [optional] -**microsoft_graph** | [**MicrosoftGraphAssignment**](MicrosoftGraphAssignment.md) | | [optional] -**mfc** | [**ClassAssignmentMfc**](ClassAssignmentMfc.md) | | [optional] -**canvas** | [**ClassAssignmentCanvas**](ClassAssignmentCanvas.md) | | [optional] -**lti** | [**ClassAssignmentLti**](ClassAssignmentLti.md) | | [optional] -**issue** | **str** | Detected issue for this assignment | [optional] - -## Example - -```python -from flat_api.models.class_assignment import ClassAssignment - -# TODO update the JSON string below -json = "{}" -# create an instance of ClassAssignment from a JSON string -class_assignment_instance = ClassAssignment.from_json(json) -# print the JSON string representation of the object -print ClassAssignment.to_json() - -# convert the object into a dict -class_assignment_dict = class_assignment_instance.to_dict() -# create an instance of ClassAssignment from a dict -class_assignment_form_dict = class_assignment.from_dict(class_assignment_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/ClassAssignmentLti.md b/docs/ClassAssignmentLti.md deleted file mode 100644 index 908aad6..0000000 --- a/docs/ClassAssignmentLti.md +++ /dev/null @@ -1,30 +0,0 @@ -# ClassAssignmentLti - -An LTI assignment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Resource ID in the LMS | [optional] - -## Example - -```python -from flat_api.models.class_assignment_lti import ClassAssignmentLti - -# TODO update the JSON string below -json = "{}" -# create an instance of ClassAssignmentLti from a JSON string -class_assignment_lti_instance = ClassAssignmentLti.from_json(json) -# print the JSON string representation of the object -print ClassAssignmentLti.to_json() - -# convert the object into a dict -class_assignment_lti_dict = class_assignment_lti_instance.to_dict() -# create an instance of ClassAssignmentLti from a dict -class_assignment_lti_form_dict = class_assignment_lti.from_dict(class_assignment_lti_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/ClassAssignmentUpdate.md b/docs/ClassAssignmentUpdate.md deleted file mode 100644 index 3860e0f..0000000 --- a/docs/ClassAssignmentUpdate.md +++ /dev/null @@ -1,46 +0,0 @@ -# ClassAssignmentUpdate - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**type** | [**AssignmentType**](AssignmentType.md) | | [optional] -**title** | **str** | Title of the assignment | [optional] -**description** | **str** | Description and content of the assignment | [optional] -**attachments** | [**List[ClassAttachmentCreation]**](ClassAttachmentCreation.md) | | [optional] -**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] -**toolset** | **str** | The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. | [optional] -**cover_file** | **str** | The id of the cover to display | [optional] -**cover** | **str** | The URL of the cover to display | [optional] -**max_points** | **float** | If set, the grading will be enabled for the assignement with this value as the maximum of points | [optional] -**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] -**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] -**state** | **str** | State of the assignment | [optional] -**due_date** | **datetime** | The due date of this assignment, late submissions will be marked as paste due. If not set, the assignment won't have a due date. | [optional] -**scheduled_date** | **datetime** | The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. | [optional] -**google_classroom** | [**ClassAssignmentUpdateGoogleClassroom**](ClassAssignmentUpdateGoogleClassroom.md) | | [optional] -**microsoft_graph** | [**ClassAssignmentUpdateMicrosoftGraph**](ClassAssignmentUpdateMicrosoftGraph.md) | | [optional] -**assignee_mode** | **str** | Possible modes of assigning assignments | [optional] -**assigned_students** | **List[str]** | Identifiers for the students that have access to the assignment | [optional] - -## Example - -```python -from flat_api.models.class_assignment_update import ClassAssignmentUpdate - -# TODO update the JSON string below -json = "{}" -# create an instance of ClassAssignmentUpdate from a JSON string -class_assignment_update_instance = ClassAssignmentUpdate.from_json(json) -# print the JSON string representation of the object -print ClassAssignmentUpdate.to_json() - -# convert the object into a dict -class_assignment_update_dict = class_assignment_update_instance.to_dict() -# create an instance of ClassAssignmentUpdate from a dict -class_assignment_update_form_dict = class_assignment_update.from_dict(class_assignment_update_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/ClassAssignmentUpdateGoogleClassroom.md b/docs/ClassAssignmentUpdateGoogleClassroom.md deleted file mode 100644 index 456dcc9..0000000 --- a/docs/ClassAssignmentUpdateGoogleClassroom.md +++ /dev/null @@ -1,30 +0,0 @@ -# ClassAssignmentUpdateGoogleClassroom - -Google Classroom options for this assignment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**topic_id** | **str** | Identifier of the topic where the assignment is created | [optional] - -## Example - -```python -from flat_api.models.class_assignment_update_google_classroom import ClassAssignmentUpdateGoogleClassroom - -# TODO update the JSON string below -json = "{}" -# create an instance of ClassAssignmentUpdateGoogleClassroom from a JSON string -class_assignment_update_google_classroom_instance = ClassAssignmentUpdateGoogleClassroom.from_json(json) -# print the JSON string representation of the object -print ClassAssignmentUpdateGoogleClassroom.to_json() - -# convert the object into a dict -class_assignment_update_google_classroom_dict = class_assignment_update_google_classroom_instance.to_dict() -# create an instance of ClassAssignmentUpdateGoogleClassroom from a dict -class_assignment_update_google_classroom_form_dict = class_assignment_update_google_classroom.from_dict(class_assignment_update_google_classroom_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/ClassAssignmentUpdateMicrosoftGraph.md b/docs/ClassAssignmentUpdateMicrosoftGraph.md deleted file mode 100644 index 2d88948..0000000 --- a/docs/ClassAssignmentUpdateMicrosoftGraph.md +++ /dev/null @@ -1,30 +0,0 @@ -# ClassAssignmentUpdateMicrosoftGraph - -Microsoft Graph options for this assignment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**categories** | **List[str]** | List of categories this assignment belongs to | [optional] - -## Example - -```python -from flat_api.models.class_assignment_update_microsoft_graph import ClassAssignmentUpdateMicrosoftGraph - -# TODO update the JSON string below -json = "{}" -# create an instance of ClassAssignmentUpdateMicrosoftGraph from a JSON string -class_assignment_update_microsoft_graph_instance = ClassAssignmentUpdateMicrosoftGraph.from_json(json) -# print the JSON string representation of the object -print ClassAssignmentUpdateMicrosoftGraph.to_json() - -# convert the object into a dict -class_assignment_update_microsoft_graph_dict = class_assignment_update_microsoft_graph_instance.to_dict() -# create an instance of ClassAssignmentUpdateMicrosoftGraph from a dict -class_assignment_update_microsoft_graph_form_dict = class_assignment_update_microsoft_graph.from_dict(class_assignment_update_microsoft_graph_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/CollectionPrivacy.md b/docs/CollectionPrivacy.md deleted file mode 100644 index 827a33f..0000000 --- a/docs/CollectionPrivacy.md +++ /dev/null @@ -1,12 +0,0 @@ -# CollectionPrivacy - -The collection main privacy mode. - `private`: The collection is private and can be only accessed, modified and administred by specified collaborators users. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/CollectionType.md b/docs/CollectionType.md deleted file mode 100644 index 9b14a6e..0000000 --- a/docs/CollectionType.md +++ /dev/null @@ -1,12 +0,0 @@ -# CollectionType - -Type of the collection. The type will influence the capabilitied available on the collections and how this collection is/can be populated. - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/EduResourceResource.md b/docs/EduResourceResource.md deleted file mode 100644 index a245757..0000000 --- a/docs/EduResourceResource.md +++ /dev/null @@ -1,42 +0,0 @@ -# EduResourceResource - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Unique identifier of the assignment | -**type** | [**AssignmentType**](AssignmentType.md) | | -**capabilities** | [**AssignmentCopyResponseCapabilities**](AssignmentCopyResponseCapabilities.md) | | -**title** | **str** | Title of the folder | -**description** | **str** | Description and content of the assignment | [optional] -**cover** | **str** | The URL of the cover to display | [optional] -**cover_file** | **str** | The id of the cover to display | [optional] -**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | | -**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] -**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] -**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] -**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] -**toolset** | **str** | The id of the associated toolset | [optional] -**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] - -## Example - -```python -from flat_api.models.edu_resource_resource import EduResourceResource - -# TODO update the JSON string below -json = "{}" -# create an instance of EduResourceResource from a JSON string -edu_resource_resource_instance = EduResourceResource.from_json(json) -# print the JSON string representation of the object -print EduResourceResource.to_json() - -# convert the object into a dict -edu_resource_resource_dict = edu_resource_resource_instance.to_dict() -# create an instance of EduResourceResource from a dict -edu_resource_resource_form_dict = edu_resource_resource.from_dict(edu_resource_resource_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/FlatLocales.md b/docs/FlatLocales.md deleted file mode 100644 index 19b9340..0000000 --- a/docs/FlatLocales.md +++ /dev/null @@ -1,12 +0,0 @@ -# FlatLocales - -The user language - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/GroupApi.md b/docs/GroupApi.md deleted file mode 100644 index 3af3f5e..0000000 --- a/docs/GroupApi.md +++ /dev/null @@ -1,239 +0,0 @@ -# flat_api.GroupApi - -All URIs are relative to *https://api.flat.io/v2* - -Method | HTTP request | Description -------------- | ------------- | ------------- -[**get_group_details**](GroupApi.md#get_group_details) | **GET** /groups/{group} | Get group information -[**get_group_scores**](GroupApi.md#get_group_scores) | **GET** /groups/{group}/scores | List group's scores -[**list_group_users**](GroupApi.md#list_group_users) | **GET** /groups/{group}/users | List group's users - - -# **get_group_details** -> GroupDetails get_group_details(group) - -Get group information - -### Example - -* OAuth Authentication (OAuth2): - -```python -import flat_api -from flat_api.models.group_details import GroupDetails -from flat_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.flat.io/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = flat_api.Configuration( - host = "https://api.flat.io/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -configuration.access_token = os.environ["ACCESS_TOKEN"] - -# Enter a context with an instance of the API client -with flat_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = flat_api.GroupApi(api_client) - group = 'group_example' # str | Unique identifier of a Flat group - - try: - # Get group information - api_response = api_instance.get_group_details(group) - print("The response of GroupApi->get_group_details:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling GroupApi->get_group_details: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group** | **str**| Unique identifier of a Flat group | - -### Return type - -[**GroupDetails**](GroupDetails.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The group details | - | -**0** | Error | - | - -[[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) - -# **get_group_scores** -> List[ScoreDetails] get_group_scores(group, parent=parent) - -List group's scores - -Get the list of scores shared with a group. - -### Example - -* OAuth Authentication (OAuth2): - -```python -import flat_api -from flat_api.models.score_details import ScoreDetails -from flat_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.flat.io/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = flat_api.Configuration( - host = "https://api.flat.io/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -configuration.access_token = os.environ["ACCESS_TOKEN"] - -# Enter a context with an instance of the API client -with flat_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = flat_api.GroupApi(api_client) - group = 'group_example' # str | Unique identifier of a Flat group - parent = 'parent_example' # str | Filter the score forked from the score id `parent` (optional) - - try: - # List group's scores - api_response = api_instance.get_group_scores(group, parent=parent) - print("The response of GroupApi->get_group_scores:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling GroupApi->get_group_scores: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group** | **str**| Unique identifier of a Flat group | - **parent** | **str**| Filter the score forked from the score id `parent` | [optional] - -### Return type - -[**List[ScoreDetails]**](ScoreDetails.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The group's scores | - | -**0** | Error | - | - -[[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_group_users** -> List[UserPublic] list_group_users(group, source=source) - -List group's users - -### Example - -* OAuth Authentication (OAuth2): - -```python -import flat_api -from flat_api.models.user_public import UserPublic -from flat_api.rest import ApiException -from pprint import pprint - -# Defining the host is optional and defaults to https://api.flat.io/v2 -# See configuration.py for a list of all supported configuration parameters. -configuration = flat_api.Configuration( - host = "https://api.flat.io/v2" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -configuration.access_token = os.environ["ACCESS_TOKEN"] - -# Enter a context with an instance of the API client -with flat_api.ApiClient(configuration) as api_client: - # Create an instance of the API class - api_instance = flat_api.GroupApi(api_client) - group = 'group_example' # str | Unique identifier of a Flat group - source = 'source_example' # str | Filter the users by their source (optional) - - try: - # List group's users - api_response = api_instance.list_group_users(group, source=source) - print("The response of GroupApi->list_group_users:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling GroupApi->list_group_users: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **group** | **str**| Unique identifier of a Flat group | - **source** | **str**| Filter the users by their source | [optional] - -### Return type - -[**List[UserPublic]**](UserPublic.md) - -### Authorization - -[OAuth2](../README.md#OAuth2) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | The list of users member of the group | - | -**0** | Error | - | - -[[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) - diff --git a/docs/GroupDetails.md b/docs/GroupDetails.md deleted file mode 100644 index ddb4f0e..0000000 --- a/docs/GroupDetails.md +++ /dev/null @@ -1,36 +0,0 @@ -# GroupDetails - -The details of a group - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | The unique identifier of the group | [optional] -**name** | **str** | The displayable name of the group | [optional] -**type** | [**GroupType**](GroupType.md) | | [optional] -**organization** | **str** | The unique identifier of the Organization owning the group | [optional] -**creation_date** | **datetime** | The date when the group was create | [optional] -**users_count** | **float** | The number of students in this group | [optional] -**read_only** | **bool** | `true` if the properties and members of this group are in in read-only | [optional] - -## Example - -```python -from flat_api.models.group_details import GroupDetails - -# TODO update the JSON string below -json = "{}" -# create an instance of GroupDetails from a JSON string -group_details_instance = GroupDetails.from_json(json) -# print the JSON string representation of the object -print GroupDetails.to_json() - -# convert the object into a dict -group_details_dict = group_details_instance.to_dict() -# create an instance of GroupDetails from a dict -group_details_form_dict = group_details.from_dict(group_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/GroupType.md b/docs/GroupType.md deleted file mode 100644 index dcc0f2c..0000000 --- a/docs/GroupType.md +++ /dev/null @@ -1,12 +0,0 @@ -# GroupType - -The type of the group - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/LicenseSources.md b/docs/LicenseSources.md deleted file mode 100644 index 300e50f..0000000 --- a/docs/LicenseSources.md +++ /dev/null @@ -1,12 +0,0 @@ -# LicenseSources - -Source of the license - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/LmsName.md b/docs/LmsName.md deleted file mode 100644 index c5390ae..0000000 --- a/docs/LmsName.md +++ /dev/null @@ -1,12 +0,0 @@ -# LmsName - -LMS name - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/MicrosoftGraphAssignment.md b/docs/MicrosoftGraphAssignment.md deleted file mode 100644 index b9b2ca3..0000000 --- a/docs/MicrosoftGraphAssignment.md +++ /dev/null @@ -1,33 +0,0 @@ -# MicrosoftGraphAssignment - -A Microsoft Teams asignment - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | Identifier of the assignement assigned by Microsoft Teams | [optional] -**state** | **str** | State of the assignment | [optional] -**alternate_link** | **str** | Absolute link to this assignement in the Microsoft Teams web UI | [optional] -**categories** | **List[str]** | List of categories where this assignment is published under | [optional] - -## Example - -```python -from flat_api.models.microsoft_graph_assignment import MicrosoftGraphAssignment - -# TODO update the JSON string below -json = "{}" -# create an instance of MicrosoftGraphAssignment from a JSON string -microsoft_graph_assignment_instance = MicrosoftGraphAssignment.from_json(json) -# print the JSON string representation of the object -print MicrosoftGraphAssignment.to_json() - -# convert the object into a dict -microsoft_graph_assignment_dict = microsoft_graph_assignment_instance.to_dict() -# create an instance of MicrosoftGraphAssignment from a dict -microsoft_graph_assignment_form_dict = microsoft_graph_assignment.from_dict(microsoft_graph_assignment_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/ScoreCreationBuilderData.md b/docs/ScoreCreationBuilderData.md deleted file mode 100644 index 865b4f2..0000000 --- a/docs/ScoreCreationBuilderData.md +++ /dev/null @@ -1,30 +0,0 @@ -# ScoreCreationBuilderData - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**score_data** | [**ScoreCreationBuilderDataScoreData**](ScoreCreationBuilderDataScoreData.md) | | -**layout_data** | [**ScoreCreationBuilderDataLayoutData**](ScoreCreationBuilderDataLayoutData.md) | | [optional] - -## Example - -```python -from flat_api.models.score_creation_builder_data import ScoreCreationBuilderData - -# TODO update the JSON string below -json = "{}" -# create an instance of ScoreCreationBuilderData from a JSON string -score_creation_builder_data_instance = ScoreCreationBuilderData.from_json(json) -# print the JSON string representation of the object -print ScoreCreationBuilderData.to_json() - -# convert the object into a dict -score_creation_builder_data_dict = score_creation_builder_data_instance.to_dict() -# create an instance of ScoreCreationBuilderData from a dict -score_creation_builder_data_form_dict = score_creation_builder_data.from_dict(score_creation_builder_data_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/ScoreCreationBuilderDataScoreData.md b/docs/ScoreCreationBuilderDataScoreData.md deleted file mode 100644 index b027f63..0000000 --- a/docs/ScoreCreationBuilderDataScoreData.md +++ /dev/null @@ -1,34 +0,0 @@ -# ScoreCreationBuilderDataScoreData - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**use_tab_staff** | **bool** | true if the TAB staff is displayed with fretted instruments | [optional] -**use_chord_grid** | **bool** | true if the chord grid must be displayed with fretted instruments | [optional] -**fifths** | **float** | The key signature of the score (expressed between -7 and 7). Major C is used when the value is not provided. | [optional] -**nb_beats** | **float** | The number of beats in the measure | [optional] -**beat_type** | **float** | The duration of a beat in the measure | [optional] -**instruments** | [**List[ScoreCreationBuilderDataScoreDataInstrumentsInner]**](ScoreCreationBuilderDataScoreDataInstrumentsInner.md) | The list of instruments to add to the score. See https://prod.flat-cdn.com/fixtures/instruments_en.json for the possible values for `group` and `instrument`. | - -## Example - -```python -from flat_api.models.score_creation_builder_data_score_data import ScoreCreationBuilderDataScoreData - -# TODO update the JSON string below -json = "{}" -# create an instance of ScoreCreationBuilderDataScoreData from a JSON string -score_creation_builder_data_score_data_instance = ScoreCreationBuilderDataScoreData.from_json(json) -# print the JSON string representation of the object -print ScoreCreationBuilderDataScoreData.to_json() - -# convert the object into a dict -score_creation_builder_data_score_data_dict = score_creation_builder_data_score_data_instance.to_dict() -# create an instance of ScoreCreationBuilderDataScoreData from a dict -score_creation_builder_data_score_data_form_dict = score_creation_builder_data_score_data.from_dict(score_creation_builder_data_score_data_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/ScoreCreationBuilderDataScoreDataInstrumentsInner.md b/docs/ScoreCreationBuilderDataScoreDataInstrumentsInner.md deleted file mode 100644 index 7d0e25c..0000000 --- a/docs/ScoreCreationBuilderDataScoreDataInstrumentsInner.md +++ /dev/null @@ -1,33 +0,0 @@ -# ScoreCreationBuilderDataScoreDataInstrumentsInner - - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**group** | **str** | The of the instrument group (e.g. `keyboards`, `brass`) | -**instrument** | **str** | The identifier of the instrument (e.g. `piano`, `trumpet`) | -**long_name** | **str** | The full name of the instrument | [optional] -**short_name** | **str** | The abbreviation of the name of the instrument | [optional] -**has_quarter_tone** | **bool** | True if the part can use quarter tone (prevent the part to have a TAB/chord grid) | [optional] - -## Example - -```python -from flat_api.models.score_creation_builder_data_score_data_instruments_inner import ScoreCreationBuilderDataScoreDataInstrumentsInner - -# TODO update the JSON string below -json = "{}" -# create an instance of ScoreCreationBuilderDataScoreDataInstrumentsInner from a JSON string -score_creation_builder_data_score_data_instruments_inner_instance = ScoreCreationBuilderDataScoreDataInstrumentsInner.from_json(json) -# print the JSON string representation of the object -print ScoreCreationBuilderDataScoreDataInstrumentsInner.to_json() - -# convert the object into a dict -score_creation_builder_data_score_data_instruments_inner_dict = score_creation_builder_data_score_data_instruments_inner_instance.to_dict() -# create an instance of ScoreCreationBuilderDataScoreDataInstrumentsInner from a dict -score_creation_builder_data_score_data_instruments_inner_form_dict = score_creation_builder_data_score_data_instruments_inner.from_dict(score_creation_builder_data_score_data_instruments_inner_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/ScoreLicense.md b/docs/ScoreLicense.md deleted file mode 100644 index 4e42188..0000000 --- a/docs/ScoreLicense.md +++ /dev/null @@ -1,12 +0,0 @@ -# ScoreLicense - -License of the creation. Read more about the Creative Commons licenses on https://creativecommons.org/licenses/ - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/TutteoProduct.md b/docs/TutteoProduct.md deleted file mode 100644 index 355771f..0000000 --- a/docs/TutteoProduct.md +++ /dev/null @@ -1,12 +0,0 @@ -# TutteoProduct - -The Tutteo product used by the user account - -## Properties - -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[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/AccountApi.md b/docs/reference/AccountApi.md similarity index 97% rename from docs/AccountApi.md rename to docs/reference/AccountApi.md index 91f225c..d18e50a 100644 --- a/docs/AccountApi.md +++ b/docs/reference/AccountApi.md @@ -12,7 +12,8 @@ Method | HTTP request | Description Get current user account -Get details about the current authenticated User. +Get details about the current authenticated User. + ### Example diff --git a/docs/reference/AddGroupUser200Response.md b/docs/reference/AddGroupUser200Response.md new file mode 100644 index 0000000..54e2831 --- /dev/null +++ b/docs/reference/AddGroupUser200Response.md @@ -0,0 +1,29 @@ +# AddGroupUser200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | **str** | User ID that was added | [optional] + +## Example + +```python +from flat_api.models.add_group_user200_response import AddGroupUser200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of AddGroupUser200Response from a JSON string +add_group_user200_response_instance = AddGroupUser200Response.from_json(json) +# print the JSON string representation of the object +print(AddGroupUser200Response.to_json()) + +# convert the object into a dict +add_group_user200_response_dict = add_group_user200_response_instance.to_dict() +# create an instance of AddGroupUser200Response from a dict +add_group_user200_response_from_dict = AddGroupUser200Response.from_dict(add_group_user200_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/reference/AddGroupUserRequest.md b/docs/reference/AddGroupUserRequest.md new file mode 100644 index 0000000..1ea7926 --- /dev/null +++ b/docs/reference/AddGroupUserRequest.md @@ -0,0 +1,29 @@ +# AddGroupUserRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user** | **str** | ID of the student to add | + +## Example + +```python +from flat_api.models.add_group_user_request import AddGroupUserRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of AddGroupUserRequest from a JSON string +add_group_user_request_instance = AddGroupUserRequest.from_json(json) +# print the JSON string representation of the object +print(AddGroupUserRequest.to_json()) + +# convert the object into a dict +add_group_user_request_dict = add_group_user_request_instance.to_dict() +# create an instance of AddGroupUserRequest from a dict +add_group_user_request_from_dict = AddGroupUserRequest.from_dict(add_group_user_request_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/ApiAccessToken.md b/docs/reference/ApiAccessToken.md similarity index 92% rename from docs/ApiAccessToken.md rename to docs/reference/ApiAccessToken.md index 5689596..14d1422 100644 --- a/docs/ApiAccessToken.md +++ b/docs/reference/ApiAccessToken.md @@ -23,12 +23,12 @@ json = "{}" # create an instance of ApiAccessToken from a JSON string api_access_token_instance = ApiAccessToken.from_json(json) # print the JSON string representation of the object -print ApiAccessToken.to_json() +print(ApiAccessToken.to_json()) # convert the object into a dict api_access_token_dict = api_access_token_instance.to_dict() # create an instance of ApiAccessToken from a dict -api_access_token_form_dict = api_access_token.from_dict(api_access_token_dict) +api_access_token_from_dict = ApiAccessToken.from_dict(api_access_token_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/reference/AppScopes.md b/docs/reference/AppScopes.md new file mode 100644 index 0000000..fb17b22 --- /dev/null +++ b/docs/reference/AppScopes.md @@ -0,0 +1,55 @@ +# AppScopes + +Available scopes + +## Enum + +* `ACCOUNT_DOT_PUBLIC_PROFILE` (value: `'account.public_profile'`) + +* `ACCOUNT_DOT_EMAIL` (value: `'account.email'`) + +* `ACCOUNT_DOT_EDUCATION_PROFILE` (value: `'account.education_profile'`) + +* `SCORES_DOT_READONLY` (value: `'scores.readonly'`) + +* `SCORES_DOT_SOCIAL` (value: `'scores.social'`) + +* `SCORES` (value: `'scores'`) + +* `COLLECTIONS_DOT_READONLY` (value: `'collections.readonly'`) + +* `COLLECTIONS_DOT_ADD_SCORES` (value: `'collections.add_scores'`) + +* `COLLECTIONS` (value: `'collections'`) + +* `NOTIFICATIONS_DOT_READONLY` (value: `'notifications.readonly'`) + +* `EDU_DOT_RESOURCES` (value: `'edu.resources'`) + +* `EDU_DOT_RESOURCES_DOT_READONLY` (value: `'edu.resources.readonly'`) + +* `EDU_DOT_CLASSES` (value: `'edu.classes'`) + +* `EDU_DOT_CLASSES_DOT_READONLY` (value: `'edu.classes.readonly'`) + +* `EDU_DOT_ASSIGNMENTS` (value: `'edu.assignments'`) + +* `EDU_DOT_ASSIGNMENTS_DOT_READONLY` (value: `'edu.assignments.readonly'`) + +* `EDU_DOT_ADMIN` (value: `'edu.admin'`) + +* `EDU_DOT_ADMIN_DOT_LTI` (value: `'edu.admin.lti'`) + +* `EDU_DOT_ADMIN_DOT_LTI_DOT_READONLY` (value: `'edu.admin.lti.readonly'`) + +* `EDU_DOT_ADMIN_DOT_USERS` (value: `'edu.admin.users'`) + +* `EDU_DOT_ADMIN_DOT_USERS_DOT_READONLY` (value: `'edu.admin.users.readonly'`) + +* `TASKS_DOT_READONLY` (value: `'tasks.readonly'`) + +* `OMR` (value: `'omr'`) + +[[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/reference/Assignment.md b/docs/reference/Assignment.md new file mode 100644 index 0000000..9b2bc79 --- /dev/null +++ b/docs/reference/Assignment.md @@ -0,0 +1,54 @@ +# Assignment + +Assignment details + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the assignment | +**type** | [**AssignmentType**](AssignmentType.md) | | +**capabilities** | [**AssignmentCapabilities**](AssignmentCapabilities.md) | | +**title** | **str** | Title of the assignment | +**description** | **str** | Student instructions and content of the assignment (plain text) | [optional] +**description_html** | **str** | HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**teacher_instructions** | **str** | Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. | [optional] +**teacher_instructions_html** | **str** | HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**cover** | **str** | The URL of the cover to display | [optional] +**cover_file** | **str** | The id of the cover to display | [optional] +**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. | +**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] +**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] +**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] +**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] +**toolset** | **str** | The id of the associated toolset | [optional] +**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] +**restrict_play_note** | **bool** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] +**restrict_to_audio_tracks** | **bool** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] +**submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] +**recording_type** | **str** | For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. | [optional] +**allow_metronome** | **bool** | For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. | [optional] +**allow_backing_track** | **bool** | For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. | [optional] +**allow_speed_change** | **bool** | For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. | [optional] +**free_record** | **bool** | For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. | [optional] + +## Example + +```python +from flat_api.models.assignment import Assignment + +# TODO update the JSON string below +json = "{}" +# create an instance of Assignment from a JSON string +assignment_instance = Assignment.from_json(json) +# print the JSON string representation of the object +print(Assignment.to_json()) + +# convert the object into a dict +assignment_dict = assignment_instance.to_dict() +# create an instance of Assignment from a dict +assignment_from_dict = Assignment.from_dict(assignment_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/AssignmentCopyResponseCapabilities.md b/docs/reference/AssignmentCapabilities.md similarity index 51% rename from docs/AssignmentCopyResponseCapabilities.md rename to docs/reference/AssignmentCapabilities.md index 803c171..8e5df85 100644 --- a/docs/AssignmentCopyResponseCapabilities.md +++ b/docs/reference/AssignmentCapabilities.md @@ -1,4 +1,4 @@ -# AssignmentCopyResponseCapabilities +# AssignmentCapabilities Capabilities the current user has on this assignment. Each capability corresponds to a fine-grained action that a user may take. @@ -8,26 +8,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **can_edit** | **bool** | Whether the current user can edit the assignment | **can_publish_in_class** | **bool** | Whether this assignment can be published in a class | -**can_publish_in_class_error** | [**AssignmentCopyResponseCapabilitiesCanPublishInClassError**](AssignmentCopyResponseCapabilitiesCanPublishInClassError.md) | | [optional] +**can_publish_in_class_error** | [**AssignmentCapabilitiesCanPublishInClassError**](AssignmentCapabilitiesCanPublishInClassError.md) | | [optional] **can_archive** | **bool** | Whether the current user can archive the assignment | **can_unarchive** | **bool** | Whether the current user can unarchive the assignment | ## Example ```python -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities +from flat_api.models.assignment_capabilities import AssignmentCapabilities # TODO update the JSON string below json = "{}" -# create an instance of AssignmentCopyResponseCapabilities from a JSON string -assignment_copy_response_capabilities_instance = AssignmentCopyResponseCapabilities.from_json(json) +# create an instance of AssignmentCapabilities from a JSON string +assignment_capabilities_instance = AssignmentCapabilities.from_json(json) # print the JSON string representation of the object -print AssignmentCopyResponseCapabilities.to_json() +print(AssignmentCapabilities.to_json()) # convert the object into a dict -assignment_copy_response_capabilities_dict = assignment_copy_response_capabilities_instance.to_dict() -# create an instance of AssignmentCopyResponseCapabilities from a dict -assignment_copy_response_capabilities_form_dict = assignment_copy_response_capabilities.from_dict(assignment_copy_response_capabilities_dict) +assignment_capabilities_dict = assignment_capabilities_instance.to_dict() +# create an instance of AssignmentCapabilities from a dict +assignment_capabilities_from_dict = AssignmentCapabilities.from_dict(assignment_capabilities_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/reference/AssignmentCapabilitiesCanPublishInClassError.md b/docs/reference/AssignmentCapabilitiesCanPublishInClassError.md new file mode 100644 index 0000000..3041412 --- /dev/null +++ b/docs/reference/AssignmentCapabilitiesCanPublishInClassError.md @@ -0,0 +1,31 @@ +# AssignmentCapabilitiesCanPublishInClassError + +If `canPublishInClass` and `canEdit` are false, the issue why this assignment cannot be published in a class + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | A corresponding code for this error | +**message** | **str** | A printable and localized message for this error | + +## Example + +```python +from flat_api.models.assignment_capabilities_can_publish_in_class_error import AssignmentCapabilitiesCanPublishInClassError + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentCapabilitiesCanPublishInClassError from a JSON string +assignment_capabilities_can_publish_in_class_error_instance = AssignmentCapabilitiesCanPublishInClassError.from_json(json) +# print the JSON string representation of the object +print(AssignmentCapabilitiesCanPublishInClassError.to_json()) + +# convert the object into a dict +assignment_capabilities_can_publish_in_class_error_dict = assignment_capabilities_can_publish_in_class_error_instance.to_dict() +# create an instance of AssignmentCapabilitiesCanPublishInClassError from a dict +assignment_capabilities_can_publish_in_class_error_from_dict = AssignmentCapabilitiesCanPublishInClassError.from_dict(assignment_capabilities_can_publish_in_class_error_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/AssignmentCopy.md b/docs/reference/AssignmentCopy.md similarity index 93% rename from docs/AssignmentCopy.md rename to docs/reference/AssignmentCopy.md index 6dae1a9..2becab4 100644 --- a/docs/AssignmentCopy.md +++ b/docs/reference/AssignmentCopy.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of AssignmentCopy from a JSON string assignment_copy_instance = AssignmentCopy.from_json(json) # print the JSON string representation of the object -print AssignmentCopy.to_json() +print(AssignmentCopy.to_json()) # convert the object into a dict assignment_copy_dict = assignment_copy_instance.to_dict() # create an instance of AssignmentCopy from a dict -assignment_copy_form_dict = assignment_copy.from_dict(assignment_copy_dict) +assignment_copy_from_dict = AssignmentCopy.from_dict(assignment_copy_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/reference/AssignmentCopyResponse.md b/docs/reference/AssignmentCopyResponse.md new file mode 100644 index 0000000..32e16f0 --- /dev/null +++ b/docs/reference/AssignmentCopyResponse.md @@ -0,0 +1,54 @@ +# AssignmentCopyResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the assignment | +**type** | [**AssignmentType**](AssignmentType.md) | | +**capabilities** | [**AssignmentCapabilities**](AssignmentCapabilities.md) | | +**title** | **str** | Title of the assignment | +**description** | **str** | Student instructions and content of the assignment (plain text) | [optional] +**description_html** | **str** | HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**teacher_instructions** | **str** | Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. | [optional] +**teacher_instructions_html** | **str** | HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**cover** | **str** | The URL of the cover to display | [optional] +**cover_file** | **str** | The id of the cover to display | [optional] +**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. | +**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] +**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] +**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] +**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] +**toolset** | **str** | The id of the associated toolset | [optional] +**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] +**restrict_play_note** | **bool** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] +**restrict_to_audio_tracks** | **bool** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] +**submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] +**recording_type** | **str** | For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. | [optional] +**allow_metronome** | **bool** | For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. | [optional] +**allow_backing_track** | **bool** | For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. | [optional] +**allow_speed_change** | **bool** | For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. | [optional] +**free_record** | **bool** | For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. | [optional] +**resource** | **str** | If this assignment is stored as a resource in the Flat for Education Resource Library, the unique identifier of the resource. | [optional] + +## Example + +```python +from flat_api.models.assignment_copy_response import AssignmentCopyResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentCopyResponse from a JSON string +assignment_copy_response_instance = AssignmentCopyResponse.from_json(json) +# print the JSON string representation of the object +print(AssignmentCopyResponse.to_json()) + +# convert the object into a dict +assignment_copy_response_dict = assignment_copy_response_instance.to_dict() +# create an instance of AssignmentCopyResponse from a dict +assignment_copy_response_from_dict = AssignmentCopyResponse.from_dict(assignment_copy_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/reference/AssignmentCopyToClass.md b/docs/reference/AssignmentCopyToClass.md new file mode 100644 index 0000000..d964d93 --- /dev/null +++ b/docs/reference/AssignmentCopyToClass.md @@ -0,0 +1,32 @@ +# AssignmentCopyToClass + +Copy the assignment to a class + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**classroom** | **str** | The destination classroom where the assignment will be copied | +**assignment** | **str** | An optional destination assignment where the original assignement will be copied. Must be a draft. | [optional] +**scheduled_date** | **datetime** | The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. Alternatively the existing `scheduledDate` from the copied assignment will be used. | [optional] + +## Example + +```python +from flat_api.models.assignment_copy_to_class import AssignmentCopyToClass + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentCopyToClass from a JSON string +assignment_copy_to_class_instance = AssignmentCopyToClass.from_json(json) +# print the JSON string representation of the object +print(AssignmentCopyToClass.to_json()) + +# convert the object into a dict +assignment_copy_to_class_dict = assignment_copy_to_class_instance.to_dict() +# create an instance of AssignmentCopyToClass from a dict +assignment_copy_to_class_from_dict = AssignmentCopyToClass.from_dict(assignment_copy_to_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/reference/AssignmentCopyToResourceLibrary.md b/docs/reference/AssignmentCopyToResourceLibrary.md new file mode 100644 index 0000000..2eab45e --- /dev/null +++ b/docs/reference/AssignmentCopyToResourceLibrary.md @@ -0,0 +1,31 @@ +# AssignmentCopyToResourceLibrary + +Copy the assignment to the EDU Resource Library + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**library_parent** | **str** | Identifier of the parent resource where the new one will created, e.g. a folder id or `root` | +**verify_if_not_already_in_resource_library** | **bool** | Option to check if the assignment is already in Resource Library | [optional] + +## Example + +```python +from flat_api.models.assignment_copy_to_resource_library import AssignmentCopyToResourceLibrary + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentCopyToResourceLibrary from a JSON string +assignment_copy_to_resource_library_instance = AssignmentCopyToResourceLibrary.from_json(json) +# print the JSON string representation of the object +print(AssignmentCopyToResourceLibrary.to_json()) + +# convert the object into a dict +assignment_copy_to_resource_library_dict = assignment_copy_to_resource_library_instance.to_dict() +# create an instance of AssignmentCopyToResourceLibrary from a dict +assignment_copy_to_resource_library_from_dict = AssignmentCopyToResourceLibrary.from_dict(assignment_copy_to_resource_library_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/reference/AssignmentGroup.md b/docs/reference/AssignmentGroup.md new file mode 100644 index 0000000..35baddf --- /dev/null +++ b/docs/reference/AssignmentGroup.md @@ -0,0 +1,33 @@ +# AssignmentGroup + +A group assigned to an assignment for shared writing assignments + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the group | +**name** | **str** | The display name of the group | +**parent** | **str** | The unique identifier of the parent class group. Only available for groups of type 'assignmentStudentsSubGroup'. May be null if the parent class group was deleted. | [optional] +**members** | **List[str]** | Array of user IDs that are members of this group | + +## Example + +```python +from flat_api.models.assignment_group import AssignmentGroup + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentGroup from a JSON string +assignment_group_instance = AssignmentGroup.from_json(json) +# print the JSON string representation of the object +print(AssignmentGroup.to_json()) + +# convert the object into a dict +assignment_group_dict = assignment_group_instance.to_dict() +# create an instance of AssignmentGroup from a dict +assignment_group_from_dict = AssignmentGroup.from_dict(assignment_group_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/AssignmentSubmission.md b/docs/reference/AssignmentSubmission.md similarity index 91% rename from docs/AssignmentSubmission.md rename to docs/reference/AssignmentSubmission.md index 046a326..64a4665 100644 --- a/docs/AssignmentSubmission.md +++ b/docs/reference/AssignmentSubmission.md @@ -20,7 +20,7 @@ Name | Type | Description | Notes **draft_grade** | **float** | Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission | [optional] **max_points** | **float** | Optional max points for the grade. If set, a corresponding `draftGrade` or `grade` will be set. | [optional] **exercises_ids** | **List[str]** | The ids of exercises when they need to be in a specific order | [optional] -**playback** | [**List[AssignmentSubmissionPlaybackInner]**](AssignmentSubmissionPlaybackInner.md) | | +**playback** | [**List[AssignmentSubmissionPlayback]**](AssignmentSubmissionPlayback.md) | | **comments** | [**AssignmentSubmissionComments**](AssignmentSubmissionComments.md) | | **google_classroom** | [**GoogleClassroomSubmission**](GoogleClassroomSubmission.md) | | [optional] **microsoft_graph** | [**MicrosoftGraphSubmission**](MicrosoftGraphSubmission.md) | | [optional] @@ -36,12 +36,12 @@ json = "{}" # create an instance of AssignmentSubmission from a JSON string assignment_submission_instance = AssignmentSubmission.from_json(json) # print the JSON string representation of the object -print AssignmentSubmission.to_json() +print(AssignmentSubmission.to_json()) # convert the object into a dict assignment_submission_dict = assignment_submission_instance.to_dict() # create an instance of AssignmentSubmission from a dict -assignment_submission_form_dict = assignment_submission.from_dict(assignment_submission_dict) +assignment_submission_from_dict = AssignmentSubmission.from_dict(assignment_submission_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/AssignmentSubmissionComment.md b/docs/reference/AssignmentSubmissionComment.md similarity index 89% rename from docs/AssignmentSubmissionComment.md rename to docs/reference/AssignmentSubmissionComment.md index ee903be..5944b32 100644 --- a/docs/AssignmentSubmissionComment.md +++ b/docs/reference/AssignmentSubmissionComment.md @@ -24,12 +24,12 @@ json = "{}" # create an instance of AssignmentSubmissionComment from a JSON string assignment_submission_comment_instance = AssignmentSubmissionComment.from_json(json) # print the JSON string representation of the object -print AssignmentSubmissionComment.to_json() +print(AssignmentSubmissionComment.to_json()) # convert the object into a dict assignment_submission_comment_dict = assignment_submission_comment_instance.to_dict() # create an instance of AssignmentSubmissionComment from a dict -assignment_submission_comment_form_dict = assignment_submission_comment.from_dict(assignment_submission_comment_dict) +assignment_submission_comment_from_dict = AssignmentSubmissionComment.from_dict(assignment_submission_comment_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/AssignmentSubmissionCommentCreation.md b/docs/reference/AssignmentSubmissionCommentCreation.md similarity index 83% rename from docs/AssignmentSubmissionCommentCreation.md rename to docs/reference/AssignmentSubmissionCommentCreation.md index 68a7471..9956c8b 100644 --- a/docs/AssignmentSubmissionCommentCreation.md +++ b/docs/reference/AssignmentSubmissionCommentCreation.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of AssignmentSubmissionCommentCreation from a JSON string assignment_submission_comment_creation_instance = AssignmentSubmissionCommentCreation.from_json(json) # print the JSON string representation of the object -print AssignmentSubmissionCommentCreation.to_json() +print(AssignmentSubmissionCommentCreation.to_json()) # convert the object into a dict assignment_submission_comment_creation_dict = assignment_submission_comment_creation_instance.to_dict() # create an instance of AssignmentSubmissionCommentCreation from a dict -assignment_submission_comment_creation_form_dict = assignment_submission_comment_creation.from_dict(assignment_submission_comment_creation_dict) +assignment_submission_comment_creation_from_dict = AssignmentSubmissionCommentCreation.from_dict(assignment_submission_comment_creation_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/AssignmentSubmissionComments.md b/docs/reference/AssignmentSubmissionComments.md similarity index 86% rename from docs/AssignmentSubmissionComments.md rename to docs/reference/AssignmentSubmissionComments.md index 900dc34..3f37ff6 100644 --- a/docs/AssignmentSubmissionComments.md +++ b/docs/reference/AssignmentSubmissionComments.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of AssignmentSubmissionComments from a JSON string assignment_submission_comments_instance = AssignmentSubmissionComments.from_json(json) # print the JSON string representation of the object -print AssignmentSubmissionComments.to_json() +print(AssignmentSubmissionComments.to_json()) # convert the object into a dict assignment_submission_comments_dict = assignment_submission_comments_instance.to_dict() # create an instance of AssignmentSubmissionComments from a dict -assignment_submission_comments_form_dict = assignment_submission_comments.from_dict(assignment_submission_comments_dict) +assignment_submission_comments_from_dict = AssignmentSubmissionComments.from_dict(assignment_submission_comments_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/AssignmentSubmissionHistory.md b/docs/reference/AssignmentSubmissionHistory.md similarity index 93% rename from docs/AssignmentSubmissionHistory.md rename to docs/reference/AssignmentSubmissionHistory.md index d3a3b57..4fe0149 100644 --- a/docs/AssignmentSubmissionHistory.md +++ b/docs/reference/AssignmentSubmissionHistory.md @@ -30,12 +30,12 @@ json = "{}" # create an instance of AssignmentSubmissionHistory from a JSON string assignment_submission_history_instance = AssignmentSubmissionHistory.from_json(json) # print the JSON string representation of the object -print AssignmentSubmissionHistory.to_json() +print(AssignmentSubmissionHistory.to_json()) # convert the object into a dict assignment_submission_history_dict = assignment_submission_history_instance.to_dict() # create an instance of AssignmentSubmissionHistory from a dict -assignment_submission_history_form_dict = assignment_submission_history.from_dict(assignment_submission_history_dict) +assignment_submission_history_from_dict = AssignmentSubmissionHistory.from_dict(assignment_submission_history_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/AssignmentSubmissionHistoryAttachment.md b/docs/reference/AssignmentSubmissionHistoryAttachment.md similarity index 85% rename from docs/AssignmentSubmissionHistoryAttachment.md rename to docs/reference/AssignmentSubmissionHistoryAttachment.md index 047e17f..cda916f 100644 --- a/docs/AssignmentSubmissionHistoryAttachment.md +++ b/docs/reference/AssignmentSubmissionHistoryAttachment.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of AssignmentSubmissionHistoryAttachment from a JSON string assignment_submission_history_attachment_instance = AssignmentSubmissionHistoryAttachment.from_json(json) # print the JSON string representation of the object -print AssignmentSubmissionHistoryAttachment.to_json() +print(AssignmentSubmissionHistoryAttachment.to_json()) # convert the object into a dict assignment_submission_history_attachment_dict = assignment_submission_history_attachment_instance.to_dict() # create an instance of AssignmentSubmissionHistoryAttachment from a dict -assignment_submission_history_attachment_form_dict = assignment_submission_history_attachment.from_dict(assignment_submission_history_attachment_dict) +assignment_submission_history_attachment_from_dict = AssignmentSubmissionHistoryAttachment.from_dict(assignment_submission_history_attachment_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/AssignmentSubmissionHistoryState.md b/docs/reference/AssignmentSubmissionHistoryState.md similarity index 57% rename from docs/AssignmentSubmissionHistoryState.md rename to docs/reference/AssignmentSubmissionHistoryState.md index 93bd1c7..c9f2a33 100644 --- a/docs/AssignmentSubmissionHistoryState.md +++ b/docs/reference/AssignmentSubmissionHistoryState.md @@ -2,10 +2,17 @@ State of the submission history -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `CREATED` (value: `'created'`) + +* `TURNEDIN` (value: `'turnedIn'`) + +* `RETURNED` (value: `'returned'`) + +* `GRADED` (value: `'graded'`) + +* `RESET` (value: `'reset'`) [[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/AssignmentSubmissionLti.md b/docs/reference/AssignmentSubmissionLti.md similarity index 66% rename from docs/AssignmentSubmissionLti.md rename to docs/reference/AssignmentSubmissionLti.md index a7068d6..ccc5e59 100644 --- a/docs/AssignmentSubmissionLti.md +++ b/docs/reference/AssignmentSubmissionLti.md @@ -1,11 +1,13 @@ # AssignmentSubmissionLti +If set, this submission has a linked LTI 1.3 AGS or LTI 1.1 Outcomes ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**sourcedid** | **str** | The sourcedid of the LTI submission when using LTI Outcomes | +**grade_service** | **str** | The kind of grading service available for this submission: - `ags2p0`: LTI 1.3 Assignment and Grade Services 2.0 - `outcomes1p1`: LTI 1.1 Outcomes 1.1 | +**sourcedid** | **str** | The sourcedid of the LTI submission when using LTI Outcomes | [optional] ## Example @@ -17,12 +19,12 @@ json = "{}" # create an instance of AssignmentSubmissionLti from a JSON string assignment_submission_lti_instance = AssignmentSubmissionLti.from_json(json) # print the JSON string representation of the object -print AssignmentSubmissionLti.to_json() +print(AssignmentSubmissionLti.to_json()) # convert the object into a dict assignment_submission_lti_dict = assignment_submission_lti_instance.to_dict() # create an instance of AssignmentSubmissionLti from a dict -assignment_submission_lti_form_dict = assignment_submission_lti.from_dict(assignment_submission_lti_dict) +assignment_submission_lti_from_dict = AssignmentSubmissionLti.from_dict(assignment_submission_lti_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/reference/AssignmentSubmissionPlayback.md b/docs/reference/AssignmentSubmissionPlayback.md new file mode 100644 index 0000000..b82e46b --- /dev/null +++ b/docs/reference/AssignmentSubmissionPlayback.md @@ -0,0 +1,31 @@ +# AssignmentSubmissionPlayback + +Playback used by a student for an assignment submission. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**score** | **str** | The score unique identifier | +**nb_play_attempt** | **float** | Number of times the score was played | + +## Example + +```python +from flat_api.models.assignment_submission_playback import AssignmentSubmissionPlayback + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentSubmissionPlayback from a JSON string +assignment_submission_playback_instance = AssignmentSubmissionPlayback.from_json(json) +# print the JSON string representation of the object +print(AssignmentSubmissionPlayback.to_json()) + +# convert the object into a dict +assignment_submission_playback_dict = assignment_submission_playback_instance.to_dict() +# create an instance of AssignmentSubmissionPlayback from a dict +assignment_submission_playback_from_dict = AssignmentSubmissionPlayback.from_dict(assignment_submission_playback_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/AssignmentSubmissionState.md b/docs/reference/AssignmentSubmissionState.md similarity index 60% rename from docs/AssignmentSubmissionState.md rename to docs/reference/AssignmentSubmissionState.md index 950f780..8477fcd 100644 --- a/docs/AssignmentSubmissionState.md +++ b/docs/reference/AssignmentSubmissionState.md @@ -2,10 +2,15 @@ State of the submission -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `CREATED` (value: `'created'`) + +* `TURNEDIN` (value: `'turnedIn'`) + +* `RETURNED` (value: `'returned'`) + +* `GRADED` (value: `'graded'`) [[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/reference/AssignmentSubmissionStudentsMode.md b/docs/reference/AssignmentSubmissionStudentsMode.md new file mode 100644 index 0000000..1457272 --- /dev/null +++ b/docs/reference/AssignmentSubmissionStudentsMode.md @@ -0,0 +1,13 @@ +# AssignmentSubmissionStudentsMode + +Submission mode for assignments: - \"single\": Individual submissions (default) - \"group\": Group submissions (for shared writing assignments) + +## Enum + +* `SINGLE` (value: `'single'`) + +* `GROUP` (value: `'group'`) + +[[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/AssignmentSubmissionUpdate.md b/docs/reference/AssignmentSubmissionUpdate.md similarity index 85% rename from docs/AssignmentSubmissionUpdate.md rename to docs/reference/AssignmentSubmissionUpdate.md index 71c8c69..57c1166 100644 --- a/docs/AssignmentSubmissionUpdate.md +++ b/docs/reference/AssignmentSubmissionUpdate.md @@ -7,6 +7,7 @@ Assignment Submission creation Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attachments** | [**List[ClassAttachmentCreation]**](ClassAttachmentCreation.md) | | [optional] +**playback** | [**List[AssignmentSubmissionPlayback]**](AssignmentSubmissionPlayback.md) | | [optional] **submit** | **bool** | If `true`, the submission will be marked as done | [optional] **draft_grade** | **float** | Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission | [optional] **grade** | **float** | Optional grade. If unset, no grade was set. | [optional] @@ -23,12 +24,12 @@ json = "{}" # create an instance of AssignmentSubmissionUpdate from a JSON string assignment_submission_update_instance = AssignmentSubmissionUpdate.from_json(json) # print the JSON string representation of the object -print AssignmentSubmissionUpdate.to_json() +print(AssignmentSubmissionUpdate.to_json()) # convert the object into a dict assignment_submission_update_dict = assignment_submission_update_instance.to_dict() # create an instance of AssignmentSubmissionUpdate from a dict -assignment_submission_update_form_dict = assignment_submission_update.from_dict(assignment_submission_update_dict) +assignment_submission_update_from_dict = AssignmentSubmissionUpdate.from_dict(assignment_submission_update_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/reference/AssignmentType.md b/docs/reference/AssignmentType.md new file mode 100644 index 0000000..38a4606 --- /dev/null +++ b/docs/reference/AssignmentType.md @@ -0,0 +1,23 @@ +# AssignmentType + +Type of the assignment + +## Enum + +* `NONE` (value: `'none'`) + +* `NEWSCORE` (value: `'newScore'`) + +* `SCORETEMPLATE` (value: `'scoreTemplate'`) + +* `SHAREDWRITING` (value: `'sharedWriting'`) + +* `WORKSHEET` (value: `'worksheet'`) + +* `WORKSHEETTEXT` (value: `'worksheetText'`) + +* `PERFORMANCE` (value: `'performance'`) + +[[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/reference/AssignmentUpdate.md b/docs/reference/AssignmentUpdate.md new file mode 100644 index 0000000..8de92e4 --- /dev/null +++ b/docs/reference/AssignmentUpdate.md @@ -0,0 +1,51 @@ +# AssignmentUpdate + +Assignment Resource Editing + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**AssignmentType**](AssignmentType.md) | | [optional] +**title** | **str** | Title of the assignment | [optional] +**description** | **str** | Student instructions and content of the assignment (plain text) | [optional] +**description_html** | **str** | HTML version of student instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. | [optional] +**teacher_instructions** | **str** | Teacher-only instructions (plain text) | [optional] +**teacher_instructions_html** | **str** | HTML version of teacher-only instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. | [optional] +**attachments** | [**List[ClassAttachmentCreation]**](ClassAttachmentCreation.md) | The complete attachment list. Omitting this property on an update leaves the existing attachments alone; sending it replaces them. Dropping a dedicated score from the list deletes the students' copies of it, so send the full set you want to keep rather than only the additions. Duplicates, judged by `url`, `score`, `worksheet` or `googleDriveFileId`, are discarded silently, and exceeding the per-assignment limit fails with `ASSIGNMENT_ATTACHMENTS_LIMIT`. | [optional] +**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] +**restrict_play_note** | **bool** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] +**restrict_to_audio_tracks** | **bool** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] +**toolset** | **str** | The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. | [optional] +**cover_file** | **str** | The id of the cover to display | [optional] +**cover** | **str** | The URL of the cover to display | [optional] +**max_points** | **float** | If set, the grading will be enabled for the assignement with this value as the maximum of points | [optional] +**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] +**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] +**submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] +**recording_type** | **str** | For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. | [optional] +**allow_metronome** | **bool** | For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. | [optional] +**allow_backing_track** | **bool** | For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. | [optional] +**allow_speed_change** | **bool** | For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. | [optional] +**free_record** | **bool** | For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. | [optional] + +## Example + +```python +from flat_api.models.assignment_update import AssignmentUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of AssignmentUpdate from a JSON string +assignment_update_instance = AssignmentUpdate.from_json(json) +# print the JSON string representation of the object +print(AssignmentUpdate.to_json()) + +# convert the object into a dict +assignment_update_dict = assignment_update_instance.to_dict() +# create an instance of AssignmentUpdate from a dict +assignment_update_from_dict = AssignmentUpdate.from_dict(assignment_update_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/ClassApi.md b/docs/reference/ClassApi.md similarity index 87% rename from docs/ClassApi.md rename to docs/reference/ClassApi.md index b9eaabe..94a9039 100644 --- a/docs/ClassApi.md +++ b/docs/reference/ClassApi.md @@ -13,6 +13,7 @@ Method | HTTP request | Description [**create_class_assignment**](ClassApi.md#create_class_assignment) | **POST** /classes/{class}/assignments | Assignment creation [**create_submission**](ClassApi.md#create_submission) | **PUT** /classes/{class}/assignments/{assignment}/submissions | Create or edit a submission [**create_test_student_account**](ClassApi.md#create_test_student_account) | **POST** /classes/{class}/testStudent | Create a test student account +[**delete_assignment**](ClassApi.md#delete_assignment) | **DELETE** /classes/{class}/assignments/{assignment} | Delete an assignment [**delete_class_user**](ClassApi.md#delete_class_user) | **DELETE** /classes/{class}/users/{user} | Remove a user from the class [**delete_submission**](ClassApi.md#delete_submission) | **DELETE** /classes/{class}/assignments/{assignment}/submissions/{submission} | Reset a submission [**delete_submission_comment**](ClassApi.md#delete_submission_comment) | **DELETE** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment} | Delete a feedback comment to a submission @@ -20,6 +21,7 @@ Method | HTTP request | Description [**enroll_class**](ClassApi.md#enroll_class) | **POST** /classes/enroll/{enrollmentCode} | Join a class [**export_submissions_reviews_as_csv**](ClassApi.md#export_submissions_reviews_as_csv) | **GET** /classes/{class}/assignments/{assignment}/submissions/csv | CSV Grades exports [**export_submissions_reviews_as_excel**](ClassApi.md#export_submissions_reviews_as_excel) | **GET** /classes/{class}/assignments/{assignment}/submissions/excel | Excel Grades exports +[**get_assignment**](ClassApi.md#get_assignment) | **GET** /classes/{class}/assignments/{assignment} | Get an assignment [**get_class**](ClassApi.md#get_class) | **GET** /classes/{class} | Get the details of a single class [**get_score_submissions**](ClassApi.md#get_score_submissions) | **GET** /scores/{score}/submissions | List submissions related to the score [**get_submission**](ClassApi.md#get_submission) | **GET** /classes/{class}/assignments/{assignment}/submissions/{submission} | Get a student submission @@ -33,6 +35,7 @@ Method | HTTP request | Description [**unarchive_assignment**](ClassApi.md#unarchive_assignment) | **DELETE** /classes/{class}/assignments/{assignment}/archive | Unarchive the assignment. [**unarchive_class**](ClassApi.md#unarchive_class) | **DELETE** /classes/{class}/archive | Unarchive the class [**update_class**](ClassApi.md#update_class) | **PUT** /classes/{class} | Update the class +[**update_class_assignment**](ClassApi.md#update_class_assignment) | **PUT** /classes/{class}/assignments/{assignment} | Update an assignment [**update_submission_comment**](ClassApi.md#update_submission_comment) | **PUT** /classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment} | Update a feedback comment to a submission @@ -41,7 +44,8 @@ Method | HTTP request | Description Activate the class -Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI. +Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI. + ### Example @@ -117,7 +121,12 @@ Name | Type | Description | Notes Add a user to the class -This method can be used by a teacher of the class to enroll another Flat user into the class. Only users that are part of your Organization can be enrolled in a class of this same Organization. When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization. +This method can be used by a teacher of the class to enroll another Flat user into the class. + +Only users that are part of your Organization can be enrolled in a class of this same Organization. + +When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization. + ### Example @@ -192,7 +201,8 @@ void (empty response body) Archive the assignment -Archive the assignment +Archive the assignment + ### Example @@ -270,7 +280,8 @@ Name | Type | Description | Notes Archive the class -Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. +Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + ### Example @@ -346,7 +357,12 @@ Name | Type | Description | Notes Copy an assignment -Copy an assignment to a specified class or the resource library For class assignments: - If the original assignment has a due date in the past, this new assignment will be created without a due date. - If the class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app. +Copy an assignment to a specified class or the resource library + +For class assignments: +- If the original assignment has a due date in the past, this new assignment will be created without a due date. +- If the class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app. + ### Example @@ -427,7 +443,14 @@ Name | Type | Description | Notes Create a new class -Classrooms on Flat allow you to create activities with assignments and post content to a specific group. When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group. If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated. You can add users to this class using `PUT /classes/{class}/users/{user}`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/{enrollmentCode}` and the `enrollmentCode` returned in the `ClassDetails` response. +Classrooms on Flat allow you to create activities with assignments and post content to a specific group. + +When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group. + +If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated. + +You can add users to this class using `PUT /classes/{class}/users/{user}`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/{enrollmentCode}` and the `enrollmentCode` returned in the `ClassDetails` response. + ### Example @@ -505,7 +528,10 @@ Name | Type | Description | Notes Assignment creation -Use this method as a teacher to create and post a new assignment to a class. If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course. +Use this method as a teacher to create and post a new assignment to a class. + +If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course. + ### Example @@ -584,7 +610,10 @@ Name | Type | Description | Notes Create or edit a submission -Use this method as a student to create, update and submit a submission related to an assignment. Students can only set `attachments` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id. +Use this method as a student to create, update and submit a submission related to an assignment. +Students can only set `attachments` and `submit`. +Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id. + ### Example @@ -665,7 +694,12 @@ Name | Type | Description | Notes Create a test student account -Test students account can be created by teachers an admin and be used to experiment the assignments. - They are automatically added to the class. - They can be reset using this API endpoint (a new account will be created and the previous one scheduled for deletion). - These accounts don't use a user license. +Test students account can be created by teachers an admin and be used to experiment the assignments. + +- They are automatically added to the class. +- They can be reset using this API endpoint (a new account will be created and the previous one scheduled for deletion). +- These accounts don't use a user license. + ### Example @@ -738,12 +772,101 @@ 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) +# **delete_assignment** +> delete_assignment(var_class, assignment) + +Delete an assignment + +Delete an assignment. This cannot be undone, and it removes a good deal more than the +assignment itself: every submission made against it, the students' dedicated copies of the +attached scores, the related class stream posts and notifications, and the editor toolset. + +When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is +deleted there too. + +Requires the teacher role on the class, and the class must not be archived. + +`archiveAssignment` is almost always what you want instead: it takes the assignment out of +the class stream and keeps the submissions and their grades. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.ClassApi(api_client) + var_class = 'var_class_example' # str | Unique identifier of the class + assignment = 'assignment_example' # str | Unique identifier of the assignment + + try: + # Delete an assignment + api_instance.delete_assignment(var_class, assignment) + except Exception as e: + print("Exception when calling ClassApi->delete_assignment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **var_class** | **str**| Unique identifier of the class | + **assignment** | **str**| Unique identifier of the assignment | + +### Return type + +void (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | The assignment has been deleted | - | +**0** | Error | - | + +[[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) + # **delete_class_user** > delete_class_user(var_class, user) Remove a user from the class -This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. +This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. + +Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + ### Example @@ -818,7 +941,8 @@ void (empty response body) Reset a submission -Use this method as a teacher to reset a submission and allow student to start over the assignment +Use this method as a teacher to reset a submission and allow student to start over the assignment + ### Example @@ -975,7 +1099,9 @@ void (empty response body) Edit a submission -Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` +Use this method as a teacher to update the different submission and give feedback. +Teachers can only set `return`, `draftGrade` and `grade` + ### Example @@ -1058,7 +1184,10 @@ Name | Type | Description | Notes Join a class -Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. +Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. + +Flat will automatically add the user to the corresponding class group based on this role in the organization. + ### Example @@ -1130,7 +1259,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) # **export_submissions_reviews_as_csv** -> bytearray export_submissions_reviews_as_csv(var_class, assignment) +> bytes export_submissions_reviews_as_csv(var_class, assignment) CSV Grades exports @@ -1186,7 +1315,7 @@ Name | Type | Description | Notes ### Return type -**bytearray** +**bytes** ### Authorization @@ -1207,7 +1336,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) # **export_submissions_reviews_as_excel** -> bytearray export_submissions_reviews_as_excel(var_class, assignment) +> bytes export_submissions_reviews_as_excel(var_class, assignment) Excel Grades exports @@ -1263,7 +1392,7 @@ Name | Type | Description | Notes ### Return type -**bytearray** +**bytes** ### Authorization @@ -1283,6 +1412,89 @@ 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) +# **get_assignment** +> Assignment get_assignment(var_class, assignment) + +Get an assignment + +Retrieve a single assignment, including its attachments, its toolset and its grading +settings. Use `listAssignments` to enumerate the assignments of a class. + +A teacher of the class sees the assignment as authored. A student sees the same document +with the teacher-only fields omitted, `teacherInstructions` among them. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.assignment import Assignment +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.ClassApi(api_client) + var_class = 'var_class_example' # str | Unique identifier of the class + assignment = 'assignment_example' # str | Unique identifier of the assignment + + try: + # Get an assignment + api_response = api_instance.get_assignment(var_class, assignment) + print("The response of ClassApi->get_assignment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ClassApi->get_assignment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **var_class** | **str**| Unique identifier of the class | + **assignment** | **str**| Unique identifier of the assignment | + +### Return type + +[**Assignment**](Assignment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The assignment has been retrieved | - | +**0** | Error | - | + +[[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) + # **get_class** > ClassDetails get_class(var_class) @@ -1362,7 +1574,8 @@ Name | Type | Description | Notes List submissions related to the score -This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. +This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + ### Example @@ -1596,7 +1809,8 @@ Name | Type | Description | Notes Get the history of the submission -For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. +For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. + ### Example @@ -1828,7 +2042,8 @@ Name | Type | Description | Notes List the submissions for a student -Use this method as a teacher to list all the assignment submissions sent by a student of the class +Use this method as a teacher to list all the assignment submissions sent by a student of the class + ### Example @@ -2063,7 +2278,8 @@ Name | Type | Description | Notes Unarchive the assignment. -Mark the assignment as `active`. +Mark the assignment as `active`. + ### Example @@ -2141,7 +2357,8 @@ Name | Type | Description | Notes Unarchive the class -Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. +Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + ### Example @@ -2217,7 +2434,8 @@ Name | Type | Description | Notes Update the class -Update the meta information of the class +Update the meta information of the class + ### Example @@ -2291,6 +2509,96 @@ 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) +# **update_class_assignment** +> Assignment update_class_assignment(var_class, assignment, body) + +Update an assignment + +Update an assignment. Only the properties present in the request body are modified, so a +partial body leaves everything else as it was. `attachments` is the exception: when present +it replaces the whole list. + +Requires the teacher role on the class. The class must not be archived, and an assignment +that is already `active` cannot be moved back to `draft`. + +Editing an assignment that students have already started does not reset their submissions. +To take an assignment out of circulation while keeping the work, use `archiveAssignment`. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.assignment import Assignment +from flat_api.models.class_assignment_update import ClassAssignmentUpdate +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.ClassApi(api_client) + var_class = 'var_class_example' # str | Unique identifier of the class + assignment = 'assignment_example' # str | Unique identifier of the assignment + body = flat_api.ClassAssignmentUpdate() # ClassAssignmentUpdate | + + try: + # Update an assignment + api_response = api_instance.update_class_assignment(var_class, assignment, body) + print("The response of ClassApi->update_class_assignment:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling ClassApi->update_class_assignment: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **var_class** | **str**| Unique identifier of the class | + **assignment** | **str**| Unique identifier of the assignment | + **body** | [**ClassAssignmentUpdate**](ClassAssignmentUpdate.md)| | + +### Return type + +[**Assignment**](Assignment.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The assignment has been updated | - | +**0** | Error | - | + +[[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) + # **update_submission_comment** > AssignmentSubmissionComment update_submission_comment(var_class, assignment, submission, comment, assignment_submission_comment_creation) diff --git a/docs/reference/ClassAssignment.md b/docs/reference/ClassAssignment.md new file mode 100644 index 0000000..83d60d9 --- /dev/null +++ b/docs/reference/ClassAssignment.md @@ -0,0 +1,69 @@ +# ClassAssignment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the assignment | +**type** | [**AssignmentType**](AssignmentType.md) | | +**capabilities** | [**AssignmentCapabilities**](AssignmentCapabilities.md) | | +**title** | **str** | Title of the assignment | +**description** | **str** | Student instructions and content of the assignment (plain text) | [optional] +**description_html** | **str** | HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**teacher_instructions** | **str** | Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. | [optional] +**teacher_instructions_html** | **str** | HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**cover** | **str** | The URL of the cover to display | [optional] +**cover_file** | **str** | The id of the cover to display | [optional] +**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. | +**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] +**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] +**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] +**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] +**toolset** | **str** | The id of the associated toolset | [optional] +**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] +**restrict_play_note** | **bool** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] +**restrict_to_audio_tracks** | **bool** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] +**submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] +**recording_type** | **str** | For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. | [optional] +**allow_metronome** | **bool** | For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. | [optional] +**allow_backing_track** | **bool** | For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. | [optional] +**allow_speed_change** | **bool** | For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. | [optional] +**free_record** | **bool** | For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. | [optional] +**creator** | **str** | The User unique identifier of the creator of this assignment | [optional] +**state** | **str** | State of the assignment | +**classroom** | **str** | The unique identifier of the class where this assignment was posted | [optional] +**creation_date** | **datetime** | The creation date of this assignment | +**scheduled_date** | **datetime** | The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. | [optional] +**due_date** | **datetime** | The due date of this assignment, late submissions will be marked as paste due. | [optional] +**assignee_mode** | **str** | Possible modes of assigning assignments | [optional] +**assigned_students** | **List[str]** | Identifiers for the students that have access to the assignment | [optional] +**assigned_groups** | [**List[AssignmentGroup]**](AssignmentGroup.md) | Groups that have access to the assignment (for shared writing assignments) | [optional] +**submissions** | [**List[AssignmentSubmission]**](AssignmentSubmission.md) | | +**google_classroom** | [**GoogleClassroomCoursework**](GoogleClassroomCoursework.md) | | [optional] +**microsoft_graph** | [**MicrosoftGraphAssignment**](MicrosoftGraphAssignment.md) | | [optional] +**mfc** | [**ClassAssignmentAllOfMfc**](ClassAssignmentAllOfMfc.md) | | [optional] +**canvas** | [**ClassAssignmentAllOfCanvas**](ClassAssignmentAllOfCanvas.md) | | [optional] +**lti** | [**ClassAssignmentAllOfLti**](ClassAssignmentAllOfLti.md) | | [optional] +**issue** | **str** | Detected issue for this assignment | [optional] + +## Example + +```python +from flat_api.models.class_assignment import ClassAssignment + +# TODO update the JSON string below +json = "{}" +# create an instance of ClassAssignment from a JSON string +class_assignment_instance = ClassAssignment.from_json(json) +# print the JSON string representation of the object +print(ClassAssignment.to_json()) + +# convert the object into a dict +class_assignment_dict = class_assignment_instance.to_dict() +# create an instance of ClassAssignment from a dict +class_assignment_from_dict = ClassAssignment.from_dict(class_assignment_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/ClassAssignmentCanvas.md b/docs/reference/ClassAssignmentAllOfCanvas.md similarity index 51% rename from docs/ClassAssignmentCanvas.md rename to docs/reference/ClassAssignmentAllOfCanvas.md index f659c0d..31a09c1 100644 --- a/docs/ClassAssignmentCanvas.md +++ b/docs/reference/ClassAssignmentAllOfCanvas.md @@ -1,4 +1,4 @@ -# ClassAssignmentCanvas +# ClassAssignmentAllOfCanvas A Canvas LMS assignment @@ -12,19 +12,19 @@ Name | Type | Description | Notes ## Example ```python -from flat_api.models.class_assignment_canvas import ClassAssignmentCanvas +from flat_api.models.class_assignment_all_of_canvas import ClassAssignmentAllOfCanvas # TODO update the JSON string below json = "{}" -# create an instance of ClassAssignmentCanvas from a JSON string -class_assignment_canvas_instance = ClassAssignmentCanvas.from_json(json) +# create an instance of ClassAssignmentAllOfCanvas from a JSON string +class_assignment_all_of_canvas_instance = ClassAssignmentAllOfCanvas.from_json(json) # print the JSON string representation of the object -print ClassAssignmentCanvas.to_json() +print(ClassAssignmentAllOfCanvas.to_json()) # convert the object into a dict -class_assignment_canvas_dict = class_assignment_canvas_instance.to_dict() -# create an instance of ClassAssignmentCanvas from a dict -class_assignment_canvas_form_dict = class_assignment_canvas.from_dict(class_assignment_canvas_dict) +class_assignment_all_of_canvas_dict = class_assignment_all_of_canvas_instance.to_dict() +# create an instance of ClassAssignmentAllOfCanvas from a dict +class_assignment_all_of_canvas_from_dict = ClassAssignmentAllOfCanvas.from_dict(class_assignment_all_of_canvas_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/reference/ClassAssignmentAllOfLti.md b/docs/reference/ClassAssignmentAllOfLti.md new file mode 100644 index 0000000..faa6978 --- /dev/null +++ b/docs/reference/ClassAssignmentAllOfLti.md @@ -0,0 +1,30 @@ +# ClassAssignmentAllOfLti + +An LTI assignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Resource ID in the LMS | [optional] + +## Example + +```python +from flat_api.models.class_assignment_all_of_lti import ClassAssignmentAllOfLti + +# TODO update the JSON string below +json = "{}" +# create an instance of ClassAssignmentAllOfLti from a JSON string +class_assignment_all_of_lti_instance = ClassAssignmentAllOfLti.from_json(json) +# print the JSON string representation of the object +print(ClassAssignmentAllOfLti.to_json()) + +# convert the object into a dict +class_assignment_all_of_lti_dict = class_assignment_all_of_lti_instance.to_dict() +# create an instance of ClassAssignmentAllOfLti from a dict +class_assignment_all_of_lti_from_dict = ClassAssignmentAllOfLti.from_dict(class_assignment_all_of_lti_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/ClassAssignmentMfc.md b/docs/reference/ClassAssignmentAllOfMfc.md similarity index 53% rename from docs/ClassAssignmentMfc.md rename to docs/reference/ClassAssignmentAllOfMfc.md index b7aef23..7347513 100644 --- a/docs/ClassAssignmentMfc.md +++ b/docs/reference/ClassAssignmentAllOfMfc.md @@ -1,4 +1,4 @@ -# ClassAssignmentMfc +# ClassAssignmentAllOfMfc A MusicFirst Classroom assignment @@ -12,19 +12,19 @@ Name | Type | Description | Notes ## Example ```python -from flat_api.models.class_assignment_mfc import ClassAssignmentMfc +from flat_api.models.class_assignment_all_of_mfc import ClassAssignmentAllOfMfc # TODO update the JSON string below json = "{}" -# create an instance of ClassAssignmentMfc from a JSON string -class_assignment_mfc_instance = ClassAssignmentMfc.from_json(json) +# create an instance of ClassAssignmentAllOfMfc from a JSON string +class_assignment_all_of_mfc_instance = ClassAssignmentAllOfMfc.from_json(json) # print the JSON string representation of the object -print ClassAssignmentMfc.to_json() +print(ClassAssignmentAllOfMfc.to_json()) # convert the object into a dict -class_assignment_mfc_dict = class_assignment_mfc_instance.to_dict() -# create an instance of ClassAssignmentMfc from a dict -class_assignment_mfc_form_dict = class_assignment_mfc.from_dict(class_assignment_mfc_dict) +class_assignment_all_of_mfc_dict = class_assignment_all_of_mfc_instance.to_dict() +# create an instance of ClassAssignmentAllOfMfc from a dict +class_assignment_all_of_mfc_from_dict = ClassAssignmentAllOfMfc.from_dict(class_assignment_all_of_mfc_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/reference/ClassAssignmentUpdate.md b/docs/reference/ClassAssignmentUpdate.md new file mode 100644 index 0000000..222228a --- /dev/null +++ b/docs/reference/ClassAssignmentUpdate.md @@ -0,0 +1,58 @@ +# ClassAssignmentUpdate + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**AssignmentType**](AssignmentType.md) | | [optional] +**title** | **str** | Title of the assignment | [optional] +**description** | **str** | Student instructions and content of the assignment (plain text) | [optional] +**description_html** | **str** | HTML version of student instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. | [optional] +**teacher_instructions** | **str** | Teacher-only instructions (plain text) | [optional] +**teacher_instructions_html** | **str** | HTML version of teacher-only instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. | [optional] +**attachments** | [**List[ClassAttachmentCreation]**](ClassAttachmentCreation.md) | The complete attachment list. Omitting this property on an update leaves the existing attachments alone; sending it replaces them. Dropping a dedicated score from the list deletes the students' copies of it, so send the full set you want to keep rather than only the additions. Duplicates, judged by `url`, `score`, `worksheet` or `googleDriveFileId`, are discarded silently, and exceeding the per-assignment limit fails with `ASSIGNMENT_ATTACHMENTS_LIMIT`. | [optional] +**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] +**restrict_play_note** | **bool** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] +**restrict_to_audio_tracks** | **bool** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] +**toolset** | **str** | The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. | [optional] +**cover_file** | **str** | The id of the cover to display | [optional] +**cover** | **str** | The URL of the cover to display | [optional] +**max_points** | **float** | If set, the grading will be enabled for the assignement with this value as the maximum of points | [optional] +**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] +**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] +**submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] +**recording_type** | **str** | For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. | [optional] +**allow_metronome** | **bool** | For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. | [optional] +**allow_backing_track** | **bool** | For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. | [optional] +**allow_speed_change** | **bool** | For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. | [optional] +**free_record** | **bool** | For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. | [optional] +**state** | **str** | State of the assignment | [optional] +**due_date** | **datetime** | The due date of this assignment, late submissions will be marked as paste due. If not set, the assignment won't have a due date. | [optional] +**scheduled_date** | **datetime** | The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. | [optional] +**google_classroom** | [**ClassAssignmentUpdateAllOfGoogleClassroom**](ClassAssignmentUpdateAllOfGoogleClassroom.md) | | [optional] +**microsoft_graph** | [**ClassAssignmentUpdateAllOfMicrosoftGraph**](ClassAssignmentUpdateAllOfMicrosoftGraph.md) | | [optional] +**assignee_mode** | **str** | Possible modes of assigning assignments | [optional] +**assigned_students** | **List[str]** | Identifiers for the students that have access to the assignment | [optional] +**class_group_ids** | **List[str]** | Optional list of specific class group IDs to apply to the assignment. When transitioning to active state with group submission mode: - If provided: Only these specific groups will be applied - If not provided: All class groups will be applied, or randomized groups created if none exist | [optional] + +## Example + +```python +from flat_api.models.class_assignment_update import ClassAssignmentUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of ClassAssignmentUpdate from a JSON string +class_assignment_update_instance = ClassAssignmentUpdate.from_json(json) +# print the JSON string representation of the object +print(ClassAssignmentUpdate.to_json()) + +# convert the object into a dict +class_assignment_update_dict = class_assignment_update_instance.to_dict() +# create an instance of ClassAssignmentUpdate from a dict +class_assignment_update_from_dict = ClassAssignmentUpdate.from_dict(class_assignment_update_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/reference/ClassAssignmentUpdateAllOfGoogleClassroom.md b/docs/reference/ClassAssignmentUpdateAllOfGoogleClassroom.md new file mode 100644 index 0000000..a55a0be --- /dev/null +++ b/docs/reference/ClassAssignmentUpdateAllOfGoogleClassroom.md @@ -0,0 +1,30 @@ +# ClassAssignmentUpdateAllOfGoogleClassroom + +Google Classroom options for this assignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**topic_id** | **str** | Identifier of the topic where the assignment is created | [optional] + +## Example + +```python +from flat_api.models.class_assignment_update_all_of_google_classroom import ClassAssignmentUpdateAllOfGoogleClassroom + +# TODO update the JSON string below +json = "{}" +# create an instance of ClassAssignmentUpdateAllOfGoogleClassroom from a JSON string +class_assignment_update_all_of_google_classroom_instance = ClassAssignmentUpdateAllOfGoogleClassroom.from_json(json) +# print the JSON string representation of the object +print(ClassAssignmentUpdateAllOfGoogleClassroom.to_json()) + +# convert the object into a dict +class_assignment_update_all_of_google_classroom_dict = class_assignment_update_all_of_google_classroom_instance.to_dict() +# create an instance of ClassAssignmentUpdateAllOfGoogleClassroom from a dict +class_assignment_update_all_of_google_classroom_from_dict = ClassAssignmentUpdateAllOfGoogleClassroom.from_dict(class_assignment_update_all_of_google_classroom_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/reference/ClassAssignmentUpdateAllOfMicrosoftGraph.md b/docs/reference/ClassAssignmentUpdateAllOfMicrosoftGraph.md new file mode 100644 index 0000000..4832556 --- /dev/null +++ b/docs/reference/ClassAssignmentUpdateAllOfMicrosoftGraph.md @@ -0,0 +1,30 @@ +# ClassAssignmentUpdateAllOfMicrosoftGraph + +Microsoft Graph options for this assignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**categories** | **List[str]** | List of categories this assignment belongs to | [optional] + +## Example + +```python +from flat_api.models.class_assignment_update_all_of_microsoft_graph import ClassAssignmentUpdateAllOfMicrosoftGraph + +# TODO update the JSON string below +json = "{}" +# create an instance of ClassAssignmentUpdateAllOfMicrosoftGraph from a JSON string +class_assignment_update_all_of_microsoft_graph_instance = ClassAssignmentUpdateAllOfMicrosoftGraph.from_json(json) +# print the JSON string representation of the object +print(ClassAssignmentUpdateAllOfMicrosoftGraph.to_json()) + +# convert the object into a dict +class_assignment_update_all_of_microsoft_graph_dict = class_assignment_update_all_of_microsoft_graph_instance.to_dict() +# create an instance of ClassAssignmentUpdateAllOfMicrosoftGraph from a dict +class_assignment_update_all_of_microsoft_graph_from_dict = ClassAssignmentUpdateAllOfMicrosoftGraph.from_dict(class_assignment_update_all_of_microsoft_graph_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/ClassAttachmentCreation.md b/docs/reference/ClassAttachmentCreation.md similarity index 80% rename from docs/ClassAttachmentCreation.md rename to docs/reference/ClassAttachmentCreation.md index 311b0d3..4d73e3e 100644 --- a/docs/ClassAttachmentCreation.md +++ b/docs/reference/ClassAttachmentCreation.md @@ -9,10 +9,13 @@ Name | Type | Description | Notes **type** | **str** | The type of the attachment posted: * `rich`, `photo`, `video` are attachment types that are automatically resolved from a `link` attachment. * A `flat` attachment is a score document where the unique identifier will be specified in the `score` property. Its sharing mode will be provided in the `sharingMode` property. | [optional] **score** | **str** | A unique Flat score identifier. The user creating the assignment must at least have read access to the document. If the user has admin rights, new group permissions will be automatically added for the teachers and students of the class. | [optional] **worksheet** | **str** | An unique worksheet identifier | [optional] -**sharing_mode** | [**MediaScoreSharingMode**](MediaScoreSharingMode.md) | | [optional] +**revision** | **str** | An unique revision identifier of a score | [optional] +**part_uuid** | **str** | The UUID of the instrument part selected for this attachment (for performance submissions) | [optional] +**sharing_mode** | [**MediaScoreSharingMode**](MediaScoreSharingMode.md) | | [optional] [default to MediaScoreSharingMode.READ] **lock_score_template** | **bool** | To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template. | [optional] **url** | **str** | The URL of the attachment. | [optional] **google_drive_file_id** | **str** | The ID of the Google Drive File | [optional] +**teacher_only** | **bool** | Flag indicating if this attachment should only be visible to teachers | [optional] [default to False] ## Example @@ -24,12 +27,12 @@ json = "{}" # create an instance of ClassAttachmentCreation from a JSON string class_attachment_creation_instance = ClassAttachmentCreation.from_json(json) # print the JSON string representation of the object -print ClassAttachmentCreation.to_json() +print(ClassAttachmentCreation.to_json()) # convert the object into a dict class_attachment_creation_dict = class_attachment_creation_instance.to_dict() # create an instance of ClassAttachmentCreation from a dict -class_attachment_creation_form_dict = class_attachment_creation.from_dict(class_attachment_creation_dict) +class_attachment_creation_from_dict = ClassAttachmentCreation.from_dict(class_attachment_creation_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/ClassCreation.md b/docs/reference/ClassCreation.md similarity index 91% rename from docs/ClassCreation.md rename to docs/reference/ClassCreation.md index e3e1c6b..2e52279 100644 --- a/docs/ClassCreation.md +++ b/docs/reference/ClassCreation.md @@ -22,12 +22,12 @@ json = "{}" # create an instance of ClassCreation from a JSON string class_creation_instance = ClassCreation.from_json(json) # print the JSON string representation of the object -print ClassCreation.to_json() +print(ClassCreation.to_json()) # convert the object into a dict class_creation_dict = class_creation_instance.to_dict() # create an instance of ClassCreation from a dict -class_creation_form_dict = class_creation.from_dict(class_creation_dict) +class_creation_from_dict = ClassCreation.from_dict(class_creation_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/ClassDetails.md b/docs/reference/ClassDetails.md similarity index 89% rename from docs/ClassDetails.md rename to docs/reference/ClassDetails.md index cc2886a..38ec572 100644 --- a/docs/ClassDetails.md +++ b/docs/reference/ClassDetails.md @@ -7,13 +7,14 @@ A classroom Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The unique identifier of the class | -**state** | [**ClassState**](ClassState.md) | | [optional] -**name** | **str** | The name of the class | [optional] +**state** | [**ClassState**](ClassState.md) | | +**name** | **str** | The name of the class | **section** | **str** | The section of the class | [optional] **description** | **str** | An optionnal description for this class | [optional] **organization** | **str** | The unique identifier of the Organization owning this class | [optional] **owner** | **str** | The unique identifier of the User owning this class | [optional] -**creation_date** | **datetime** | The date when the class was create | [optional] +**creation_date** | **datetime** | The date when the class was create | +**modification_date** | **datetime** | The date when the class was last modified | [optional] **enrollment_code** | **str** | [Teachers only] The enrollment code that can be used by the students to join the class | [optional] **theme** | **str** | The theme identifier using in Flat User Interface | [optional] **assignments_count** | **float** | The number of assignments created in the class | [optional] @@ -41,12 +42,12 @@ json = "{}" # create an instance of ClassDetails from a JSON string class_details_instance = ClassDetails.from_json(json) # print the JSON string representation of the object -print ClassDetails.to_json() +print(ClassDetails.to_json()) # convert the object into a dict class_details_dict = class_details_instance.to_dict() # create an instance of ClassDetails from a dict -class_details_form_dict = class_details.from_dict(class_details_dict) +class_details_from_dict = ClassDetails.from_dict(class_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/ClassDetailsCanvas.md b/docs/reference/ClassDetailsCanvas.md similarity index 88% rename from docs/ClassDetailsCanvas.md rename to docs/reference/ClassDetailsCanvas.md index a7bbe6e..b77e052 100644 --- a/docs/ClassDetailsCanvas.md +++ b/docs/reference/ClassDetailsCanvas.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ClassDetailsCanvas from a JSON string class_details_canvas_instance = ClassDetailsCanvas.from_json(json) # print the JSON string representation of the object -print ClassDetailsCanvas.to_json() +print(ClassDetailsCanvas.to_json()) # convert the object into a dict class_details_canvas_dict = class_details_canvas_instance.to_dict() # create an instance of ClassDetailsCanvas from a dict -class_details_canvas_form_dict = class_details_canvas.from_dict(class_details_canvas_dict) +class_details_canvas_from_dict = ClassDetailsCanvas.from_dict(class_details_canvas_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/ClassDetailsClever.md b/docs/reference/ClassDetailsClever.md similarity index 91% rename from docs/ClassDetailsClever.md rename to docs/reference/ClassDetailsClever.md index 54bd20f..04b454a 100644 --- a/docs/ClassDetailsClever.md +++ b/docs/reference/ClassDetailsClever.md @@ -24,12 +24,12 @@ json = "{}" # create an instance of ClassDetailsClever from a JSON string class_details_clever_instance = ClassDetailsClever.from_json(json) # print the JSON string representation of the object -print ClassDetailsClever.to_json() +print(ClassDetailsClever.to_json()) # convert the object into a dict class_details_clever_dict = class_details_clever_instance.to_dict() # create an instance of ClassDetailsClever from a dict -class_details_clever_form_dict = class_details_clever.from_dict(class_details_clever_dict) +class_details_clever_from_dict = ClassDetailsClever.from_dict(class_details_clever_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/ClassDetailsGoogleClassroom.md b/docs/reference/ClassDetailsGoogleClassroom.md similarity index 86% rename from docs/ClassDetailsGoogleClassroom.md rename to docs/reference/ClassDetailsGoogleClassroom.md index 5fd4657..dfd6630 100644 --- a/docs/ClassDetailsGoogleClassroom.md +++ b/docs/reference/ClassDetailsGoogleClassroom.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ClassDetailsGoogleClassroom from a JSON string class_details_google_classroom_instance = ClassDetailsGoogleClassroom.from_json(json) # print the JSON string representation of the object -print ClassDetailsGoogleClassroom.to_json() +print(ClassDetailsGoogleClassroom.to_json()) # convert the object into a dict class_details_google_classroom_dict = class_details_google_classroom_instance.to_dict() # create an instance of ClassDetailsGoogleClassroom from a dict -class_details_google_classroom_form_dict = class_details_google_classroom.from_dict(class_details_google_classroom_dict) +class_details_google_classroom_from_dict = ClassDetailsGoogleClassroom.from_dict(class_details_google_classroom_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/ClassDetailsGoogleDrive.md b/docs/reference/ClassDetailsGoogleDrive.md similarity index 88% rename from docs/ClassDetailsGoogleDrive.md rename to docs/reference/ClassDetailsGoogleDrive.md index 8f14e17..092fa64 100644 --- a/docs/ClassDetailsGoogleDrive.md +++ b/docs/reference/ClassDetailsGoogleDrive.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ClassDetailsGoogleDrive from a JSON string class_details_google_drive_instance = ClassDetailsGoogleDrive.from_json(json) # print the JSON string representation of the object -print ClassDetailsGoogleDrive.to_json() +print(ClassDetailsGoogleDrive.to_json()) # convert the object into a dict class_details_google_drive_dict = class_details_google_drive_instance.to_dict() # create an instance of ClassDetailsGoogleDrive from a dict -class_details_google_drive_form_dict = class_details_google_drive.from_dict(class_details_google_drive_dict) +class_details_google_drive_from_dict = ClassDetailsGoogleDrive.from_dict(class_details_google_drive_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/ClassDetailsIssues.md b/docs/reference/ClassDetailsIssues.md similarity index 88% rename from docs/ClassDetailsIssues.md rename to docs/reference/ClassDetailsIssues.md index 9e9e7b9..f9303c7 100644 --- a/docs/ClassDetailsIssues.md +++ b/docs/reference/ClassDetailsIssues.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of ClassDetailsIssues from a JSON string class_details_issues_instance = ClassDetailsIssues.from_json(json) # print the JSON string representation of the object -print ClassDetailsIssues.to_json() +print(ClassDetailsIssues.to_json()) # convert the object into a dict class_details_issues_dict = class_details_issues_instance.to_dict() # create an instance of ClassDetailsIssues from a dict -class_details_issues_form_dict = class_details_issues.from_dict(class_details_issues_dict) +class_details_issues_from_dict = ClassDetailsIssues.from_dict(class_details_issues_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/ClassDetailsIssuesSyncInner.md b/docs/reference/ClassDetailsIssuesSyncInner.md similarity index 86% rename from docs/ClassDetailsIssuesSyncInner.md rename to docs/reference/ClassDetailsIssuesSyncInner.md index e171491..29c586a 100644 --- a/docs/ClassDetailsIssuesSyncInner.md +++ b/docs/reference/ClassDetailsIssuesSyncInner.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of ClassDetailsIssuesSyncInner from a JSON string class_details_issues_sync_inner_instance = ClassDetailsIssuesSyncInner.from_json(json) # print the JSON string representation of the object -print ClassDetailsIssuesSyncInner.to_json() +print(ClassDetailsIssuesSyncInner.to_json()) # convert the object into a dict class_details_issues_sync_inner_dict = class_details_issues_sync_inner_instance.to_dict() # create an instance of ClassDetailsIssuesSyncInner from a dict -class_details_issues_sync_inner_form_dict = class_details_issues_sync_inner.from_dict(class_details_issues_sync_inner_dict) +class_details_issues_sync_inner_from_dict = ClassDetailsIssuesSyncInner.from_dict(class_details_issues_sync_inner_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/ClassDetailsLti.md b/docs/reference/ClassDetailsLti.md similarity index 77% rename from docs/ClassDetailsLti.md rename to docs/reference/ClassDetailsLti.md index ddf6c0a..f18cd57 100644 --- a/docs/ClassDetailsLti.md +++ b/docs/reference/ClassDetailsLti.md @@ -1,6 +1,6 @@ # ClassDetailsLti -Meta information provided by the LTI consumer +Info about LTI context (1.1 and 1.3) ## Properties @@ -9,6 +9,7 @@ Name | Type | Description | Notes **context_id** | **str** | Unique context identifier provided | [optional] **context_title** | **str** | Context title | [optional] **context_label** | **str** | Context label | [optional] +**has_nrps_service** | **bool** | If true, the class has been synchronized with the LTI 1.3 NRPS 2.0 service | [optional] ## Example @@ -20,12 +21,12 @@ json = "{}" # create an instance of ClassDetailsLti from a JSON string class_details_lti_instance = ClassDetailsLti.from_json(json) # print the JSON string representation of the object -print ClassDetailsLti.to_json() +print(ClassDetailsLti.to_json()) # convert the object into a dict class_details_lti_dict = class_details_lti_instance.to_dict() # create an instance of ClassDetailsLti from a dict -class_details_lti_form_dict = class_details_lti.from_dict(class_details_lti_dict) +class_details_lti_from_dict = ClassDetailsLti.from_dict(class_details_lti_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/ClassDetailsMfc.md b/docs/reference/ClassDetailsMfc.md similarity index 89% rename from docs/ClassDetailsMfc.md rename to docs/reference/ClassDetailsMfc.md index ff9f8ef..55e8ea3 100644 --- a/docs/ClassDetailsMfc.md +++ b/docs/reference/ClassDetailsMfc.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ClassDetailsMfc from a JSON string class_details_mfc_instance = ClassDetailsMfc.from_json(json) # print the JSON string representation of the object -print ClassDetailsMfc.to_json() +print(ClassDetailsMfc.to_json()) # convert the object into a dict class_details_mfc_dict = class_details_mfc_instance.to_dict() # create an instance of ClassDetailsMfc from a dict -class_details_mfc_form_dict = class_details_mfc.from_dict(class_details_mfc_dict) +class_details_mfc_from_dict = ClassDetailsMfc.from_dict(class_details_mfc_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/ClassDetailsMicrosoftGraph.md b/docs/reference/ClassDetailsMicrosoftGraph.md similarity index 85% rename from docs/ClassDetailsMicrosoftGraph.md rename to docs/reference/ClassDetailsMicrosoftGraph.md index 67ec4c6..38ca8ae 100644 --- a/docs/ClassDetailsMicrosoftGraph.md +++ b/docs/reference/ClassDetailsMicrosoftGraph.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of ClassDetailsMicrosoftGraph from a JSON string class_details_microsoft_graph_instance = ClassDetailsMicrosoftGraph.from_json(json) # print the JSON string representation of the object -print ClassDetailsMicrosoftGraph.to_json() +print(ClassDetailsMicrosoftGraph.to_json()) # convert the object into a dict class_details_microsoft_graph_dict = class_details_microsoft_graph_instance.to_dict() # create an instance of ClassDetailsMicrosoftGraph from a dict -class_details_microsoft_graph_form_dict = class_details_microsoft_graph.from_dict(class_details_microsoft_graph_dict) +class_details_microsoft_graph_from_dict = ClassDetailsMicrosoftGraph.from_dict(class_details_microsoft_graph_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/ClassGradeLevel.md b/docs/reference/ClassGradeLevel.md similarity index 53% rename from docs/ClassGradeLevel.md rename to docs/reference/ClassGradeLevel.md index f421f03..4ef8f02 100644 --- a/docs/ClassGradeLevel.md +++ b/docs/reference/ClassGradeLevel.md @@ -2,10 +2,17 @@ Class grade level -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ELEMENTARY` (value: `'elementary'`) + +* `MIDDLE` (value: `'middle'`) + +* `HIGH` (value: `'high'`) + +* `UNIVERSITY` (value: `'university'`) + +* `OTHER` (value: `'other'`) [[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/ClassRoles.md b/docs/reference/ClassRoles.md similarity index 66% rename from docs/ClassRoles.md rename to docs/reference/ClassRoles.md index d98de6b..3fc5a27 100644 --- a/docs/ClassRoles.md +++ b/docs/reference/ClassRoles.md @@ -2,10 +2,11 @@ User's Class Role (for Edu users only) -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `TEACHER` (value: `'teacher'`) + +* `STUDENT` (value: `'student'`) [[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/ClassState.md b/docs/reference/ClassState.md similarity index 58% rename from docs/ClassState.md rename to docs/reference/ClassState.md index b7a0e58..50c7594 100644 --- a/docs/ClassState.md +++ b/docs/reference/ClassState.md @@ -2,10 +2,15 @@ The state of a classroom -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ACTIVE` (value: `'active'`) + +* `INACTIVE` (value: `'inactive'`) + +* `ARCHIVED` (value: `'archived'`) + +* `DELETED` (value: `'deleted'`) [[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/ClassUpdate.md b/docs/reference/ClassUpdate.md similarity index 92% rename from docs/ClassUpdate.md rename to docs/reference/ClassUpdate.md index 9f0a8b0..9c3d502 100644 --- a/docs/ClassUpdate.md +++ b/docs/reference/ClassUpdate.md @@ -22,12 +22,12 @@ json = "{}" # create an instance of ClassUpdate from a JSON string class_update_instance = ClassUpdate.from_json(json) # print the JSON string representation of the object -print ClassUpdate.to_json() +print(ClassUpdate.to_json()) # convert the object into a dict class_update_dict = class_update_instance.to_dict() # create an instance of ClassUpdate from a dict -class_update_form_dict = class_update.from_dict(class_update_dict) +class_update_from_dict = ClassUpdate.from_dict(class_update_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/Collection.md b/docs/reference/Collection.md similarity index 64% rename from docs/Collection.md rename to docs/reference/Collection.md index 9c29fab..6c57507 100644 --- a/docs/Collection.md +++ b/docs/reference/Collection.md @@ -6,18 +6,22 @@ Collection of scores Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Unique identifier of the collection | [optional] -**title** | **str** | The title of the collection | [optional] -**html_url** | **str** | The url where the collection can be viewed in a web browser | [optional] -**type** | [**CollectionType**](CollectionType.md) | | [optional] -**privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | [optional] +**id** | **str** | Unique identifier of the collection | +**title** | **str** | The title of the collection | +**html_url** | **str** | The url where the collection can be viewed in a web browser | +**type** | [**CollectionType**](CollectionType.md) | | +**label_key** | **str** | Product-specific translation key for the collection type. Only set for specific collection types: * For `regular` type: `playlist` (Flat) or `collection` (Flat for Education) * For `collaborations` type: `collaboration` (Flat) or `shared-scores` (Flat for Education) Not set for other collection types. | [optional] +**privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | [default to CollectionPrivacy.PRIVATE] **sharing_key** | **str** | The private sharing key of the collection (available when the `privacy` mode is set to `privateLink`) | [optional] **app** | [**CollectionApp**](CollectionApp.md) | | [optional] -**creation_date** | **datetime** | The date when the collection was created | [optional] +**creation_date** | **datetime** | The date when the collection was created | +**modification_date** | **datetime** | The date when the collection was last modified | [optional] **user** | [**UserPublicSummary**](UserPublicSummary.md) | | [optional] **organization** | **str** | If the score has been created in an organization, the identifier of this organization. | [optional] **rights** | [**ResourceRights**](ResourceRights.md) | | [optional] **collaborators** | [**List[ResourceCollaborator]**](ResourceCollaborator.md) | The list of the collaborators of the collection | [optional] +**is_pinned** | **bool** | Whether the collection is pinned by the owner | [optional] +**contents** | [**CollectionContents**](CollectionContents.md) | | **capabilities** | [**CollectionCapabilities**](CollectionCapabilities.md) | | **collections** | **List[str]** | The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them. | [optional] @@ -31,12 +35,12 @@ json = "{}" # create an instance of Collection from a JSON string collection_instance = Collection.from_json(json) # print the JSON string representation of the object -print Collection.to_json() +print(Collection.to_json()) # convert the object into a dict collection_dict = collection_instance.to_dict() # create an instance of Collection from a dict -collection_form_dict = collection.from_dict(collection_dict) +collection_from_dict = Collection.from_dict(collection_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/CollectionApi.md b/docs/reference/CollectionApi.md similarity index 77% rename from docs/CollectionApi.md rename to docs/reference/CollectionApi.md index 6deb8e8..fedd5d9 100644 --- a/docs/CollectionApi.md +++ b/docs/reference/CollectionApi.md @@ -20,7 +20,9 @@ Method | HTTP request | Description Add a score to the collection -This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action. +This operation will add a score to a collection. The default behavior will make the score available across multiple collections. +You must have the capability `canAddScores` on the provided `collection` to perform the action. + ### Example @@ -49,7 +51,7 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - collection = 'collection_example' # str | Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted + collection = 'collection_example' # str | Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted score = 'score_example' # str | Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) @@ -69,7 +71,7 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collection** | **str**| Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted | + **collection** | **str**| Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted | **score** | **str**| Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). | **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] @@ -83,7 +85,7 @@ Name | Type | Description | Notes ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -102,7 +104,8 @@ Name | Type | Description | Notes Create a new collection -This method will create a new collection and add it to your `root` collection. +This method will create a new collection in your account. + ### Example @@ -180,7 +183,8 @@ Name | Type | Description | Notes Delete the collection -This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. +This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. + ### Example @@ -208,7 +212,7 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - collection = 'collection_example' # str | Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted + collection = 'collection_example' # str | Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores try: # Delete the collection @@ -224,7 +228,7 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collection** | **str**| Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted | + **collection** | **str**| Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores | ### Return type @@ -251,11 +255,13 @@ void (empty response body) [[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) # **delete_score_from_collection** -> delete_score_from_collection(collection, score, sharing_key=sharing_key) +> delete_score_from_collection(collection, score, event_properties=event_properties, sharing_key=sharing_key) Delete a score from the collection -This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. +This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. +This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. + ### Example @@ -283,13 +289,14 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - collection = 'collection_example' # str | Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted + collection = 'collection_example' # str | Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted score = 'score_example' # str | Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). + event_properties = '{\"context\":\"discover\",\"screenLevel0\":\"home\",\"screenRoute\":\"/discover\"}' # str | Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` (optional) sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) try: # Delete a score from the collection - api_instance.delete_score_from_collection(collection, score, sharing_key=sharing_key) + api_instance.delete_score_from_collection(collection, score, event_properties=event_properties, sharing_key=sharing_key) except Exception as e: print("Exception when calling CollectionApi->delete_score_from_collection: %s\n" % e) ``` @@ -301,8 +308,9 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collection** | **str**| Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted | + **collection** | **str**| Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted | **score** | **str**| Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). | + **event_properties** | **str**| Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` | [optional] **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] ### Return type @@ -315,7 +323,7 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -362,7 +370,7 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - collection = 'collection_example' # str | Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted + collection = 'collection_example' # str | Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores body = flat_api.CollectionModification() # CollectionModification | try: @@ -381,7 +389,7 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collection** | **str**| Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted | + **collection** | **str**| Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores | **body** | [**CollectionModification**](CollectionModification.md)| | ### Return type @@ -440,7 +448,7 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - collection = 'collection_example' # str | Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted + collection = 'collection_example' # str | Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) try: @@ -459,7 +467,7 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collection** | **str**| Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted | + **collection** | **str**| Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores | **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] ### Return type @@ -487,11 +495,15 @@ 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_collection_scores** -> List[ScoreDetails] list_collection_scores(collection, sharing_key=sharing_key, sort=sort, direction=direction, limit=limit, next=next, previous=previous) +> List[ScoreDetails] list_collection_scores(collection, sort=sort, direction=direction, limit=limit, next=next, previous=previous, sharing_key=sharing_key) List the scores contained in a collection -Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`. For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. +Use this method to list the scores contained in a collection. +If no sort option is provided, the scores are sorted by `modificationDate` `desc`. + +For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. + ### Example @@ -520,17 +532,17 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - collection = 'collection_example' # str | Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted - sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) + collection = 'collection_example' # str | Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores sort = 'sort_example' # str | Sort (optional) direction = 'direction_example' # str | Sort direction (optional) limit = 25 # int | This is the maximum number of objects that may be returned (optional) (default to 25) next = 'next_example' # str | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) previous = 'previous_example' # str | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) + sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) try: # List the scores contained in a collection - api_response = api_instance.list_collection_scores(collection, sharing_key=sharing_key, sort=sort, direction=direction, limit=limit, next=next, previous=previous) + api_response = api_instance.list_collection_scores(collection, sort=sort, direction=direction, limit=limit, next=next, previous=previous, sharing_key=sharing_key) print("The response of CollectionApi->list_collection_scores:\n") pprint(api_response) except Exception as e: @@ -544,13 +556,13 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collection** | **str**| Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted | - **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] + **collection** | **str**| Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores | **sort** | **str**| Sort | [optional] **direction** | **str**| Sort direction | [optional] **limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 25] **next** | **str**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] **previous** | **str**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] + **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] ### Return type @@ -579,7 +591,13 @@ Name | Type | Description | Notes List the collections -Use this method to list the user's collections contained in `parent` (by default in the `root` collection). If no sort option is provided, the collections are sorted by `creationDate` `desc`. Note that this method will not include the `parent` collection in the listing. For example, if you need the details of the `root` collection, you can use `GET /v2/collections/root`. To fetch your app collection details, you can use `GET /v2/collections/app`. +Use this method to list the user's collections. +If no sort option is provided, the collections are sorted by `creationDate` `desc`. + +By default (`parent=user`), this returns all user account collections with virtual collections on the first page. + +To fetch your app collection details, you can use `GET /v2/collections/app`. + ### Example @@ -608,7 +626,7 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - parent = 'root' # str | List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. (optional) (default to 'root') + parent = 'user' # str | List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. (optional) (default to 'user') sort = 'sort_example' # str | Sort (optional) direction = 'direction_example' # str | Sort direction (optional) limit = 25 # int | This is the maximum number of objects that may be returned (optional) (default to 25) @@ -631,7 +649,7 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **parent** | **str**| List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. | [optional] [default to 'root'] + **parent** | **str**| List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. | [optional] [default to 'user'] **sort** | **str**| Sort | [optional] **direction** | **str**| Sort direction | [optional] **limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 25] @@ -661,11 +679,12 @@ 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) # **untrash_collection** -> untrash_collection(collection) +> FlatErrorResponse untrash_collection(collection) Untrash a collection -This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. +**DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + ### Example @@ -673,6 +692,7 @@ This method will restore the collection by removing it from the `trash` and add ```python import flat_api +from flat_api.models.flat_error_response import FlatErrorResponse from flat_api.rest import ApiException from pprint import pprint @@ -693,11 +713,13 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.CollectionApi(api_client) - collection = 'collection_example' # str | Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted + collection = 'collection_example' # str | Unique identifier of the collection. try: # Untrash a collection - api_instance.untrash_collection(collection) + api_response = api_instance.untrash_collection(collection) + print("The response of CollectionApi->untrash_collection:\n") + pprint(api_response) except Exception as e: print("Exception when calling CollectionApi->untrash_collection: %s\n" % e) ``` @@ -709,11 +731,11 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **collection** | **str**| Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted | + **collection** | **str**| Unique identifier of the collection. | ### Return type -void (empty response body) +[**FlatErrorResponse**](FlatErrorResponse.md) ### Authorization @@ -728,9 +750,7 @@ void (empty response body) | Status code | Description | Response headers | |-------------|-------------|------------------| -**204** | The score has been untrashed | - | -**403** | Not granted to manage this score | - | -**404** | Score not found | - | +**400** | Bad request - Operation no longer supported | - | **0** | Error | - | [[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) diff --git a/docs/CollectionApp.md b/docs/reference/CollectionApp.md similarity index 90% rename from docs/CollectionApp.md rename to docs/reference/CollectionApp.md index d6ce65e..dd598de 100644 --- a/docs/CollectionApp.md +++ b/docs/reference/CollectionApp.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of CollectionApp from a JSON string collection_app_instance = CollectionApp.from_json(json) # print the JSON string representation of the object -print CollectionApp.to_json() +print(CollectionApp.to_json()) # convert the object into a dict collection_app_dict = collection_app_instance.to_dict() # create an instance of CollectionApp from a dict -collection_app_form_dict = collection_app.from_dict(collection_app_dict) +collection_app_from_dict = CollectionApp.from_dict(collection_app_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/CollectionCapabilities.md b/docs/reference/CollectionCapabilities.md similarity index 92% rename from docs/CollectionCapabilities.md rename to docs/reference/CollectionCapabilities.md index 9e05b64..aa7ce79 100644 --- a/docs/CollectionCapabilities.md +++ b/docs/reference/CollectionCapabilities.md @@ -22,12 +22,12 @@ json = "{}" # create an instance of CollectionCapabilities from a JSON string collection_capabilities_instance = CollectionCapabilities.from_json(json) # print the JSON string representation of the object -print CollectionCapabilities.to_json() +print(CollectionCapabilities.to_json()) # convert the object into a dict collection_capabilities_dict = collection_capabilities_instance.to_dict() # create an instance of CollectionCapabilities from a dict -collection_capabilities_form_dict = collection_capabilities.from_dict(collection_capabilities_dict) +collection_capabilities_from_dict = CollectionCapabilities.from_dict(collection_capabilities_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/reference/CollectionContents.md b/docs/reference/CollectionContents.md new file mode 100644 index 0000000..1baed88 --- /dev/null +++ b/docs/reference/CollectionContents.md @@ -0,0 +1,30 @@ +# CollectionContents + +The contents of the collection + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**scores_count** | **int** | The number of scores in the collection | + +## Example + +```python +from flat_api.models.collection_contents import CollectionContents + +# TODO update the JSON string below +json = "{}" +# create an instance of CollectionContents from a JSON string +collection_contents_instance = CollectionContents.from_json(json) +# print the JSON string representation of the object +print(CollectionContents.to_json()) + +# convert the object into a dict +collection_contents_dict = collection_contents_instance.to_dict() +# create an instance of CollectionContents from a dict +collection_contents_from_dict = CollectionContents.from_dict(collection_contents_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/CollectionCreation.md b/docs/reference/CollectionCreation.md similarity index 77% rename from docs/CollectionCreation.md rename to docs/reference/CollectionCreation.md index c482f21..c29b185 100644 --- a/docs/CollectionCreation.md +++ b/docs/reference/CollectionCreation.md @@ -5,8 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**title** | **str** | The title of the collection | -**privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | +**title** | **str** | The title of the collection | [optional] +**privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | [optional] [default to CollectionPrivacy.PRIVATE] ## Example @@ -18,12 +18,12 @@ json = "{}" # create an instance of CollectionCreation from a JSON string collection_creation_instance = CollectionCreation.from_json(json) # print the JSON string representation of the object -print CollectionCreation.to_json() +print(CollectionCreation.to_json()) # convert the object into a dict collection_creation_dict = collection_creation_instance.to_dict() # create an instance of CollectionCreation from a dict -collection_creation_form_dict = collection_creation.from_dict(collection_creation_dict) +collection_creation_from_dict = CollectionCreation.from_dict(collection_creation_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/CollectionModification.md b/docs/reference/CollectionModification.md similarity index 83% rename from docs/CollectionModification.md rename to docs/reference/CollectionModification.md index 4b8891f..32c79bc 100644 --- a/docs/CollectionModification.md +++ b/docs/reference/CollectionModification.md @@ -7,7 +7,7 @@ Edit the collection metadata Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | The title of the collection | [optional] -**privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | [optional] +**privacy** | [**CollectionPrivacy**](CollectionPrivacy.md) | | [optional] [default to CollectionPrivacy.PRIVATE] ## Example @@ -19,12 +19,12 @@ json = "{}" # create an instance of CollectionModification from a JSON string collection_modification_instance = CollectionModification.from_json(json) # print the JSON string representation of the object -print CollectionModification.to_json() +print(CollectionModification.to_json()) # convert the object into a dict collection_modification_dict = collection_modification_instance.to_dict() # create an instance of CollectionModification from a dict -collection_modification_form_dict = collection_modification.from_dict(collection_modification_dict) +collection_modification_from_dict = CollectionModification.from_dict(collection_modification_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/reference/CollectionPrivacy.md b/docs/reference/CollectionPrivacy.md new file mode 100644 index 0000000..7cf273c --- /dev/null +++ b/docs/reference/CollectionPrivacy.md @@ -0,0 +1,11 @@ +# CollectionPrivacy + +The collection main privacy mode. - `private`: The collection is private and can only be accessed, modified, and administered by specified collaborators. + +## Enum + +* `PRIVATE` (value: `'private'`) + +[[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/reference/CollectionType.md b/docs/reference/CollectionType.md new file mode 100644 index 0000000..7d329fd --- /dev/null +++ b/docs/reference/CollectionType.md @@ -0,0 +1,23 @@ +# CollectionType + +Type of the collection. The type will influence the capabilitied available on the collections and how this collection is/can be populated. - `root`: **Deprecated.** Previously the root collection of the user. The `allScores` virtual collection should be used instead. - `regular`: A regular collection created by the user. This collection can be deleted and modified by the user. - `app`: An automatically created collection containing the scores created by an app (e.g. Music Snippet) - `trash`: An automatically created collection containing the trashed scores. Virtual collections: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores + +## Enum + +* `ROOT` (value: `'root'`) + +* `REGULAR` (value: `'regular'`) + +* `APP` (value: `'app'`) + +* `TRASH` (value: `'trash'`) + +* `ALLSCORES` (value: `'allScores'`) + +* `COLLABORATIONS` (value: `'collaborations'`) + +* `LIKES` (value: `'likes'`) + +[[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/reference/CreateLtiConfiguration200Response.md b/docs/reference/CreateLtiConfiguration200Response.md new file mode 100644 index 0000000..aa21da1 --- /dev/null +++ b/docs/reference/CreateLtiConfiguration200Response.md @@ -0,0 +1,29 @@ +# CreateLtiConfiguration200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**registration_url** | **str** | One-time registration URL (only for dynamic registration) | [optional] + +## Example + +```python +from flat_api.models.create_lti_configuration200_response import CreateLtiConfiguration200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of CreateLtiConfiguration200Response from a JSON string +create_lti_configuration200_response_instance = CreateLtiConfiguration200Response.from_json(json) +# print the JSON string representation of the object +print(CreateLtiConfiguration200Response.to_json()) + +# convert the object into a dict +create_lti_configuration200_response_dict = create_lti_configuration200_response_instance.to_dict() +# create an instance of CreateLtiConfiguration200Response from a dict +create_lti_configuration200_response_from_dict = CreateLtiConfiguration200Response.from_dict(create_lti_configuration200_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/reference/CreditTransaction.md b/docs/reference/CreditTransaction.md new file mode 100644 index 0000000..727ad02 --- /dev/null +++ b/docs/reference/CreditTransaction.md @@ -0,0 +1,38 @@ +# CreditTransaction + +A single credit ledger entry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the credit transaction | +**type** | **str** | Credit category. `ai` covers every AI-powered feature. | +**feature** | **str** | Which product the credits relate to. Set on deductions and on the credits a refund returns, absent on credit-pack top-ups, which are not tied to a single feature. | [optional] +**amount** | **int** | How many credits this entry moved, signed: positive for top-ups (`+30` from a credit pack), negative for deductions (`-2` for a two-page import). Sum only entries whose `state` is `active`. | +**source** | **str** | Which pool the credits came from: * `subscription`: the plan's periodic allowance * `purchase`: credits bought as a pack, which do not expire with the billing period * `free_tier`: promotional grants * `support`: a manual adjustment made by Flat's support team A single import can produce two entries when it spans two pools: the plan allowance is drawn down first, and the remainder comes from `purchase`. | +**state** | **str** | Whether the entry still counts: * `active`: in effect * `canceled`: reversed, and no longer affecting the balance. Deductions are canceled when the import they paid for fails or is refunded. | +**job** | **str** | Identifier of the import this entry belongs to, when it relates to one. Present on an import's deduction, on its reversal, and on credits returned when an import is refunded. Absent on credit-pack top-ups and manual adjustments. | [optional] +**creation_date** | **datetime** | When the transaction was created | +**modification_date** | **datetime** | When the transaction was last modified | + +## Example + +```python +from flat_api.models.credit_transaction import CreditTransaction + +# TODO update the JSON string below +json = "{}" +# create an instance of CreditTransaction from a JSON string +credit_transaction_instance = CreditTransaction.from_json(json) +# print the JSON string representation of the object +print(CreditTransaction.to_json()) + +# convert the object into a dict +credit_transaction_dict = credit_transaction_instance.to_dict() +# create an instance of CreditTransaction from a dict +credit_transaction_from_dict = CreditTransaction.from_dict(credit_transaction_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/EduLibrary.md b/docs/reference/EduLibrary.md similarity index 72% rename from docs/EduLibrary.md rename to docs/reference/EduLibrary.md index 77929d2..8bc6f18 100644 --- a/docs/EduLibrary.md +++ b/docs/reference/EduLibrary.md @@ -6,10 +6,10 @@ A Flat for Education Library Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | Unique identifier of the library. This one can be used to list the underlying resources using `GET /v2/eduResources?parent={library-id}` | [optional] -**name** | **str** | Name of the lirbary | [optional] -**type** | **str** | Type of the library | [optional] -**visibility** | **str** | Visibility of the library | [optional] +**id** | **str** | Unique identifier of the library. This one can be used to list the underlying resources using `GET /v2/eduResources?parent={library-id}` | +**name** | **str** | Name of the lirbary | +**type** | **str** | Type of the library | +**visibility** | **str** | Visibility of the library | ## Example @@ -21,12 +21,12 @@ json = "{}" # create an instance of EduLibrary from a JSON string edu_library_instance = EduLibrary.from_json(json) # print the JSON string representation of the object -print EduLibrary.to_json() +print(EduLibrary.to_json()) # convert the object into a dict edu_library_dict = edu_library_instance.to_dict() # create an instance of EduLibrary from a dict -edu_library_form_dict = edu_library.from_dict(edu_library_dict) +edu_library_from_dict = EduLibrary.from_dict(edu_library_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/EduResource.md b/docs/reference/EduResource.md similarity index 69% rename from docs/EduResource.md rename to docs/reference/EduResource.md index 95eefb0..5b4ef2e 100644 --- a/docs/EduResource.md +++ b/docs/reference/EduResource.md @@ -9,14 +9,18 @@ Name | Type | Description | Notes **id** | **str** | Resource unique identifier | **creator** | **str** | The User identifier of the resource creator | [optional] **type** | [**EduResourceType**](EduResourceType.md) | | -**privacy** | [**EduResourcePrivacy**](EduResourcePrivacy.md) | | [optional] +**privacy** | [**EduResourcePrivacy**](EduResourcePrivacy.md) | | [optional] [default to EduResourcePrivacy.PRIVATE] **tags** | **List[str]** | Specific attributes for the resource (e.g. sample resources with custom design) | [optional] **parent** | **str** | Identifier of the parent resource, e.g. a folder or root | [optional] **title** | **str** | Title of the resource | +**sharing_description** | **str** | Sharing description of this resource | [optional] +**sharing_description_html** | **str** | HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. | [optional] **creation_date** | **datetime** | The date when the resource was created | [optional] **update_date** | **datetime** | The date when the resource was updated | [optional] **resource** | [**EduResourceResource**](EduResourceResource.md) | | [optional] **capabilities** | [**EduResourceCapabilities**](EduResourceCapabilities.md) | | +**subjects** | [**List[TeachingTheme]**](TeachingTheme.md) | The subjects of this resource, or the subjects of the resources included in the folder | [optional] +**grades** | [**List[Grade]**](Grade.md) | The grades of this resource, or the grades of the resources included in the folder. | [optional] ## Example @@ -28,12 +32,12 @@ json = "{}" # create an instance of EduResource from a JSON string edu_resource_instance = EduResource.from_json(json) # print the JSON string representation of the object -print EduResource.to_json() +print(EduResource.to_json()) # convert the object into a dict edu_resource_dict = edu_resource_instance.to_dict() # create an instance of EduResource from a dict -edu_resource_form_dict = edu_resource.from_dict(edu_resource_dict) +edu_resource_from_dict = EduResource.from_dict(edu_resource_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/reference/EduResourceAssignmentCreation.md b/docs/reference/EduResourceAssignmentCreation.md new file mode 100644 index 0000000..e98109d --- /dev/null +++ b/docs/reference/EduResourceAssignmentCreation.md @@ -0,0 +1,30 @@ +# EduResourceAssignmentCreation + +Assignment-specific creation options. Only applicable when creating a resource with `type: assignment`. If `type` is not provided, defaults to `none`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | [**AssignmentType**](AssignmentType.md) | | [optional] + +## Example + +```python +from flat_api.models.edu_resource_assignment_creation import EduResourceAssignmentCreation + +# TODO update the JSON string below +json = "{}" +# create an instance of EduResourceAssignmentCreation from a JSON string +edu_resource_assignment_creation_instance = EduResourceAssignmentCreation.from_json(json) +# print the JSON string representation of the object +print(EduResourceAssignmentCreation.to_json()) + +# convert the object into a dict +edu_resource_assignment_creation_dict = edu_resource_assignment_creation_instance.to_dict() +# create an instance of EduResourceAssignmentCreation from a dict +edu_resource_assignment_creation_from_dict = EduResourceAssignmentCreation.from_dict(edu_resource_assignment_creation_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/EduResourceCapabilities.md b/docs/reference/EduResourceCapabilities.md similarity index 78% rename from docs/EduResourceCapabilities.md rename to docs/reference/EduResourceCapabilities.md index 87ae32f..ea14593 100644 --- a/docs/EduResourceCapabilities.md +++ b/docs/reference/EduResourceCapabilities.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **can_edit** | **bool** | Whether the current user can modify this resource | [optional] **can_add_resources** | **bool** | Whether the current user can add resources within this resource (e.g. `assignment` inside a `folder`) | [optional] **can_add_folders** | **bool** | Whether the current user can add folders within this resource (e.g. `folder` inside `root`) | [optional] +**can_change_privacy** | **bool** | Whether the current user can change the privacy of this resource (e.g. to share as `organizationPublic` or unshare it with `private`) | [optional] ## Example @@ -20,12 +21,12 @@ json = "{}" # create an instance of EduResourceCapabilities from a JSON string edu_resource_capabilities_instance = EduResourceCapabilities.from_json(json) # print the JSON string representation of the object -print EduResourceCapabilities.to_json() +print(EduResourceCapabilities.to_json()) # convert the object into a dict edu_resource_capabilities_dict = edu_resource_capabilities_instance.to_dict() # create an instance of EduResourceCapabilities from a dict -edu_resource_capabilities_form_dict = edu_resource_capabilities.from_dict(edu_resource_capabilities_dict) +edu_resource_capabilities_from_dict = EduResourceCapabilities.from_dict(edu_resource_capabilities_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/EduResourceCopy.md b/docs/reference/EduResourceCopy.md similarity index 89% rename from docs/EduResourceCopy.md rename to docs/reference/EduResourceCopy.md index 3360bd3..e42d39c 100644 --- a/docs/EduResourceCopy.md +++ b/docs/reference/EduResourceCopy.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of EduResourceCopy from a JSON string edu_resource_copy_instance = EduResourceCopy.from_json(json) # print the JSON string representation of the object -print EduResourceCopy.to_json() +print(EduResourceCopy.to_json()) # convert the object into a dict edu_resource_copy_dict = edu_resource_copy_instance.to_dict() # create an instance of EduResourceCopy from a dict -edu_resource_copy_form_dict = edu_resource_copy.from_dict(edu_resource_copy_dict) +edu_resource_copy_from_dict = EduResourceCopy.from_dict(edu_resource_copy_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/EduResourceCreation.md b/docs/reference/EduResourceCreation.md similarity index 68% rename from docs/EduResourceCreation.md rename to docs/reference/EduResourceCreation.md index ee25f7e..4903a20 100644 --- a/docs/EduResourceCreation.md +++ b/docs/reference/EduResourceCreation.md @@ -9,6 +9,9 @@ Name | Type | Description | Notes **type** | [**EduResourceType**](EduResourceType.md) | | **title** | **str** | Title of the resource | **parent** | **str** | Identifier of the parent resource where the new one will created, e.g. a folder id or `root` | [optional] [default to 'root'] +**sharing_description** | **str** | Sharing description of the resource | [optional] +**sharing_description_html** | **str** | HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. | [optional] +**resource** | [**EduResourceAssignmentCreation**](EduResourceAssignmentCreation.md) | | [optional] ## Example @@ -20,12 +23,12 @@ json = "{}" # create an instance of EduResourceCreation from a JSON string edu_resource_creation_instance = EduResourceCreation.from_json(json) # print the JSON string representation of the object -print EduResourceCreation.to_json() +print(EduResourceCreation.to_json()) # convert the object into a dict edu_resource_creation_dict = edu_resource_creation_instance.to_dict() # create an instance of EduResourceCreation from a dict -edu_resource_creation_form_dict = edu_resource_creation.from_dict(edu_resource_creation_dict) +edu_resource_creation_from_dict = EduResourceCreation.from_dict(edu_resource_creation_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/reference/EduResourceFolder.md b/docs/reference/EduResourceFolder.md new file mode 100644 index 0000000..0db18e5 --- /dev/null +++ b/docs/reference/EduResourceFolder.md @@ -0,0 +1,32 @@ +# EduResourceFolder + +Education resources folder + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | Title of the folder | [optional] +**assignments_types** | [**List[AssignmentType]**](AssignmentType.md) | The assignment type of the resources that are included in the folder, | [optional] +**resources_count** | **float** | The number of resources inside the folder | [optional] + +## Example + +```python +from flat_api.models.edu_resource_folder import EduResourceFolder + +# TODO update the JSON string below +json = "{}" +# create an instance of EduResourceFolder from a JSON string +edu_resource_folder_instance = EduResourceFolder.from_json(json) +# print the JSON string representation of the object +print(EduResourceFolder.to_json()) + +# convert the object into a dict +edu_resource_folder_dict = edu_resource_folder_instance.to_dict() +# create an instance of EduResourceFolder from a dict +edu_resource_folder_from_dict = EduResourceFolder.from_dict(edu_resource_folder_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/EduResourceLtiLink.md b/docs/reference/EduResourceLtiLink.md similarity index 87% rename from docs/EduResourceLtiLink.md rename to docs/reference/EduResourceLtiLink.md index 2150036..08efc2e 100644 --- a/docs/EduResourceLtiLink.md +++ b/docs/reference/EduResourceLtiLink.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of EduResourceLtiLink from a JSON string edu_resource_lti_link_instance = EduResourceLtiLink.from_json(json) # print the JSON string representation of the object -print EduResourceLtiLink.to_json() +print(EduResourceLtiLink.to_json()) # convert the object into a dict edu_resource_lti_link_dict = edu_resource_lti_link_instance.to_dict() # create an instance of EduResourceLtiLink from a dict -edu_resource_lti_link_form_dict = edu_resource_lti_link.from_dict(edu_resource_lti_link_dict) +edu_resource_lti_link_from_dict = EduResourceLtiLink.from_dict(edu_resource_lti_link_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/EduResourceMove.md b/docs/reference/EduResourceMove.md similarity index 89% rename from docs/EduResourceMove.md rename to docs/reference/EduResourceMove.md index aec4e89..618516a 100644 --- a/docs/EduResourceMove.md +++ b/docs/reference/EduResourceMove.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of EduResourceMove from a JSON string edu_resource_move_instance = EduResourceMove.from_json(json) # print the JSON string representation of the object -print EduResourceMove.to_json() +print(EduResourceMove.to_json()) # convert the object into a dict edu_resource_move_dict = edu_resource_move_instance.to_dict() # create an instance of EduResourceMove from a dict -edu_resource_move_form_dict = edu_resource_move.from_dict(edu_resource_move_dict) +edu_resource_move_from_dict = EduResourceMove.from_dict(edu_resource_move_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/EduResourcePrivacy.md b/docs/reference/EduResourcePrivacy.md similarity index 63% rename from docs/EduResourcePrivacy.md rename to docs/reference/EduResourcePrivacy.md index 7cb4d0e..806c277 100644 --- a/docs/EduResourcePrivacy.md +++ b/docs/reference/EduResourcePrivacy.md @@ -2,10 +2,13 @@ The Education resource privacy mode. -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `PRIVATE` (value: `'private'`) + +* `ORGANIZATIONPUBLIC` (value: `'organizationPublic'`) + +* `PUBLIC` (value: `'public'`) [[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/reference/EduResourceResource.md b/docs/reference/EduResourceResource.md new file mode 100644 index 0000000..a435239 --- /dev/null +++ b/docs/reference/EduResourceResource.md @@ -0,0 +1,55 @@ +# EduResourceResource + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the assignment | +**type** | [**AssignmentType**](AssignmentType.md) | | +**capabilities** | [**AssignmentCapabilities**](AssignmentCapabilities.md) | | +**title** | **str** | Title of the folder | +**description** | **str** | Student instructions and content of the assignment (plain text) | [optional] +**description_html** | **str** | HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**teacher_instructions** | **str** | Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. | [optional] +**teacher_instructions_html** | **str** | HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. | [optional] +**cover** | **str** | The URL of the cover to display | [optional] +**cover_file** | **str** | The id of the cover to display | [optional] +**attachments** | [**List[MediaAttachment]**](MediaAttachment.md) | Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. | +**use_dedicated_attachments** | **bool** | For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. | [optional] +**max_points** | **float** | If set, the grading will be enabled for the assignement | [optional] +**release_grades** | **str** | For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions | [optional] +**shuffle_exercises** | **bool** | Mixing worksheets exercises for each student | [optional] +**toolset** | **str** | The id of the associated toolset | [optional] +**nb_playback_authorized** | **float** | The number of playback authorized on the scores of the assignment. | [optional] +**restrict_play_note** | **bool** | Restrict the ability to get an audio feedback every time a student adds or selects a note. | [optional] +**restrict_to_audio_tracks** | **bool** | Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback. | [optional] +**submission_students_mode** | [**AssignmentSubmissionStudentsMode**](AssignmentSubmissionStudentsMode.md) | | [optional] +**recording_type** | **str** | For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. | [optional] +**allow_metronome** | **bool** | For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. | [optional] +**allow_backing_track** | **bool** | For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. | [optional] +**allow_speed_change** | **bool** | For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. | [optional] +**free_record** | **bool** | For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. | [optional] +**assignments_types** | [**List[AssignmentType]**](AssignmentType.md) | The assignment type of the resources that are included in the folder, | [optional] +**resources_count** | **float** | The number of resources inside the folder | [optional] + +## Example + +```python +from flat_api.models.edu_resource_resource import EduResourceResource + +# TODO update the JSON string below +json = "{}" +# create an instance of EduResourceResource from a JSON string +edu_resource_resource_instance = EduResourceResource.from_json(json) +# print the JSON string representation of the object +print(EduResourceResource.to_json()) + +# convert the object into a dict +edu_resource_resource_dict = edu_resource_resource_instance.to_dict() +# create an instance of EduResourceResource from a dict +edu_resource_resource_from_dict = EduResourceResource.from_dict(edu_resource_resource_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/EduResourceType.md b/docs/reference/EduResourceType.md similarity index 66% rename from docs/EduResourceType.md rename to docs/reference/EduResourceType.md index 054007f..c77ea4b 100644 --- a/docs/EduResourceType.md +++ b/docs/reference/EduResourceType.md @@ -2,10 +2,11 @@ Type of an education resource -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ASSIGNMENT` (value: `'assignment'`) + +* `FOLDER` (value: `'folder'`) [[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/EduResourceUpdate.md b/docs/reference/EduResourceUpdate.md similarity index 55% rename from docs/EduResourceUpdate.md rename to docs/reference/EduResourceUpdate.md index c32c521..95e9971 100644 --- a/docs/EduResourceUpdate.md +++ b/docs/reference/EduResourceUpdate.md @@ -7,7 +7,11 @@ Update of an education resource Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | Title of the resource | [optional] -**privacy** | [**EduResourcePrivacy**](EduResourcePrivacy.md) | | [optional] +**sharing_description** | **str** | Sharing description of the resource | [optional] +**sharing_description_html** | **str** | HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. | [optional] +**privacy** | [**EduResourcePrivacy**](EduResourcePrivacy.md) | | [optional] [default to EduResourcePrivacy.PRIVATE] +**subjects** | [**List[TeachingTheme]**](TeachingTheme.md) | The subjects of this resource, or the subjects of the resources included in the folder | [optional] +**grades** | [**List[Grade]**](Grade.md) | The grades of this resource, or the grades of the resources included in the folder. | [optional] ## Example @@ -19,12 +23,12 @@ json = "{}" # create an instance of EduResourceUpdate from a JSON string edu_resource_update_instance = EduResourceUpdate.from_json(json) # print the JSON string representation of the object -print EduResourceUpdate.to_json() +print(EduResourceUpdate.to_json()) # convert the object into a dict edu_resource_update_dict = edu_resource_update_instance.to_dict() # create an instance of EduResourceUpdate from a dict -edu_resource_update_form_dict = edu_resource_update.from_dict(edu_resource_update_dict) +edu_resource_update_from_dict = EduResourceUpdate.from_dict(edu_resource_update_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/EduResourceUseInClass.md b/docs/reference/EduResourceUseInClass.md similarity index 88% rename from docs/EduResourceUseInClass.md rename to docs/reference/EduResourceUseInClass.md index a5adf64..6552440 100644 --- a/docs/EduResourceUseInClass.md +++ b/docs/reference/EduResourceUseInClass.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of EduResourceUseInClass from a JSON string edu_resource_use_in_class_instance = EduResourceUseInClass.from_json(json) # print the JSON string representation of the object -print EduResourceUseInClass.to_json() +print(EduResourceUseInClass.to_json()) # convert the object into a dict edu_resource_use_in_class_dict = edu_resource_use_in_class_instance.to_dict() # create an instance of EduResourceUseInClass from a dict -edu_resource_use_in_class_form_dict = edu_resource_use_in_class.from_dict(edu_resource_use_in_class_dict) +edu_resource_use_in_class_from_dict = EduResourceUseInClass.from_dict(edu_resource_use_in_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/EduResourcesApi.md b/docs/reference/EduResourcesApi.md similarity index 89% rename from docs/EduResourcesApi.md rename to docs/reference/EduResourcesApi.md index caf6a3b..ba4f5c7 100644 --- a/docs/EduResourcesApi.md +++ b/docs/reference/EduResourcesApi.md @@ -100,7 +100,13 @@ Name | Type | Description | Notes Copy an education assignment to a teacher demo class -Once a resource library can be published to a class (`Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature \"View as student\". It will ensure the teacher has a demo class, then copy the assignment to the demo class. You can then use `POST /classes/{class}/testStudent` to create a testing student account in the demo class. +Once a resource library can be published to a class (`Assignment.capabilities.canPublishInClass = true`), +this endpoint can be used for the feature "View as student". + +It will ensure the teacher has a demo class, then copy the assignment to the demo class. +You can then use `POST /classes/{class}/testStudent` to create a testing student account +in the demo class. + ### Example @@ -251,7 +257,9 @@ Name | Type | Description | Notes Create an LTI link for an education resource -This endpoint will return an LTI link that can be used to launch Flat for Education. The link, in a context from a class, will ensure the assignment has been copied in the class. +This endpoint will return an LTI link that can be used to launch Flat for Education. +The link, in a context from a class, will ensure the assignment has been copied in the class. + ### Example @@ -538,7 +546,7 @@ This endpoint does not need any parameter. [[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_edu_resources** -> List[EduResource] list_edu_resources(parent=parent, type=type, sort=sort, direction=direction, limit=limit, next=next, previous=previous) +> List[EduResource] list_edu_resources(parent=parent, without_subfolders_resources=without_subfolders_resources, type=type, subjects=subjects, assignment_types=assignment_types, grades=grades, sort=sort, direction=direction, limit=limit, next=next, previous=previous) List education resources in a library or folder @@ -548,7 +556,10 @@ List education resources in a library or folder ```python import flat_api +from flat_api.models.assignment_type import AssignmentType from flat_api.models.edu_resource import EduResource +from flat_api.models.grade import Grade +from flat_api.models.teaching_theme import TeachingTheme from flat_api.rest import ApiException from pprint import pprint @@ -569,8 +580,12 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.EduResourcesApi(api_client) - parent = 'root' # str | List the resources contained in this `parent` library or folder (optional) (default to 'root') + parent = 'root' # str | List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization (optional) (default to 'root') + without_subfolders_resources = True # bool | For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. (optional) type = 'type_example' # str | Filter the returned resources by type (optional) + subjects = [flat_api.TeachingTheme()] # List[TeachingTheme] | Filter the returned resources by subjects (optional) + assignment_types = [flat_api.AssignmentType()] # List[AssignmentType] | Filter the returned resources by assignment types (optional) + grades = [flat_api.Grade()] # List[Grade] | Filter the returned resources by grades (optional) sort = 'creationDate' # str | Sort (optional) (default to 'creationDate') direction = 'direction_example' # str | Sort direction (optional) limit = 25 # int | This is the maximum number of resources that may be returned (optional) (default to 25) @@ -579,7 +594,7 @@ with flat_api.ApiClient(configuration) as api_client: try: # List education resources in a library or folder - api_response = api_instance.list_edu_resources(parent=parent, type=type, sort=sort, direction=direction, limit=limit, next=next, previous=previous) + api_response = api_instance.list_edu_resources(parent=parent, without_subfolders_resources=without_subfolders_resources, type=type, subjects=subjects, assignment_types=assignment_types, grades=grades, sort=sort, direction=direction, limit=limit, next=next, previous=previous) print("The response of EduResourcesApi->list_edu_resources:\n") pprint(api_response) except Exception as e: @@ -593,8 +608,12 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **parent** | **str**| List the resources contained in this `parent` library or folder | [optional] [default to 'root'] + **parent** | **str**| List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization | [optional] [default to 'root'] + **without_subfolders_resources** | **bool**| For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. | [optional] **type** | **str**| Filter the returned resources by type | [optional] + **subjects** | [**List[TeachingTheme]**](TeachingTheme.md)| Filter the returned resources by subjects | [optional] + **assignment_types** | [**List[AssignmentType]**](AssignmentType.md)| Filter the returned resources by assignment types | [optional] + **grades** | [**List[Grade]**](Grade.md)| Filter the returned resources by grades | [optional] **sort** | **str**| Sort | [optional] [default to 'creationDate'] **direction** | **str**| Sort direction | [optional] **limit** | **int**| This is the maximum number of resources that may be returned | [optional] [default to 25] @@ -618,7 +637,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | List of resources | - | +**200** | List of resources | * X-Total-Assignments-Count - Total number of assignments
* X-Total-Folders-Count - Total number of folders
| **0** | Error | - | [[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) @@ -705,7 +724,10 @@ Name | Type | Description | Notes Update an education resource metadata -Update any resources metadata (e.g. title). Use this method to rename education resources folders or assignments. +Update any resources metadata (e.g. title). + +Use this method to rename education resources folders or assignments. + ### Example @@ -861,7 +883,9 @@ Name | Type | Description | Notes Use an education resource in a class -This endpoint will copy a resource and the underlying resources. The assignment will be created as a draft that can be completed with other options before publishing (e.g. due date, publication date for scheduling, etc.). +This endpoint will copy a resource and the underlying resources. +The assignment will be created as a draft that can be completed with other options before publishing (e.g. due date, publication date for scheduling, etc.). + ### Example diff --git a/docs/FlatErrorResponse.md b/docs/reference/FlatErrorResponse.md similarity index 66% rename from docs/FlatErrorResponse.md rename to docs/reference/FlatErrorResponse.md index 948005b..39a64b0 100644 --- a/docs/FlatErrorResponse.md +++ b/docs/reference/FlatErrorResponse.md @@ -10,6 +10,7 @@ Name | Type | Description | Notes **message** | **str** | A printable message for this error | **id** | **str** | An unique error identifier generated for the request | [optional] **param** | **str** | The related parameter that caused the error | [optional] +**provider_message** | **str** | The untranslated error message returned by an external provider (e.g. Google Classroom), when the error originates from one. Only set on errors forwarded from a third party. Meant for support and IT: display it alongside `message`, never in place of it. `message` is the localized, user-facing text; this field is raw provider output and is always in English. | [optional] ## Example @@ -21,12 +22,12 @@ json = "{}" # create an instance of FlatErrorResponse from a JSON string flat_error_response_instance = FlatErrorResponse.from_json(json) # print the JSON string representation of the object -print FlatErrorResponse.to_json() +print(FlatErrorResponse.to_json()) # convert the object into a dict flat_error_response_dict = flat_error_response_instance.to_dict() # create an instance of FlatErrorResponse from a dict -flat_error_response_form_dict = flat_error_response.from_dict(flat_error_response_dict) +flat_error_response_from_dict = FlatErrorResponse.from_dict(flat_error_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/GoogleClassroomCoursework.md b/docs/reference/GoogleClassroomCoursework.md similarity index 88% rename from docs/GoogleClassroomCoursework.md rename to docs/reference/GoogleClassroomCoursework.md index d3a8377..12f12b6 100644 --- a/docs/GoogleClassroomCoursework.md +++ b/docs/reference/GoogleClassroomCoursework.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of GoogleClassroomCoursework from a JSON string google_classroom_coursework_instance = GoogleClassroomCoursework.from_json(json) # print the JSON string representation of the object -print GoogleClassroomCoursework.to_json() +print(GoogleClassroomCoursework.to_json()) # convert the object into a dict google_classroom_coursework_dict = google_classroom_coursework_instance.to_dict() # create an instance of GoogleClassroomCoursework from a dict -google_classroom_coursework_form_dict = google_classroom_coursework.from_dict(google_classroom_coursework_dict) +google_classroom_coursework_from_dict = GoogleClassroomCoursework.from_dict(google_classroom_coursework_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/GoogleClassroomSubmission.md b/docs/reference/GoogleClassroomSubmission.md similarity index 88% rename from docs/GoogleClassroomSubmission.md rename to docs/reference/GoogleClassroomSubmission.md index c7920ed..644c04a 100644 --- a/docs/GoogleClassroomSubmission.md +++ b/docs/reference/GoogleClassroomSubmission.md @@ -20,12 +20,12 @@ json = "{}" # create an instance of GoogleClassroomSubmission from a JSON string google_classroom_submission_instance = GoogleClassroomSubmission.from_json(json) # print the JSON string representation of the object -print GoogleClassroomSubmission.to_json() +print(GoogleClassroomSubmission.to_json()) # convert the object into a dict google_classroom_submission_dict = google_classroom_submission_instance.to_dict() # create an instance of GoogleClassroomSubmission from a dict -google_classroom_submission_form_dict = google_classroom_submission.from_dict(google_classroom_submission_dict) +google_classroom_submission_from_dict = GoogleClassroomSubmission.from_dict(google_classroom_submission_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/reference/Grade.md b/docs/reference/Grade.md new file mode 100644 index 0000000..43f0c6b --- /dev/null +++ b/docs/reference/Grade.md @@ -0,0 +1,35 @@ +# Grade + +Class grade of the resource + +## Enum + +* `ENUM_1` (value: `'1'`) + +* `ENUM_2` (value: `'2'`) + +* `ENUM_3` (value: `'3'`) + +* `ENUM_4` (value: `'4'`) + +* `ENUM_5` (value: `'5'`) + +* `ENUM_6` (value: `'6'`) + +* `ENUM_7` (value: `'7'`) + +* `ENUM_8` (value: `'8'`) + +* `ENUM_9` (value: `'9'`) + +* `ENUM_10` (value: `'10'`) + +* `ENUM_11` (value: `'11'`) + +* `ENUM_12` (value: `'12'`) + +* `UNIVERSITY` (value: `'university'`) + +[[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/Group.md b/docs/reference/Group.md similarity index 75% rename from docs/Group.md rename to docs/reference/Group.md index 48aa80c..b065638 100644 --- a/docs/Group.md +++ b/docs/reference/Group.md @@ -8,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The unique identifier of the group | [optional] **name** | **str** | The display name of the group | [optional] -**type** | **str** | The type of the group: * `generic`: A group created by a Flat user * `classTeachers`: A group created automaticaly by Flat that contains the teachers of a class * `classStudents`: A group created automaticaly by Flat that contains the studnets of a class | [optional] +**type** | [**GroupType**](GroupType.md) | | [optional] **users_count** | **float** | The number of users in this group | [optional] **read_only** | **bool** | `True` if the group is set in read-only | [optional] **organization** | **str** | If the group is related to an organization, this field will contain the unique identifier of the organization | [optional] @@ -24,12 +24,12 @@ json = "{}" # create an instance of Group from a JSON string group_instance = Group.from_json(json) # print the JSON string representation of the object -print Group.to_json() +print(Group.to_json()) # convert the object into a dict group_dict = group_instance.to_dict() # create an instance of Group from a dict -group_form_dict = group.from_dict(group_dict) +group_from_dict = Group.from_dict(group_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/reference/GroupApi.md b/docs/reference/GroupApi.md new file mode 100644 index 0000000..8047740 --- /dev/null +++ b/docs/reference/GroupApi.md @@ -0,0 +1,731 @@ +# flat_api.GroupApi + +All URIs are relative to *https://api.flat.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_group_user**](GroupApi.md#add_group_user) | **POST** /groups/{group}/users | Add a student to a group +[**create_group**](GroupApi.md#create_group) | **POST** /groups | Create a new group +[**delete_group**](GroupApi.md#delete_group) | **DELETE** /groups/{group} | Delete a group +[**get_group_details**](GroupApi.md#get_group_details) | **GET** /groups/{group} | Get group information +[**get_group_scores**](GroupApi.md#get_group_scores) | **GET** /groups/{group}/scores | List group's scores +[**list_group_users**](GroupApi.md#list_group_users) | **GET** /groups/{group}/users | List group's users +[**list_groups**](GroupApi.md#list_groups) | **GET** /groups | List groups +[**remove_group_user**](GroupApi.md#remove_group_user) | **DELETE** /groups/{group}/users/{user} | Remove a student from a class group +[**rename_group**](GroupApi.md#rename_group) | **PUT** /groups/{group} | Rename a group + + +# **add_group_user** +> AddGroupUser200Response add_group_user(group, add_group_user_request) + +Add a student to a group + +Add a student to the specified group (must be in the same class) + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.add_group_user200_response import AddGroupUser200Response +from flat_api.models.add_group_user_request import AddGroupUserRequest +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group = 'group_example' # str | Unique identifier of a Flat group + add_group_user_request = flat_api.AddGroupUserRequest() # AddGroupUserRequest | + + try: + # Add a student to a group + api_response = api_instance.add_group_user(group, add_group_user_request) + print("The response of GroupApi->add_group_user:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupApi->add_group_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| Unique identifier of a Flat group | + **add_group_user_request** | [**AddGroupUserRequest**](AddGroupUserRequest.md)| | + +### Return type + +[**AddGroupUser200Response**](AddGroupUser200Response.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Membership created | - | +**400** | Bad Request - Invalid user ID or user not enrolled in class | - | +**403** | Forbidden - Insufficient permissions or invalid group type | - | +**404** | Not Found - Group not found or user not found | - | +**0** | Error | - | + +[[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) + +# **create_group** +> GroupDetails create_group(group_creation) + +Create a new group + +Create a group of the given type, tied to a classroom, optionally with initial members. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.group_creation import GroupCreation +from flat_api.models.group_details import GroupDetails +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group_creation = flat_api.GroupCreation() # GroupCreation | + + try: + # Create a new group + api_response = api_instance.create_group(group_creation) + print("The response of GroupApi->create_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupApi->create_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group_creation** | [**GroupCreation**](GroupCreation.md)| | + +### Return type + +[**GroupDetails**](GroupDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The new group | - | +**400** | Bad Request - Invalid type or missing required parameters | - | +**403** | Forbidden - Insufficient permissions | - | +**409** | Conflict - Group name already exists | - | +**0** | Error | - | + +[[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) + +# **delete_group** +> delete_group(group) + +Delete a group + +Delete a group. Only available to teachers of the classroom. + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group = 'group_example' # str | Unique identifier of a Flat group + + try: + # Delete a group + api_instance.delete_group(group) + except Exception as e: + print("Exception when calling GroupApi->delete_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| Unique identifier of a Flat group | + +### Return type + +void (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Group deleted | - | +**403** | Forbidden - Insufficient permissions or invalid group type | - | +**404** | Not Found - Group not found | - | +**0** | Error | - | + +[[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) + +# **get_group_details** +> GroupDetails get_group_details(group) + +Get group information + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.group_details import GroupDetails +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group = 'group_example' # str | Unique identifier of a Flat group + + try: + # Get group information + api_response = api_instance.get_group_details(group) + print("The response of GroupApi->get_group_details:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupApi->get_group_details: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| Unique identifier of a Flat group | + +### Return type + +[**GroupDetails**](GroupDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The group details | - | +**404** | Not Found - Group not found or insufficient permissions | - | +**0** | Error | - | + +[[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) + +# **get_group_scores** +> List[ScoreDetails] get_group_scores(group, parent=parent) + +List group's scores + +Get the list of scores shared with a group. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.score_details import ScoreDetails +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group = 'group_example' # str | Unique identifier of a Flat group + parent = 'parent_example' # str | Filter the score forked from the score id `parent` (optional) + + try: + # List group's scores + api_response = api_instance.get_group_scores(group, parent=parent) + print("The response of GroupApi->get_group_scores:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupApi->get_group_scores: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| Unique identifier of a Flat group | + **parent** | **str**| Filter the score forked from the score id `parent` | [optional] + +### Return type + +[**List[ScoreDetails]**](ScoreDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The group's scores | - | +**404** | Not Found - Group not found or user not member of group | - | +**0** | Error | - | + +[[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_group_users** +> List[UserPublic] list_group_users(group, source=source) + +List group's users + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.user_public import UserPublic +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group = 'group_example' # str | Unique identifier of a Flat group + source = 'source_example' # str | Filter the users by their source (optional) + + try: + # List group's users + api_response = api_instance.list_group_users(group, source=source) + print("The response of GroupApi->list_group_users:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupApi->list_group_users: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| Unique identifier of a Flat group | + **source** | **str**| Filter the users by their source | [optional] + +### Return type + +[**List[UserPublic]**](UserPublic.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The list of users member of the group | - | +**404** | Not Found - Group not found or insufficient permissions | - | +**0** | Error | - | + +[[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_groups** +> List[GroupDetails] list_groups(type, classroom=classroom, assignment=assignment) + +List groups + +List all groups of a given type, filtered by either a classroom or an assignment. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.group_details import GroupDetails +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + type = 'type_example' # str | + classroom = 'classroom_example' # str | Classroom ID to filter by (optional) + assignment = 'assignment_example' # str | Assignment ID to filter by (optional) + + try: + # List groups + api_response = api_instance.list_groups(type, classroom=classroom, assignment=assignment) + print("The response of GroupApi->list_groups:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupApi->list_groups: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| | + **classroom** | **str**| Classroom ID to filter by | [optional] + **assignment** | **str**| Assignment ID to filter by | [optional] + +### Return type + +[**List[GroupDetails]**](GroupDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List of groups | - | +**400** | Bad Request - Invalid type or missing required parameters | - | +**403** | Forbidden - Insufficient permissions | - | +**404** | Not Found - Classroom or assignment not found | - | +**0** | Error | - | + +[[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) + +# **remove_group_user** +> remove_group_user(group, user) + +Remove a student from a class group + +Remove a student from a class group + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group = 'group_example' # str | Unique identifier of a Flat group + user = 'user_example' # str | User ID + + try: + # Remove a student from a class group + api_instance.remove_group_user(group, user) + except Exception as e: + print("Exception when calling GroupApi->remove_group_user: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| Unique identifier of a Flat group | + **user** | **str**| User ID | + +### Return type + +void (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Membership removed | - | +**403** | Forbidden - Insufficient permissions or invalid group type | - | +**404** | Not Found - Group not found or user not found | - | +**0** | Error | - | + +[[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) + +# **rename_group** +> GroupDetails rename_group(group, rename_group_request) + +Rename a group + +Rename a sub-group. Only available for class student groups. + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.group_details import GroupDetails +from flat_api.models.rename_group_request import RenameGroupRequest +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.GroupApi(api_client) + group = 'group_example' # str | Unique identifier of a Flat group + rename_group_request = flat_api.RenameGroupRequest() # RenameGroupRequest | + + try: + # Rename a group + api_response = api_instance.rename_group(group, rename_group_request) + print("The response of GroupApi->rename_group:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling GroupApi->rename_group: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **group** | **str**| Unique identifier of a Flat group | + **rename_group_request** | [**RenameGroupRequest**](RenameGroupRequest.md)| | + +### Return type + +[**GroupDetails**](GroupDetails.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Updated group | - | +**400** | Bad Request - Invalid group ID or missing name | - | +**403** | Forbidden - Insufficient permissions | - | +**404** | Not Found - Group not found | - | +**409** | Conflict - Group name already exists | - | +**0** | Error | - | + +[[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) + diff --git a/docs/reference/GroupCreation.md b/docs/reference/GroupCreation.md new file mode 100644 index 0000000..bd2ca7d --- /dev/null +++ b/docs/reference/GroupCreation.md @@ -0,0 +1,32 @@ +# GroupCreation + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Type of group (currently only classStudentsSubGroup is supported) | +**classroom** | **str** | Classroom ID | +**name** | **str** | Name of the group (optional - auto-generated if not provided). **Special names:** * `edu:testing-students`: Creates a group tagged for test student accounts. The display name will be localized (e.g., \"Test Students\") and the group will be tagged with `edu:testing-students`. | [optional] +**members** | **List[str]** | Array of student IDs to add to the group | [optional] + +## Example + +```python +from flat_api.models.group_creation import GroupCreation + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupCreation from a JSON string +group_creation_instance = GroupCreation.from_json(json) +# print the JSON string representation of the object +print(GroupCreation.to_json()) + +# convert the object into a dict +group_creation_dict = group_creation_instance.to_dict() +# create an instance of GroupCreation from a dict +group_creation_from_dict = GroupCreation.from_dict(group_creation_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/reference/GroupDetails.md b/docs/reference/GroupDetails.md new file mode 100644 index 0000000..1a89487 --- /dev/null +++ b/docs/reference/GroupDetails.md @@ -0,0 +1,40 @@ +# GroupDetails + +The details of a group + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the group | +**name** | **str** | The displayable name of the group | +**type** | [**GroupType**](GroupType.md) | | +**organization** | **str** | The unique identifier of the Organization owning the group | [optional] +**classroom** | **str** | The unique identifier of the classroom owning the group. Only available for groups of type 'classromStudentsSubGroup' or 'assignmentStudentsSubGroup' | [optional] +**assignment** | **str** | The unique identifier of the assignment owning the group. Only available for groups of type 'assignmentStudentsSubGroup'. | [optional] +**parent** | **str** | The unique identifier of the parent class group. Only available for groups of type 'assignmentStudentsSubGroup'. May be null if the parent class group was deleted. | [optional] +**creation_date** | **datetime** | The date when the group was create | +**users_count** | **float** | The number of students in this group | +**read_only** | **bool** | `true` if the properties and members of this group are in in read-only | +**tags** | **List[str]** | Tags for categorizing groups. * `edu:testing-students`: Marks this group as containing test student accounts | + +## Example + +```python +from flat_api.models.group_details import GroupDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of GroupDetails from a JSON string +group_details_instance = GroupDetails.from_json(json) +# print the JSON string representation of the object +print(GroupDetails.to_json()) + +# convert the object into a dict +group_details_dict = group_details_instance.to_dict() +# create an instance of GroupDetails from a dict +group_details_from_dict = GroupDetails.from_dict(group_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/reference/GroupType.md b/docs/reference/GroupType.md new file mode 100644 index 0000000..a341904 --- /dev/null +++ b/docs/reference/GroupType.md @@ -0,0 +1,19 @@ +# GroupType + +The type of the group: * `generic`: A group created by a Flat user * `classTeachers`: A group created automaticaly by Flat that contains the teachers of a class * `classStudents`: A group created automaticaly by Flat that contains the studnets of a class * `classStudentsSubGroup`: Manually created sub-group of students of a class. * `assignmentStudentsSubGroup`: Manually created Sub-group of students of a class, in relation to a specific assignment. + +## Enum + +* `GENERIC` (value: `'generic'`) + +* `CLASSTEACHERS` (value: `'classTeachers'`) + +* `CLASSSTUDENTS` (value: `'classStudents'`) + +* `CLASSSTUDENTSSUBGROUP` (value: `'classStudentsSubGroup'`) + +* `ASSIGNMENTSTUDENTSSUBGROUP` (value: `'assignmentStudentsSubGroup'`) + +[[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/LicenseMode.md b/docs/reference/LicenseMode.md similarity index 64% rename from docs/LicenseMode.md rename to docs/reference/LicenseMode.md index 2bd237c..266fa97 100644 --- a/docs/LicenseMode.md +++ b/docs/reference/LicenseMode.md @@ -2,10 +2,11 @@ Mode of the license -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `CREDIT` (value: `'credit'`) + +* `SITE` (value: `'site'`) [[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/reference/LicenseSources.md b/docs/reference/LicenseSources.md new file mode 100644 index 0000000..a487211 --- /dev/null +++ b/docs/reference/LicenseSources.md @@ -0,0 +1,25 @@ +# LicenseSources + +Source of the license + +## Enum + +* `ORDER` (value: `'order'`) + +* `TRIAL` (value: `'trial'`) + +* `VOUCHER` (value: `'voucher'`) + +* `DISTRIBUTOR` (value: `'distributor'`) + +* `SUBSCRIPTION` (value: `'subscription'`) + +* `APPSTORE` (value: `'appStore'`) + +* `PLAYSTORE` (value: `'playStore'`) + +* `MUSICFIRST` (value: `'musicfirst'`) + +[[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/reference/LmsName.md b/docs/reference/LmsName.md new file mode 100644 index 0000000..5633b10 --- /dev/null +++ b/docs/reference/LmsName.md @@ -0,0 +1,25 @@ +# LmsName + +LMS name + +## Enum + +* `CANVAS` (value: `'canvas'`) + +* `MOODLE` (value: `'moodle'`) + +* `SCHOOLOGY` (value: `'schoology'`) + +* `BLACKBOARD` (value: `'blackboard'`) + +* `DESIRE2LEARN` (value: `'desire2learn'`) + +* `SAKAI` (value: `'sakai'`) + +* `SCHOOLBOX` (value: `'schoolbox'`) + +* `OTHER` (value: `'other'`) + +[[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/reference/LtiConfiguration.md b/docs/reference/LtiConfiguration.md new file mode 100644 index 0000000..3b0b8d0 --- /dev/null +++ b/docs/reference/LtiConfiguration.md @@ -0,0 +1,64 @@ +# LtiConfiguration + +LTI configuration details (unified 1.1 and 1.3) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Configuration ID | +**lti_version** | **str** | LTI version (1.3) | +**organization_id** | **str** | Organization ID | [optional] +**organization_name** | **str** | Organization name | [optional] +**creator_id** | **str** | ID of the user who created this configuration | [optional] +**creation_date** | **datetime** | Configuration creation date | +**last_used_date** | **datetime** | Last time this configuration was used | [optional] +**status** | **str** | Configuration status indicator | [optional] +**consumer_key** | **str** | LTI 1.1 consumer key | [optional] +**consumer_secret** | **str** | LTI 1.1 consumer secret (only included for admins) | [optional] +**lms** | **str** | LMS type | [optional] +**name** | **str** | Configuration name | [optional] +**tool** | [**LtiConfiguration1p3BaseTool**](LtiConfiguration1p3BaseTool.md) | | [optional] +**mode** | **str** | Dynamic registration LTI 1.3 configuration mode | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_id** | **str** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] +**access_token_url** | **str** | OAuth2 token endpoint (for AGS/NRPS) | [optional] +**authorization_url** | **str** | OIDC authorization/login endpoint | [optional] +**jwks_url** | **str** | Platform JWKS endpoint (public keys) | [optional] +**deployment_mode** | **str** | Deployment mode (single for organization-specific, multi for shared parent platforms) | [optional] +**supported_services** | [**LtiConfiguration1p3BaseSupportedServices**](LtiConfiguration1p3BaseSupportedServices.md) | | [optional] +**public_keyset_url** | **str** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] +**initiate_login_url** | **str** | URL for the platform to initiate LTI login | [optional] +**redirect_uris** | **List[str]** | Allowed redirect URIs for LTI launches | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. | [optional] [default to True] +**parent_id** | **str** | Parent configuration ID (for deployment-based configs) | [optional] +**deployment_key** | **str** | Deployment key (e.g., schoology, classlink) | [optional] +**deployment_breakdown_by** | **str** | Custom claim used for tenant identification (parent platforms only, read-only) | [optional] +**deployment_breakdown_id** | **str** | Value of the custom claim that identifies this specific tenant (child platforms only) | [optional] +**registration_token** | **str** | Only included for admins | [optional] +**registration_url** | **str** | Dynamic registration URL (only included for admins when available) | [optional] +**registration_token_used** | **bool** | Whether dynamic registration token has been used | [optional] +**registration_completion_date** | **datetime** | Date when dynamic registration completed (null when not completed) | [optional] + +## Example + +```python +from flat_api.models.lti_configuration import LtiConfiguration + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration from a JSON string +lti_configuration_instance = LtiConfiguration.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration.to_json()) + +# convert the object into a dict +lti_configuration_dict = lti_configuration_instance.to_dict() +# create an instance of LtiConfiguration from a dict +lti_configuration_from_dict = LtiConfiguration.from_dict(lti_configuration_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/reference/LtiConfiguration1p1.md b/docs/reference/LtiConfiguration1p1.md new file mode 100644 index 0000000..c520f80 --- /dev/null +++ b/docs/reference/LtiConfiguration1p1.md @@ -0,0 +1,41 @@ +# LtiConfiguration1p1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Configuration ID | +**lti_version** | **str** | LTI version (1.1) | +**organization_id** | **str** | Organization ID | [optional] +**organization_name** | **str** | Organization name | [optional] +**creator_id** | **str** | ID of the user who created this configuration | [optional] +**creation_date** | **datetime** | Configuration creation date | +**last_used_date** | **datetime** | Last time this configuration was used | [optional] +**status** | **str** | Configuration status indicator | [optional] +**consumer_key** | **str** | LTI 1.1 consumer key | [optional] +**consumer_secret** | **str** | LTI 1.1 consumer secret (only included for admins) | [optional] +**lms** | **str** | LMS type | [optional] +**name** | **str** | Configuration name | [optional] +**tool** | [**LtiConfiguration1p1AllOfTool**](LtiConfiguration1p1AllOfTool.md) | | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p1 import LtiConfiguration1p1 + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p1 from a JSON string +lti_configuration1p1_instance = LtiConfiguration1p1.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p1.to_json()) + +# convert the object into a dict +lti_configuration1p1_dict = lti_configuration1p1_instance.to_dict() +# create an instance of LtiConfiguration1p1 from a dict +lti_configuration1p1_from_dict = LtiConfiguration1p1.from_dict(lti_configuration1p1_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/reference/LtiConfiguration1p1AllOfTool.md b/docs/reference/LtiConfiguration1p1AllOfTool.md new file mode 100644 index 0000000..a201f6c --- /dev/null +++ b/docs/reference/LtiConfiguration1p1AllOfTool.md @@ -0,0 +1,35 @@ +# LtiConfiguration1p1AllOfTool + +Platform/tool product information + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product** | **str** | Product family code (e.g., canvas, moodle, schoology) | [optional] +**version** | **str** | Platform version string | [optional] +**instance_name** | **str** | Instance display name | [optional] +**instance_guid** | **str** | Unique instance identifier | [optional] +**instance_contact** | **str** | Contact email or handle for the instance | [optional] +**instance_domain** | **str** | Instance root domain | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p1_all_of_tool import LtiConfiguration1p1AllOfTool + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p1AllOfTool from a JSON string +lti_configuration1p1_all_of_tool_instance = LtiConfiguration1p1AllOfTool.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p1AllOfTool.to_json()) + +# convert the object into a dict +lti_configuration1p1_all_of_tool_dict = lti_configuration1p1_all_of_tool_instance.to_dict() +# create an instance of LtiConfiguration1p1AllOfTool from a dict +lti_configuration1p1_all_of_tool_from_dict = LtiConfiguration1p1AllOfTool.from_dict(lti_configuration1p1_all_of_tool_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/reference/LtiConfiguration1p3.md b/docs/reference/LtiConfiguration1p3.md new file mode 100644 index 0000000..d777bae --- /dev/null +++ b/docs/reference/LtiConfiguration1p3.md @@ -0,0 +1,60 @@ +# LtiConfiguration1p3 + +LTI 1.3 configuration details + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Configuration ID | +**lti_version** | **str** | LTI version (1.3) | +**organization_id** | **str** | Organization ID | [optional] +**organization_name** | **str** | Organization name | [optional] +**creator_id** | **str** | ID of the user who created this configuration | [optional] +**creation_date** | **datetime** | Configuration creation date | +**last_used_date** | **datetime** | Last time this configuration was used | [optional] +**status** | **str** | Configuration status indicator | [optional] +**mode** | **str** | Dynamic registration LTI 1.3 configuration mode | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_id** | **str** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] +**access_token_url** | **str** | OAuth2 token endpoint (for AGS/NRPS) | [optional] +**authorization_url** | **str** | OIDC authorization/login endpoint | [optional] +**jwks_url** | **str** | Platform JWKS endpoint (public keys) | [optional] +**deployment_mode** | **str** | Deployment mode (single for organization-specific, multi for shared parent platforms) | [optional] +**supported_services** | [**LtiConfiguration1p3BaseSupportedServices**](LtiConfiguration1p3BaseSupportedServices.md) | | [optional] +**tool** | [**LtiConfiguration1p3BaseTool**](LtiConfiguration1p3BaseTool.md) | | [optional] +**public_keyset_url** | **str** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] +**initiate_login_url** | **str** | URL for the platform to initiate LTI login | [optional] +**redirect_uris** | **List[str]** | Allowed redirect URIs for LTI launches | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. | [optional] [default to True] +**parent_id** | **str** | Parent configuration ID (for deployment-based configs) | [optional] +**deployment_key** | **str** | Deployment key (e.g., schoology, classlink) | [optional] +**deployment_breakdown_by** | **str** | Custom claim used for tenant identification (parent platforms only, read-only) | [optional] +**deployment_breakdown_id** | **str** | Value of the custom claim that identifies this specific tenant (child platforms only) | [optional] +**registration_token** | **str** | Only included for admins | [optional] +**registration_url** | **str** | Dynamic registration URL (only included for admins when available) | [optional] +**registration_token_used** | **bool** | Whether dynamic registration token has been used | [optional] +**registration_completion_date** | **datetime** | Date when dynamic registration completed (null when not completed) | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3 import LtiConfiguration1p3 + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3 from a JSON string +lti_configuration1p3_instance = LtiConfiguration1p3.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3.to_json()) + +# convert the object into a dict +lti_configuration1p3_dict = lti_configuration1p3_instance.to_dict() +# create an instance of LtiConfiguration1p3 from a dict +lti_configuration1p3_from_dict = LtiConfiguration1p3.from_dict(lti_configuration1p3_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/reference/LtiConfiguration1p3Base.md b/docs/reference/LtiConfiguration1p3Base.md new file mode 100644 index 0000000..1985ac8 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Base.md @@ -0,0 +1,43 @@ +# LtiConfiguration1p3Base + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | LTI 1.3 configuration mode | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_id** | **str** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] +**access_token_url** | **str** | OAuth2 token endpoint (for AGS/NRPS) | [optional] +**authorization_url** | **str** | OIDC authorization/login endpoint | [optional] +**jwks_url** | **str** | Platform JWKS endpoint (public keys) | [optional] +**deployment_mode** | **str** | Deployment mode (single for organization-specific, multi for shared parent platforms) | [optional] +**supported_services** | [**LtiConfiguration1p3BaseSupportedServices**](LtiConfiguration1p3BaseSupportedServices.md) | | [optional] +**tool** | [**LtiConfiguration1p3BaseTool**](LtiConfiguration1p3BaseTool.md) | | [optional] +**public_keyset_url** | **str** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] +**initiate_login_url** | **str** | URL for the platform to initiate LTI login | [optional] +**redirect_uris** | **List[str]** | Allowed redirect URIs for LTI launches | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. | [optional] [default to True] + +## Example + +```python +from flat_api.models.lti_configuration1p3_base import LtiConfiguration1p3Base + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3Base from a JSON string +lti_configuration1p3_base_instance = LtiConfiguration1p3Base.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3Base.to_json()) + +# convert the object into a dict +lti_configuration1p3_base_dict = lti_configuration1p3_base_instance.to_dict() +# create an instance of LtiConfiguration1p3Base from a dict +lti_configuration1p3_base_from_dict = LtiConfiguration1p3Base.from_dict(lti_configuration1p3_base_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/reference/LtiConfiguration1p3BaseSupportedServices.md b/docs/reference/LtiConfiguration1p3BaseSupportedServices.md new file mode 100644 index 0000000..89ed2d6 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServices.md @@ -0,0 +1,32 @@ +# LtiConfiguration1p3BaseSupportedServices + +LTI services support information + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ags** | [**LtiConfiguration1p3BaseSupportedServicesAgs**](LtiConfiguration1p3BaseSupportedServicesAgs.md) | | [optional] +**nrps** | [**LtiConfiguration1p3BaseSupportedServicesNrps**](LtiConfiguration1p3BaseSupportedServicesNrps.md) | | [optional] +**deep_linking** | [**LtiConfiguration1p3BaseSupportedServicesDeepLinking**](LtiConfiguration1p3BaseSupportedServicesDeepLinking.md) | | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3BaseSupportedServices from a JSON string +lti_configuration1p3_base_supported_services_instance = LtiConfiguration1p3BaseSupportedServices.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3BaseSupportedServices.to_json()) + +# convert the object into a dict +lti_configuration1p3_base_supported_services_dict = lti_configuration1p3_base_supported_services_instance.to_dict() +# create an instance of LtiConfiguration1p3BaseSupportedServices from a dict +lti_configuration1p3_base_supported_services_from_dict = LtiConfiguration1p3BaseSupportedServices.from_dict(lti_configuration1p3_base_supported_services_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/reference/LtiConfiguration1p3BaseSupportedServicesAgs.md b/docs/reference/LtiConfiguration1p3BaseSupportedServicesAgs.md new file mode 100644 index 0000000..ed0789e --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServicesAgs.md @@ -0,0 +1,33 @@ +# LtiConfiguration1p3BaseSupportedServicesAgs + +Assignment and Grade Services support + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | **bool** | Whether AGS claims were detected in launches from this platform | [optional] +**version** | **str** | AGS version supported (e.g., \"2.0\") | [optional] +**enabled** | **bool** | Whether we have AGS enabled for this platform | [optional] +**lineitems_url** | **str** | Base URL for line items operations as provided by the platform | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3_base_supported_services_ags import LtiConfiguration1p3BaseSupportedServicesAgs + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3BaseSupportedServicesAgs from a JSON string +lti_configuration1p3_base_supported_services_ags_instance = LtiConfiguration1p3BaseSupportedServicesAgs.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3BaseSupportedServicesAgs.to_json()) + +# convert the object into a dict +lti_configuration1p3_base_supported_services_ags_dict = lti_configuration1p3_base_supported_services_ags_instance.to_dict() +# create an instance of LtiConfiguration1p3BaseSupportedServicesAgs from a dict +lti_configuration1p3_base_supported_services_ags_from_dict = LtiConfiguration1p3BaseSupportedServicesAgs.from_dict(lti_configuration1p3_base_supported_services_ags_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/reference/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md b/docs/reference/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md new file mode 100644 index 0000000..16d363e --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServicesDeepLinking.md @@ -0,0 +1,31 @@ +# LtiConfiguration1p3BaseSupportedServicesDeepLinking + +Deep Linking support + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | **bool** | Whether Deep Linking claims were detected in launches from this platform | [optional] +**version** | **str** | Deep Linking version supported (e.g., \"2.0\") | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3_base_supported_services_deep_linking import LtiConfiguration1p3BaseSupportedServicesDeepLinking + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3BaseSupportedServicesDeepLinking from a JSON string +lti_configuration1p3_base_supported_services_deep_linking_instance = LtiConfiguration1p3BaseSupportedServicesDeepLinking.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3BaseSupportedServicesDeepLinking.to_json()) + +# convert the object into a dict +lti_configuration1p3_base_supported_services_deep_linking_dict = lti_configuration1p3_base_supported_services_deep_linking_instance.to_dict() +# create an instance of LtiConfiguration1p3BaseSupportedServicesDeepLinking from a dict +lti_configuration1p3_base_supported_services_deep_linking_from_dict = LtiConfiguration1p3BaseSupportedServicesDeepLinking.from_dict(lti_configuration1p3_base_supported_services_deep_linking_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/reference/LtiConfiguration1p3BaseSupportedServicesNrps.md b/docs/reference/LtiConfiguration1p3BaseSupportedServicesNrps.md new file mode 100644 index 0000000..d5b44c2 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseSupportedServicesNrps.md @@ -0,0 +1,32 @@ +# LtiConfiguration1p3BaseSupportedServicesNrps + +Names and Role Provisioning Services support + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | **bool** | Whether NRPS claims were detected in launches from this platform | [optional] +**version** | **str** | NRPS version supported (e.g., \"2.0\") | [optional] +**enabled** | **bool** | Whether we have NRPS enabled for this platform | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3_base_supported_services_nrps import LtiConfiguration1p3BaseSupportedServicesNrps + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3BaseSupportedServicesNrps from a JSON string +lti_configuration1p3_base_supported_services_nrps_instance = LtiConfiguration1p3BaseSupportedServicesNrps.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3BaseSupportedServicesNrps.to_json()) + +# convert the object into a dict +lti_configuration1p3_base_supported_services_nrps_dict = lti_configuration1p3_base_supported_services_nrps_instance.to_dict() +# create an instance of LtiConfiguration1p3BaseSupportedServicesNrps from a dict +lti_configuration1p3_base_supported_services_nrps_from_dict = LtiConfiguration1p3BaseSupportedServicesNrps.from_dict(lti_configuration1p3_base_supported_services_nrps_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/reference/LtiConfiguration1p3BaseTool.md b/docs/reference/LtiConfiguration1p3BaseTool.md new file mode 100644 index 0000000..83b656c --- /dev/null +++ b/docs/reference/LtiConfiguration1p3BaseTool.md @@ -0,0 +1,35 @@ +# LtiConfiguration1p3BaseTool + +Platform/tool product information + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**product** | **str** | Product family code (e.g., canvas, moodle, schoology) | [optional] +**version** | **str** | Platform version string | [optional] +**instance_name** | **str** | Instance name (e.g., 'My University Canvas') | [optional] +**instance_guid** | **str** | Unique instance identifier | [optional] +**instance_contact** | **str** | Contact email or handle for the instance | [optional] +**instance_domain** | **str** | Instance root domain | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3BaseTool from a JSON string +lti_configuration1p3_base_tool_instance = LtiConfiguration1p3BaseTool.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3BaseTool.to_json()) + +# convert the object into a dict +lti_configuration1p3_base_tool_dict = lti_configuration1p3_base_tool_instance.to_dict() +# create an instance of LtiConfiguration1p3BaseTool from a dict +lti_configuration1p3_base_tool_from_dict = LtiConfiguration1p3BaseTool.from_dict(lti_configuration1p3_base_tool_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/reference/LtiConfiguration1p3Deployment.md b/docs/reference/LtiConfiguration1p3Deployment.md new file mode 100644 index 0000000..8b0e22d --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Deployment.md @@ -0,0 +1,55 @@ +# LtiConfiguration1p3Deployment + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Configuration ID | +**lti_version** | **str** | LTI version (1.3) | +**organization_id** | **str** | Organization ID | [optional] +**organization_name** | **str** | Organization name | [optional] +**creator_id** | **str** | ID of the user who created this configuration | [optional] +**creation_date** | **datetime** | Configuration creation date | +**last_used_date** | **datetime** | Last time this configuration was used | [optional] +**status** | **str** | Configuration status indicator | [optional] +**mode** | **str** | Deployment-based LTI 1.3 configuration mode | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_id** | **str** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] +**access_token_url** | **str** | OAuth2 token endpoint (for AGS/NRPS) | [optional] +**authorization_url** | **str** | OIDC authorization/login endpoint | [optional] +**jwks_url** | **str** | Platform JWKS endpoint (public keys) | [optional] +**deployment_mode** | **str** | Deployment mode (single for organization-specific, multi for shared parent platforms) | [optional] +**supported_services** | [**LtiConfiguration1p3BaseSupportedServices**](LtiConfiguration1p3BaseSupportedServices.md) | | [optional] +**tool** | [**LtiConfiguration1p3BaseTool**](LtiConfiguration1p3BaseTool.md) | | [optional] +**public_keyset_url** | **str** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] +**initiate_login_url** | **str** | URL for the platform to initiate LTI login | [optional] +**redirect_uris** | **List[str]** | Allowed redirect URIs for LTI launches | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. | [optional] [default to True] +**parent_id** | **str** | Parent configuration ID (for deployment-based configs) | [optional] +**deployment_key** | **str** | Deployment key (e.g., schoology, classlink) | [optional] +**deployment_breakdown_by** | **str** | Custom claim used for tenant identification (parent platforms only, read-only) | [optional] +**deployment_breakdown_id** | **str** | Value of the custom claim that identifies this specific tenant (child platforms only) | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3_deployment import LtiConfiguration1p3Deployment + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3Deployment from a JSON string +lti_configuration1p3_deployment_instance = LtiConfiguration1p3Deployment.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3Deployment.to_json()) + +# convert the object into a dict +lti_configuration1p3_deployment_dict = lti_configuration1p3_deployment_instance.to_dict() +# create an instance of LtiConfiguration1p3Deployment from a dict +lti_configuration1p3_deployment_from_dict = LtiConfiguration1p3Deployment.from_dict(lti_configuration1p3_deployment_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/reference/LtiConfiguration1p3Dynamic.md b/docs/reference/LtiConfiguration1p3Dynamic.md new file mode 100644 index 0000000..fecb324 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Dynamic.md @@ -0,0 +1,55 @@ +# LtiConfiguration1p3Dynamic + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Configuration ID | +**lti_version** | **str** | LTI version (1.3) | +**organization_id** | **str** | Organization ID | [optional] +**organization_name** | **str** | Organization name | [optional] +**creator_id** | **str** | ID of the user who created this configuration | [optional] +**creation_date** | **datetime** | Configuration creation date | +**last_used_date** | **datetime** | Last time this configuration was used | [optional] +**status** | **str** | Configuration status indicator | [optional] +**mode** | **str** | Dynamic registration LTI 1.3 configuration mode | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_id** | **str** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] +**access_token_url** | **str** | OAuth2 token endpoint (for AGS/NRPS) | [optional] +**authorization_url** | **str** | OIDC authorization/login endpoint | [optional] +**jwks_url** | **str** | Platform JWKS endpoint (public keys) | [optional] +**deployment_mode** | **str** | Deployment mode (single for organization-specific, multi for shared parent platforms) | [optional] +**supported_services** | [**LtiConfiguration1p3BaseSupportedServices**](LtiConfiguration1p3BaseSupportedServices.md) | | [optional] +**tool** | [**LtiConfiguration1p3BaseTool**](LtiConfiguration1p3BaseTool.md) | | [optional] +**public_keyset_url** | **str** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] +**initiate_login_url** | **str** | URL for the platform to initiate LTI login | [optional] +**redirect_uris** | **List[str]** | Allowed redirect URIs for LTI launches | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. | [optional] [default to True] +**registration_token** | **str** | Only included for admins | [optional] +**registration_url** | **str** | Dynamic registration URL (only included for admins when available) | [optional] +**registration_token_used** | **bool** | Whether dynamic registration token has been used | [optional] +**registration_completion_date** | **datetime** | Date when dynamic registration completed (null when not completed) | [optional] + +## Example + +```python +from flat_api.models.lti_configuration1p3_dynamic import LtiConfiguration1p3Dynamic + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3Dynamic from a JSON string +lti_configuration1p3_dynamic_instance = LtiConfiguration1p3Dynamic.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3Dynamic.to_json()) + +# convert the object into a dict +lti_configuration1p3_dynamic_dict = lti_configuration1p3_dynamic_instance.to_dict() +# create an instance of LtiConfiguration1p3Dynamic from a dict +lti_configuration1p3_dynamic_from_dict = LtiConfiguration1p3Dynamic.from_dict(lti_configuration1p3_dynamic_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/reference/LtiConfiguration1p3Manual.md b/docs/reference/LtiConfiguration1p3Manual.md new file mode 100644 index 0000000..4881a47 --- /dev/null +++ b/docs/reference/LtiConfiguration1p3Manual.md @@ -0,0 +1,51 @@ +# LtiConfiguration1p3Manual + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Configuration ID | +**lti_version** | **str** | LTI version (1.3) | +**organization_id** | **str** | Organization ID | [optional] +**organization_name** | **str** | Organization name | [optional] +**creator_id** | **str** | ID of the user who created this configuration | [optional] +**creation_date** | **datetime** | Configuration creation date | +**last_used_date** | **datetime** | Last time this configuration was used | [optional] +**status** | **str** | Configuration status indicator | [optional] +**mode** | **str** | Manual LTI 1.3 configuration mode | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_id** | **str** | Deployment ID linking the tool to a tenant/class (varies by platform) | [optional] +**access_token_url** | **str** | OAuth2 token endpoint (for AGS/NRPS) | [optional] +**authorization_url** | **str** | OIDC authorization/login endpoint | [optional] +**jwks_url** | **str** | Platform JWKS endpoint (public keys) | [optional] +**deployment_mode** | **str** | Deployment mode (single for organization-specific, multi for shared parent platforms) | [optional] +**supported_services** | [**LtiConfiguration1p3BaseSupportedServices**](LtiConfiguration1p3BaseSupportedServices.md) | | [optional] +**tool** | [**LtiConfiguration1p3BaseTool**](LtiConfiguration1p3BaseTool.md) | | [optional] +**public_keyset_url** | **str** | Public keyset URL for the platform to retrieve Flat's public keys | [optional] +**initiate_login_url** | **str** | URL for the platform to initiate LTI login | [optional] +**redirect_uris** | **List[str]** | Allowed redirect URIs for LTI launches | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. | [optional] [default to True] + +## Example + +```python +from flat_api.models.lti_configuration1p3_manual import LtiConfiguration1p3Manual + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfiguration1p3Manual from a JSON string +lti_configuration1p3_manual_instance = LtiConfiguration1p3Manual.from_json(json) +# print the JSON string representation of the object +print(LtiConfiguration1p3Manual.to_json()) + +# convert the object into a dict +lti_configuration1p3_manual_dict = lti_configuration1p3_manual_instance.to_dict() +# create an instance of LtiConfiguration1p3Manual from a dict +lti_configuration1p3_manual_from_dict = LtiConfiguration1p3Manual.from_dict(lti_configuration1p3_manual_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/reference/LtiConfigurationBase.md b/docs/reference/LtiConfigurationBase.md new file mode 100644 index 0000000..81d07d1 --- /dev/null +++ b/docs/reference/LtiConfigurationBase.md @@ -0,0 +1,36 @@ +# LtiConfigurationBase + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Configuration ID | +**lti_version** | **str** | LTI version | +**organization_id** | **str** | Organization ID | [optional] +**organization_name** | **str** | Organization name | [optional] +**creator_id** | **str** | ID of the user who created this configuration | [optional] +**creation_date** | **datetime** | Configuration creation date | +**last_used_date** | **datetime** | Last time this configuration was used | [optional] +**status** | **str** | Configuration status indicator | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_base import LtiConfigurationBase + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationBase from a JSON string +lti_configuration_base_instance = LtiConfigurationBase.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationBase.to_json()) + +# convert the object into a dict +lti_configuration_base_dict = lti_configuration_base_instance.to_dict() +# create an instance of LtiConfigurationBase from a dict +lti_configuration_base_from_dict = LtiConfigurationBase.from_dict(lti_configuration_base_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/reference/LtiConfigurationCreate.md b/docs/reference/LtiConfigurationCreate.md new file mode 100644 index 0000000..a8ab2a7 --- /dev/null +++ b/docs/reference/LtiConfigurationCreate.md @@ -0,0 +1,44 @@ +# LtiConfigurationCreate + +Request to create a new LTI configuration (unified 1.1 and 1.3) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | LTI 1.3 manual creation mode | +**name** | **str** | Display name for LTI 1.1 credentials | [optional] +**lms** | **str** | LMS identifier for LTI 1.1 credentials | [optional] +**platform_info** | [**LtiConfigurationCreate1p3DynamicPlatformInfo**](LtiConfigurationCreate1p3DynamicPlatformInfo.md) | | [optional] +**locale** | **str** | Optional locale code for registration URL. Input values will be automatically normalized to a supported locale code. | [optional] +**deployment_type** | **str** | Parent platform key (e.g., canvas, blackboard, schoology, classlink) | +**deployment_id** | **str** | Deployment identifier provided by the platform | +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_breakdown_id** | **str** | Value of the custom claim that identifies this specific tenant (for multi-tenant platforms like Schoology) | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**access_token_url** | **str** | Platform access token endpoint URL | [optional] +**authorization_url** | **str** | Platform OIDC authorization endpoint URL | [optional] +**jwks_url** | **str** | Platform JWKS endpoint URL for public keys | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_create import LtiConfigurationCreate + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationCreate from a JSON string +lti_configuration_create_instance = LtiConfigurationCreate.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationCreate.to_json()) + +# convert the object into a dict +lti_configuration_create_dict = lti_configuration_create_instance.to_dict() +# create an instance of LtiConfigurationCreate from a dict +lti_configuration_create_from_dict = LtiConfigurationCreate.from_dict(lti_configuration_create_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/reference/LtiConfigurationCreate1p1.md b/docs/reference/LtiConfigurationCreate1p1.md new file mode 100644 index 0000000..72d285e --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p1.md @@ -0,0 +1,32 @@ +# LtiConfigurationCreate1p1 + +LTI 1.1 manual configuration creation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | LTI 1.1 manual creation mode | +**name** | **str** | Display name for LTI 1.1 credentials | [optional] +**lms** | **str** | LMS identifier for LTI 1.1 credentials | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_create1p1 import LtiConfigurationCreate1p1 + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationCreate1p1 from a JSON string +lti_configuration_create1p1_instance = LtiConfigurationCreate1p1.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationCreate1p1.to_json()) + +# convert the object into a dict +lti_configuration_create1p1_dict = lti_configuration_create1p1_instance.to_dict() +# create an instance of LtiConfigurationCreate1p1 from a dict +lti_configuration_create1p1_from_dict = LtiConfigurationCreate1p1.from_dict(lti_configuration_create1p1_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/reference/LtiConfigurationCreate1p3Deployment.md b/docs/reference/LtiConfigurationCreate1p3Deployment.md new file mode 100644 index 0000000..8999622 --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3Deployment.md @@ -0,0 +1,34 @@ +# LtiConfigurationCreate1p3Deployment + +LTI 1.3 deployment-based configuration creation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | LTI 1.3 deployment-based creation mode | +**deployment_type** | **str** | Parent platform key (e.g., canvas, blackboard, schoology, classlink) | +**deployment_id** | **str** | Deployment identifier provided by the platform | +**client_id** | **str** | OAuth2 client_id for the tenant; required for ClassLink deployments | [optional] +**deployment_breakdown_id** | **str** | Value of the custom claim that identifies this specific tenant (for multi-tenant platforms like Schoology) | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_create1p3_deployment import LtiConfigurationCreate1p3Deployment + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationCreate1p3Deployment from a JSON string +lti_configuration_create1p3_deployment_instance = LtiConfigurationCreate1p3Deployment.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationCreate1p3Deployment.to_json()) + +# convert the object into a dict +lti_configuration_create1p3_deployment_dict = lti_configuration_create1p3_deployment_instance.to_dict() +# create an instance of LtiConfigurationCreate1p3Deployment from a dict +lti_configuration_create1p3_deployment_from_dict = LtiConfigurationCreate1p3Deployment.from_dict(lti_configuration_create1p3_deployment_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/reference/LtiConfigurationCreate1p3Dynamic.md b/docs/reference/LtiConfigurationCreate1p3Dynamic.md new file mode 100644 index 0000000..07c6d1c --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3Dynamic.md @@ -0,0 +1,32 @@ +# LtiConfigurationCreate1p3Dynamic + +LTI 1.3 dynamic registration configuration creation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | LTI 1.3 dynamic registration mode | +**platform_info** | [**LtiConfigurationCreate1p3DynamicPlatformInfo**](LtiConfigurationCreate1p3DynamicPlatformInfo.md) | | [optional] +**locale** | **str** | Optional locale code for registration URL. Input values will be automatically normalized to a supported locale code. | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_create1p3_dynamic import LtiConfigurationCreate1p3Dynamic + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationCreate1p3Dynamic from a JSON string +lti_configuration_create1p3_dynamic_instance = LtiConfigurationCreate1p3Dynamic.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationCreate1p3Dynamic.to_json()) + +# convert the object into a dict +lti_configuration_create1p3_dynamic_dict = lti_configuration_create1p3_dynamic_instance.to_dict() +# create an instance of LtiConfigurationCreate1p3Dynamic from a dict +lti_configuration_create1p3_dynamic_from_dict = LtiConfigurationCreate1p3Dynamic.from_dict(lti_configuration_create1p3_dynamic_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/reference/LtiConfigurationCreate1p3DynamicPlatformInfo.md b/docs/reference/LtiConfigurationCreate1p3DynamicPlatformInfo.md new file mode 100644 index 0000000..7e8b0ae --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3DynamicPlatformInfo.md @@ -0,0 +1,31 @@ +# LtiConfigurationCreate1p3DynamicPlatformInfo + +Optional platform information for dynamic registration + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | Platform display name | [optional] +**url** | **str** | Optional platform homepage or admin URL for reference | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_create1p3_dynamic_platform_info import LtiConfigurationCreate1p3DynamicPlatformInfo + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationCreate1p3DynamicPlatformInfo from a JSON string +lti_configuration_create1p3_dynamic_platform_info_instance = LtiConfigurationCreate1p3DynamicPlatformInfo.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationCreate1p3DynamicPlatformInfo.to_json()) + +# convert the object into a dict +lti_configuration_create1p3_dynamic_platform_info_dict = lti_configuration_create1p3_dynamic_platform_info_instance.to_dict() +# create an instance of LtiConfigurationCreate1p3DynamicPlatformInfo from a dict +lti_configuration_create1p3_dynamic_platform_info_from_dict = LtiConfigurationCreate1p3DynamicPlatformInfo.from_dict(lti_configuration_create1p3_dynamic_platform_info_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/reference/LtiConfigurationCreate1p3Manual.md b/docs/reference/LtiConfigurationCreate1p3Manual.md new file mode 100644 index 0000000..c2de4a4 --- /dev/null +++ b/docs/reference/LtiConfigurationCreate1p3Manual.md @@ -0,0 +1,38 @@ +# LtiConfigurationCreate1p3Manual + +LTI 1.3 manual configuration creation + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | LTI 1.3 manual creation mode | +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**deployment_id** | **str** | Deployment identifier provided by the platform | [optional] +**access_token_url** | **str** | Platform access token endpoint URL | [optional] +**authorization_url** | **str** | Platform OIDC authorization endpoint URL | [optional] +**jwks_url** | **str** | Platform JWKS endpoint URL for public keys | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_create1p3_manual import LtiConfigurationCreate1p3Manual + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationCreate1p3Manual from a JSON string +lti_configuration_create1p3_manual_instance = LtiConfigurationCreate1p3Manual.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationCreate1p3Manual.to_json()) + +# convert the object into a dict +lti_configuration_create1p3_manual_dict = lti_configuration_create1p3_manual_instance.to_dict() +# create an instance of LtiConfigurationCreate1p3Manual from a dict +lti_configuration_create1p3_manual_from_dict = LtiConfigurationCreate1p3Manual.from_dict(lti_configuration_create1p3_manual_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/reference/LtiConfigurationUpdate.md b/docs/reference/LtiConfigurationUpdate.md new file mode 100644 index 0000000..c68b899 --- /dev/null +++ b/docs/reference/LtiConfigurationUpdate.md @@ -0,0 +1,38 @@ +# LtiConfigurationUpdate + +Update an existing LTI 1.3 configuration (deployment clone or standalone) + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deployment_id** | **str** | Deployment identifier provided by the platform | [optional] +**deployment_breakdown_id** | **str** | Specific tenant identifier for multi-tenant platforms | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**access_token_url** | **str** | Platform access token endpoint URL | [optional] +**authorization_url** | **str** | Platform OIDC authorization endpoint URL | [optional] +**jwks_url** | **str** | Platform JWKS endpoint URL for public keys | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_update import LtiConfigurationUpdate + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationUpdate from a JSON string +lti_configuration_update_instance = LtiConfigurationUpdate.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationUpdate.to_json()) + +# convert the object into a dict +lti_configuration_update_dict = lti_configuration_update_instance.to_dict() +# create an instance of LtiConfigurationUpdate from a dict +lti_configuration_update_from_dict = LtiConfigurationUpdate.from_dict(lti_configuration_update_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/reference/LtiConfigurationUpdateDeployment.md b/docs/reference/LtiConfigurationUpdateDeployment.md new file mode 100644 index 0000000..5a2cda6 --- /dev/null +++ b/docs/reference/LtiConfigurationUpdateDeployment.md @@ -0,0 +1,32 @@ +# LtiConfigurationUpdateDeployment + +Update fields allowed for deployment-based configurations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deployment_id** | **str** | Deployment identifier provided by the platform | [optional] +**deployment_breakdown_id** | **str** | Specific tenant identifier for multi-tenant platforms | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_update_deployment import LtiConfigurationUpdateDeployment + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationUpdateDeployment from a JSON string +lti_configuration_update_deployment_instance = LtiConfigurationUpdateDeployment.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationUpdateDeployment.to_json()) + +# convert the object into a dict +lti_configuration_update_deployment_dict = lti_configuration_update_deployment_instance.to_dict() +# create an instance of LtiConfigurationUpdateDeployment from a dict +lti_configuration_update_deployment_from_dict = LtiConfigurationUpdateDeployment.from_dict(lti_configuration_update_deployment_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/reference/LtiConfigurationUpdateStandalone.md b/docs/reference/LtiConfigurationUpdateStandalone.md new file mode 100644 index 0000000..4039a21 --- /dev/null +++ b/docs/reference/LtiConfigurationUpdateStandalone.md @@ -0,0 +1,37 @@ +# LtiConfigurationUpdateStandalone + +Update fields allowed for standalone (manual/dynamic) configurations + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**deployment_id** | **str** | Deployment identifier provided by the platform | [optional] +**platform_iss** | **str** | Platform issuer URL | [optional] +**platform_name** | **str** | Platform display name | [optional] +**client_id** | **str** | OAuth2 client_id allocated by the platform | [optional] +**access_token_url** | **str** | Platform access token endpoint URL | [optional] +**authorization_url** | **str** | Platform OIDC authorization endpoint URL | [optional] +**jwks_url** | **str** | Platform JWKS endpoint URL for public keys | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication | [optional] + +## Example + +```python +from flat_api.models.lti_configuration_update_standalone import LtiConfigurationUpdateStandalone + +# TODO update the JSON string below +json = "{}" +# create an instance of LtiConfigurationUpdateStandalone from a JSON string +lti_configuration_update_standalone_instance = LtiConfigurationUpdateStandalone.from_json(json) +# print the JSON string representation of the object +print(LtiConfigurationUpdateStandalone.to_json()) + +# convert the object into a dict +lti_configuration_update_standalone_dict = lti_configuration_update_standalone_instance.to_dict() +# create an instance of LtiConfigurationUpdateStandalone from a dict +lti_configuration_update_standalone_from_dict = LtiConfigurationUpdateStandalone.from_dict(lti_configuration_update_standalone_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/LtiCredentials.md b/docs/reference/LtiCredentials.md similarity index 70% rename from docs/LtiCredentials.md rename to docs/reference/LtiCredentials.md index 8429659..afb3743 100644 --- a/docs/LtiCredentials.md +++ b/docs/reference/LtiCredentials.md @@ -15,6 +15,7 @@ Name | Type | Description | Notes **last_usage** | **datetime** | The last time these credentials were used | [optional] **consumer_key** | **str** | OAuth 1 Consumer Key | [optional] **consumer_secret** | **str** | OAuth 1 Consumer Secret | [optional] +**enable_email_matching** | **bool** | Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. | [optional] [default to True] ## Example @@ -26,12 +27,12 @@ json = "{}" # create an instance of LtiCredentials from a JSON string lti_credentials_instance = LtiCredentials.from_json(json) # print the JSON string representation of the object -print LtiCredentials.to_json() +print(LtiCredentials.to_json()) # convert the object into a dict lti_credentials_dict = lti_credentials_instance.to_dict() # create an instance of LtiCredentials from a dict -lti_credentials_form_dict = lti_credentials.from_dict(lti_credentials_dict) +lti_credentials_from_dict = LtiCredentials.from_dict(lti_credentials_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/LtiCredentialsCreation.md b/docs/reference/LtiCredentialsCreation.md similarity index 87% rename from docs/LtiCredentialsCreation.md rename to docs/reference/LtiCredentialsCreation.md index 894f13c..f587d6e 100644 --- a/docs/LtiCredentialsCreation.md +++ b/docs/reference/LtiCredentialsCreation.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of LtiCredentialsCreation from a JSON string lti_credentials_creation_instance = LtiCredentialsCreation.from_json(json) # print the JSON string representation of the object -print LtiCredentialsCreation.to_json() +print(LtiCredentialsCreation.to_json()) # convert the object into a dict lti_credentials_creation_dict = lti_credentials_creation_instance.to_dict() # create an instance of LtiCredentialsCreation from a dict -lti_credentials_creation_form_dict = lti_credentials_creation.from_dict(lti_credentials_creation_dict) +lti_credentials_creation_from_dict = LtiCredentialsCreation.from_dict(lti_credentials_creation_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/MediaAttachment.md b/docs/reference/MediaAttachment.md similarity index 81% rename from docs/MediaAttachment.md rename to docs/reference/MediaAttachment.md index 5397355..0c76378 100644 --- a/docs/MediaAttachment.md +++ b/docs/reference/MediaAttachment.md @@ -12,13 +12,14 @@ Name | Type | Description | Notes **worksheet** | **str** | An unique worksheet identifier | [optional] **dedicated** | **bool** | True if the resource is dedicated for the assignment (for scores and worksheets), meaning on the user-side this one is stored in the assignment | [optional] **track** | **str** | A unique track identifier | [optional] -**sharing_mode** | [**MediaScoreSharingMode**](MediaScoreSharingMode.md) | | [optional] +**part_uuid** | **str** | The UUID of the instrument part selected for this attachment (for performance submissions) | [optional] +**sharing_mode** | [**MediaScoreSharingMode**](MediaScoreSharingMode.md) | | [optional] [default to MediaScoreSharingMode.READ] **lock_score_template** | **bool** | To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template. | [optional] **title** | **str** | The resolved title of the attachment | [optional] **description** | **str** | The resolved description of the attachment | [optional] **html** | **str** | If the attachment type is `rich` or `video`, the HTML code of the media to display | [optional] -**html_width** | **str** | If the `html` is available, the width of the widget | [optional] -**html_height** | **str** | If the `html` is available, the height of the widget | [optional] +**html_width** | **float** | If the `html` is available, the width of the widget | [optional] +**html_height** | **float** | If the `html` is available, the height of the widget | [optional] **url** | **str** | The url of the attachment | [optional] **thumbnail_url** | **str** | If the attachment type is `rich`, `video`, `photo` or `link`, a displayable thumbnail for this attachment | [optional] **thumbnail_width** | **int** | If the `thumbnailUrl` is available, the width of the thumbnail | [optional] @@ -28,6 +29,7 @@ Name | Type | Description | Notes **icon_url** | **str** | The URL of the icon | [optional] **mime_type** | **str** | The mine type of the file | [optional] **google_drive_file_id** | **str** | The ID of the Google Drive File | [optional] +**teacher_only** | **bool** | If true, this attachment is only visible to teachers. When students view the assignment, attachments with this flag will be filtered out. | [optional] [default to False] ## Example @@ -39,12 +41,12 @@ json = "{}" # create an instance of MediaAttachment from a JSON string media_attachment_instance = MediaAttachment.from_json(json) # print the JSON string representation of the object -print MediaAttachment.to_json() +print(MediaAttachment.to_json()) # convert the object into a dict media_attachment_dict = media_attachment_instance.to_dict() # create an instance of MediaAttachment from a dict -media_attachment_form_dict = media_attachment.from_dict(media_attachment_dict) +media_attachment_from_dict = MediaAttachment.from_dict(media_attachment_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/MediaScoreSharingMode.md b/docs/reference/MediaScoreSharingMode.md similarity index 65% rename from docs/MediaScoreSharingMode.md rename to docs/reference/MediaScoreSharingMode.md index 3d64f8f..4269686 100644 --- a/docs/MediaScoreSharingMode.md +++ b/docs/reference/MediaScoreSharingMode.md @@ -2,10 +2,15 @@ The sharing mode of the score for classes post and assignments -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `READ` (value: `'read'`) + +* `WRITE` (value: `'write'`) + +* `COPY` (value: `'copy'`) + +* `PERFORMANCE` (value: `'performance'`) [[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/reference/MicrosoftGraphAssignment.md b/docs/reference/MicrosoftGraphAssignment.md new file mode 100644 index 0000000..1c522ce --- /dev/null +++ b/docs/reference/MicrosoftGraphAssignment.md @@ -0,0 +1,36 @@ +# MicrosoftGraphAssignment + +A Microsoft Teams assignment + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Identifier of the assignment assigned by Microsoft Teams | [optional] +**state** | **str** | State of the assignment on Microsoft Teams. * `draft`: Assignment is in draft mode * `scheduled`: Assignment is scheduled to be published at a future date * `published`: Assignment has been published to students * `assigned`: Assignment has been assigned (legacy status) * `inactive`: Assignment is inactive | [optional] +**alternate_link** | **str** | Absolute link to this assignment in the Microsoft Teams web UI | [optional] +**assign_date_time** | **datetime** | The date when the assignment will become active on Microsoft Teams. If set to a future date, the assignment will have status `scheduled` and won't be visible to students until this date. | [optional] +**categories** | **List[str]** | List of categories where this assignment is published under | [optional] +**assign_to_type** | **str** | Recipient configuration for this assignment on Microsoft Teams. * `class`: Assignment is visible to all students in the class * `individual`: Assignment is visible only to specific assigned students | [optional] +**assigned_students_ms_ids** | **List[str]** | When assignToType is 'individual', array of Microsoft Azure user IDs of students assigned to this assignment. These are the students who can see and submit to this assignment on Teams. | [optional] + +## Example + +```python +from flat_api.models.microsoft_graph_assignment import MicrosoftGraphAssignment + +# TODO update the JSON string below +json = "{}" +# create an instance of MicrosoftGraphAssignment from a JSON string +microsoft_graph_assignment_instance = MicrosoftGraphAssignment.from_json(json) +# print the JSON string representation of the object +print(MicrosoftGraphAssignment.to_json()) + +# convert the object into a dict +microsoft_graph_assignment_dict = microsoft_graph_assignment_instance.to_dict() +# create an instance of MicrosoftGraphAssignment from a dict +microsoft_graph_assignment_from_dict = MicrosoftGraphAssignment.from_dict(microsoft_graph_assignment_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/MicrosoftGraphSubmission.md b/docs/reference/MicrosoftGraphSubmission.md similarity index 86% rename from docs/MicrosoftGraphSubmission.md rename to docs/reference/MicrosoftGraphSubmission.md index 78dbe27..c013c41 100644 --- a/docs/MicrosoftGraphSubmission.md +++ b/docs/reference/MicrosoftGraphSubmission.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of MicrosoftGraphSubmission from a JSON string microsoft_graph_submission_instance = MicrosoftGraphSubmission.from_json(json) # print the JSON string representation of the object -print MicrosoftGraphSubmission.to_json() +print(MicrosoftGraphSubmission.to_json()) # convert the object into a dict microsoft_graph_submission_dict = microsoft_graph_submission_instance.to_dict() # create an instance of MicrosoftGraphSubmission from a dict -microsoft_graph_submission_form_dict = microsoft_graph_submission.from_dict(microsoft_graph_submission_dict) +microsoft_graph_submission_from_dict = MicrosoftGraphSubmission.from_dict(microsoft_graph_submission_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/reference/OMRApi.md b/docs/reference/OMRApi.md new file mode 100644 index 0000000..9ebe02e --- /dev/null +++ b/docs/reference/OMRApi.md @@ -0,0 +1,1052 @@ +# flat_api.OMRApi + +All URIs are relative to *https://api.flat.io/v2* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**add_omr_job_file**](OMRApi.md#add_omr_job_file) | **POST** /omr/jobs/{job}/files | Add a file to an OMR job +[**cancel_omr_job**](OMRApi.md#cancel_omr_job) | **POST** /omr/jobs/{job}/cancel | Cancel an OMR job +[**create_omr_job**](OMRApi.md#create_omr_job) | **POST** /omr/jobs | Create an OMR job +[**delete_omr_job**](OMRApi.md#delete_omr_job) | **DELETE** /omr/jobs/{job} | Delete an OMR job's data +[**get_omr_capabilities**](OMRApi.md#get_omr_capabilities) | **GET** /omr/capabilities | OMR capabilities and limits +[**get_omr_job**](OMRApi.md#get_omr_job) | **GET** /omr/jobs/{job} | Get an OMR job +[**get_omr_job_export**](OMRApi.md#get_omr_job_export) | **GET** /omr/jobs/{job}/exports/{format} | Download the finalized result +[**get_omr_job_file**](OMRApi.md#get_omr_job_file) | **GET** /omr/jobs/{job}/files/{index} | Get an input page image +[**list_billing_credits_history**](OMRApi.md#list_billing_credits_history) | **GET** /billing/credits/history | List credit history +[**list_omr_jobs**](OMRApi.md#list_omr_jobs) | **GET** /omr/jobs | List OMR jobs +[**start_omr_job**](OMRApi.md#start_omr_job) | **POST** /omr/jobs/{job}/start | Start an OMR job +[**submit_omr_job_step**](OMRApi.md#submit_omr_job_step) | **POST** /omr/jobs/{job}/steps/{step} | Submit an interactive step + + +# **add_omr_job_file** +> OmrJobFileUploadResult add_omr_job_file(job, omr_job_file_upload, x_flat_locale=x_flat_locale) + +Add a file to an OMR job + +Add one image or PDF to a draft job. Call once per file; files keep their upload order. + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_job_file_upload import OmrJobFileUpload +from flat_api.models.omr_job_file_upload_result import OmrJobFileUploadResult +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + omr_job_file_upload = flat_api.OmrJobFileUpload() # OmrJobFileUpload | + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Add a file to an OMR job + api_response = api_instance.add_omr_job_file(job, omr_job_file_upload, x_flat_locale=x_flat_locale) + print("The response of OMRApi->add_omr_job_file:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->add_omr_job_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **omr_job_file_upload** | [**OmrJobFileUpload**](OmrJobFileUpload.md)| | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrJobFileUploadResult**](OmrJobFileUploadResult.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | File added | - | +**409** | Job is not in draft state | - | +**0** | Error | - | + +[[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) + +# **cancel_omr_job** +> OmrJob cancel_omr_job(job, x_flat_locale=x_flat_locale) + +Cancel an OMR job + +Cancel a draft or in-flight job. Any charged credits are reversed. + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_job import OmrJob +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Cancel an OMR job + api_response = api_instance.cancel_omr_job(job, x_flat_locale=x_flat_locale) + print("The response of OMRApi->cancel_omr_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->cancel_omr_job: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrJob**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Canceled | - | +**0** | Error | - | + +[[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) + +# **create_omr_job** +> OmrJob create_omr_job(omr_job_creation, x_flat_locale=x_flat_locale) + +Create an OMR job + +Create an Optical Music Recognition job. There are two ways to call this endpoint: + +* **Draft:** send the parameters without `files` to create an empty job, then add + files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple + images or incremental mobile capture. +* **One-shot:** include `files` and `autoStart: true` to import in a single request. + Best for a single PDF or a third-party integration. + +Declare the interactive steps your client supports in `interactiveSteps`: the pipeline +runs fully automatically and only pauses at the steps you list. Steps you do not list, +including ones added in the future, are auto-resolved with server defaults, so older +clients never break. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_job import OmrJob +from flat_api.models.omr_job_creation import OmrJobCreation +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + omr_job_creation = flat_api.OmrJobCreation() # OmrJobCreation | + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Create an OMR job + api_response = api_instance.create_omr_job(omr_job_creation, x_flat_locale=x_flat_locale) + print("The response of OMRApi->create_omr_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->create_omr_job: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **omr_job_creation** | [**OmrJobCreation**](OmrJobCreation.md)| | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrJob**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**201** | Draft created | - | +**202** | One-shot job started (files provided with autoStart) | - | +**402** | Account overquota or feature not included | - | +**0** | Error | - | + +[[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) + +# **delete_omr_job** +> OmrJob delete_omr_job(job, x_flat_locale=x_flat_locale) + +Delete an OMR job's data + +Erase a job's uploaded files and recognition results now, instead of waiting for its +retention deadline. Use this to serve a deletion request from your own end user. + +Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps +the `status` it finished with, stays listable, and reports `retention.expiredDate`. +Downloads then fail with `OMR_JOB_EXPIRED`. + +Only available for jobs whose `output` is `musicxml`. Library imports are not covered +by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the +resulting score instead. + +The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job +is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never +cancels on your behalf, because cancellation reverses charged credits and that must +not happen as a side effect of erasing data. + +Calling this again on an already-erased job succeeds and changes nothing. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_job import OmrJob +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Delete an OMR job's data + api_response = api_instance.delete_omr_job(job, x_flat_locale=x_flat_locale) + print("The response of OMRApi->delete_omr_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->delete_omr_job: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrJob**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Job data erased | - | +**403** | Not the owner of this job | - | +**404** | Job not found | - | +**409** | Job is not covered by the retention policy, or has not finished yet | - | +**0** | Error | - | + +[[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) + +# **get_omr_capabilities** +> OmrCapabilities get_omr_capabilities(x_flat_locale=x_flat_locale) + +OMR capabilities and limits + +Advertises the supported steps, export formats, limits, cost-per-page, remaining +credits and locales, so clients can feature-detect instead of hardcoding behavior. + +Authentication is optional: called without an account, the limits are those of the +free plan and `remainingCredits` is omitted. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_capabilities import OmrCapabilities +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # OMR capabilities and limits + api_response = api_instance.get_omr_capabilities(x_flat_locale=x_flat_locale) + print("The response of OMRApi->get_omr_capabilities:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->get_omr_capabilities: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrCapabilities**](OmrCapabilities.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Capabilities | - | +**0** | Error | - | + +[[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) + +# **get_omr_job** +> OmrJob get_omr_job(job, wait=wait, x_flat_locale=x_flat_locale) + +Get an OMR job + +Get the current state of an OMR job. This is the primary polling endpoint. Pass +`wait` to long-poll until the state changes. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_job import OmrJob +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + wait = 56 # int | Long-poll up to this many seconds for a state change before returning. (optional) + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Get an OMR job + api_response = api_instance.get_omr_job(job, wait=wait, x_flat_locale=x_flat_locale) + print("The response of OMRApi->get_omr_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->get_omr_job: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **wait** | **int**| Long-poll up to this many seconds for a state change before returning. | [optional] + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrJob**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Job state | - | +**404** | Job not found | - | +**0** | Error | - | + +[[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) + +# **get_omr_job_export** +> bytes get_omr_job_export(job, format, x_flat_locale=x_flat_locale) + +Download the finalized result + +Stream the finalized result in the requested format. Available once the job is `done`. +For `output: musicxml` jobs this is the primary way to retrieve the result; no library +score is created. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + format = 'format_example' # str | Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Download the finalized result + api_response = api_instance.get_omr_job_export(job, format, x_flat_locale=x_flat_locale) + print("The response of OMRApi->get_omr_job_export:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->get_omr_job_export: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **format** | **str**| Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +**bytes** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/octet-stream, application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Exported file (content type depends on the requested format) | * Content-Disposition - Attachment disposition carrying the recommended filename, derived from the score's resolved work title (RFC 5987 encoded for non-ASCII titles). Clients should use this filename when saving the download.
| +**404** | Format not available for this job | - | +**409** | Job is not finished yet (`OMR_JOB_NOT_DONE`), or its files have been erased by the data retention policy (`OMR_JOB_EXPIRED`). | - | +**0** | Error | - | + +[[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) + +# **get_omr_job_file** +> bytes get_omr_job_file(job, index, x_flat_locale=x_flat_locale) + +Get an input page image + +Fetch one of the job's input files (a page image or PDF) by index, for the review UI. + +Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read +`retention.expiredDate` on the job to tell that case apart before requesting a file. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + index = 56 # int | 0-based index of the input file (page) to fetch. + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Get an input page image + api_response = api_instance.get_omr_job_file(job, index, x_flat_locale=x_flat_locale) + print("The response of OMRApi->get_omr_job_file:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->get_omr_job_file: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **index** | **int**| 0-based index of the input file (page) to fetch. | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +**bytes** + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: image/jpeg, application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Page image | - | +**404** | Not found | - | +**409** | The job's files have been erased by the data retention policy | - | +**0** | Error | - | + +[[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_billing_credits_history** +> List[CreditTransaction] list_billing_credits_history(limit=limit, next=next, previous=previous) + +List credit history + +The credit ledger of the authenticated account, sorted by creation date descending +(most recent entry first). + +Every entry that moved the balance is listed: the deductions taken when an import +runs, and the top-ups added by a credit pack. + +Reversing a deduction does not add an entry, it flips the original one's `state` to +`canceled`. Canceled entries stay in the list, so an import that was charged and then +failed still shows its deduction rather than disappearing. Read `state` to tell the two +apart, and sum only `active` entries. A refund can additionally add a positive entry +when cancelling alone could not restore the full cost, for instance because the plan's +allowance has since reset. + +The current balance is not computed from this list: read it from `getOmrCapabilities`. + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.credit_transaction import CreditTransaction +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + limit = 50 # int | This is the maximum number of objects that may be returned (optional) (default to 50) + next = 'next_example' # str | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) + previous = 'previous_example' # str | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) + + try: + # List credit history + api_response = api_instance.list_billing_credits_history(limit=limit, next=next, previous=previous) + print("The response of OMRApi->list_billing_credits_history:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->list_billing_credits_history: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 50] + **next** | **str**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] + **previous** | **str**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] + +### Return type + +[**List[CreditTransaction]**](CreditTransaction.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List of credit transactions | * Link - Pagination links (next, previous)
| +**0** | Error | - | + +[[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_omr_jobs** +> List[OmrJob] list_omr_jobs(status=status, expired=expired, limit=limit, next=next, previous=previous, x_flat_locale=x_flat_locale) + +List OMR jobs + +List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_job import OmrJob +from flat_api.models.omr_job_status import OmrJobStatus +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + status = flat_api.OmrJobStatus() # OmrJobStatus | Filter jobs by status (optional) + expired = True # bool | Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. (optional) + limit = 50 # int | This is the maximum number of objects that may be returned (optional) (default to 50) + next = 'next_example' # str | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) + previous = 'previous_example' # str | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # List OMR jobs + api_response = api_instance.list_omr_jobs(status=status, expired=expired, limit=limit, next=next, previous=previous, x_flat_locale=x_flat_locale) + print("The response of OMRApi->list_omr_jobs:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->list_omr_jobs: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **status** | [**OmrJobStatus**](.md)| Filter jobs by status | [optional] + **expired** | **bool**| Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. | [optional] + **limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 50] + **next** | **str**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] + **previous** | **str**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**List[OmrJob]**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List of OMR jobs | * Link - Pagination links (next, previous)
| +**0** | Error | - | + +[[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) + +# **start_omr_job** +> OmrJob start_omr_job(job, x_flat_locale=x_flat_locale) + +Start an OMR job + +Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_job import OmrJob +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Start an OMR job + api_response = api_instance.start_omr_job(job, x_flat_locale=x_flat_locale) + print("The response of OMRApi->start_omr_job:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->start_omr_job: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrJob**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Processing started | - | +**400** | No files attached | - | +**402** | Insufficient credits or quota | - | +**0** | Error | - | + +[[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) + +# **submit_omr_job_step** +> OmrJob submit_omr_job_step(job, step, body, x_flat_locale=x_flat_locale) + +Submit an interactive step + +Resolve the step the job is currently awaiting and resume the pipeline. The request +body shape depends on `step` (a `oneOf` discriminated by the step name). + + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.omr_details_submission import OmrDetailsSubmission +from flat_api.models.omr_job import OmrJob +from flat_api.models.omr_step_name import OmrStepName +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OMRApi(api_client) + job = 'job_example' # str | Unique identifier of the OMR job + step = flat_api.OmrStepName() # OmrStepName | The pending step being submitted + body = flat_api.OmrDetailsSubmission() # OmrDetailsSubmission | + x_flat_locale = 'fr' # str | Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. (optional) + + try: + # Submit an interactive step + api_response = api_instance.submit_omr_job_step(job, step, body, x_flat_locale=x_flat_locale) + print("The response of OMRApi->submit_omr_job_step:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OMRApi->submit_omr_job_step: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **job** | **str**| Unique identifier of the OMR job | + **step** | [**OmrStepName**](.md)| The pending step being submitted | + **body** | **OmrDetailsSubmission**| | + **x_flat_locale** | **str**| Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. | [optional] + +### Return type + +[**OmrJob**](OmrJob.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**202** | Step accepted, processing resumed | - | +**409** | Job is not awaiting this step | - | +**0** | Error | - | + +[[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) + diff --git a/docs/reference/OmrCapabilities.md b/docs/reference/OmrCapabilities.md new file mode 100644 index 0000000..a3b63c7 --- /dev/null +++ b/docs/reference/OmrCapabilities.md @@ -0,0 +1,43 @@ +# OmrCapabilities + +What the account or app can do, for client feature-detection. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**steps** | [**List[OmrStepName]**](OmrStepName.md) | Interactive steps this server supports. | +**formats** | **List[str]** | Export formats available via `getOmrJobExport`. | +**outputs** | [**List[OmrJobOutput]**](OmrJobOutput.md) | Output destinations the account can use when creating a job. | +**max_files** | **int** | Maximum number of input files that can be added to a single job. | +**max_pages** | **int** | Maximum number of pages allowed across all input files of a single job. | +**max_parallel_jobs** | **int** | Maximum number of OMR jobs that can run in parallel for this account. | +**max_file_size** | **int** | Maximum size of a single file, in bytes. | +**accepted_mime_types** | **List[str]** | MIME types accepted for input files: PDF, plus the raster image formats. Drive the file picker from this list rather than hardcoding it, so newly supported formats need no client release. A file is identified by its content, so its declared type and its extension do not have to match. A multi-page input counts as several pages against `maxPages` and is charged accordingly. That covers PDFs and, among the image formats, multi-page TIFF and animated GIF/WebP. | +**accepted_extensions** | **List[str]** | Filename extensions the accepted types appear under, for building a file picker. Use these alongside `acceptedMimeTypes` in an `accept` attribute: browsers and native file dialogs filter unreliably on some of the image types, so a valid file can be greyed out when only its MIME type is offered. Longer than `acceptedMimeTypes`, because one type arrives under several extensions (`.jpg` and `.jpeg`, `.tif` and `.tiff`, `.heic` and `.heif`). Picker metadata only. A file is identified by its content, so its extension never decides whether an upload is accepted. | +**cost_per_page** | **int** | Credits charged per page. | [optional] +**remaining_credits** | **int** | OMR credits remaining for the account. | [optional] +**retention_days** | **int** | How many days a `musicxml` job's uploaded files and results are kept before erasure. Reflects the account's own period when one has been set, otherwise the platform default. Read-only: contact support to change it. Jobs with `output: library` are not covered by the retention policy and are unaffected by this value. | [optional] +**locales** | **List[str]** | Locales selectable for OCR, as BCP 47 codes sorted alphabetically. These are the locales the recognition pipeline can actually read, which is neither the list of Flat interface locales nor a fixed set: new languages are added over time. Clients should default to the user's own locale when it appears here. | +**locales_details** | [**List[OmrLocaleDetails]**](OmrLocaleDetails.md) | The same locales as `locales`, each with its English display name, sorted alphabetically by `name` and ready to bind to a language picker. Prefer this over `locales` when rendering a selector: it saves clients from shipping their own code-to-label table. | + +## Example + +```python +from flat_api.models.omr_capabilities import OmrCapabilities + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrCapabilities from a JSON string +omr_capabilities_instance = OmrCapabilities.from_json(json) +# print the JSON string representation of the object +print(OmrCapabilities.to_json()) + +# convert the object into a dict +omr_capabilities_dict = omr_capabilities_instance.to_dict() +# create an instance of OmrCapabilities from a dict +omr_capabilities_from_dict = OmrCapabilities.from_dict(omr_capabilities_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/reference/OmrDetailsStepData.md b/docs/reference/OmrDetailsStepData.md new file mode 100644 index 0000000..5127348 --- /dev/null +++ b/docs/reference/OmrDetailsStepData.md @@ -0,0 +1,32 @@ +# OmrDetailsStepData + +Detected score details for review (the \"Check your score details\" screen). The worker produces `title` and `instruments` from assembly; the language is not detected and is not part of this payload (the client reads the job's `locales`, set at creation). + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**step** | **str** | Discriminator for `OmrPendingStep.data`; always `details` for this payload. | +**title** | **str** | OCR-detected work title. | [optional] +**instruments** | [**List[OmrDetectedInstrument]**](OmrDetectedInstrument.md) | | + +## Example + +```python +from flat_api.models.omr_details_step_data import OmrDetailsStepData + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrDetailsStepData from a JSON string +omr_details_step_data_instance = OmrDetailsStepData.from_json(json) +# print the JSON string representation of the object +print(OmrDetailsStepData.to_json()) + +# convert the object into a dict +omr_details_step_data_dict = omr_details_step_data_instance.to_dict() +# create an instance of OmrDetailsStepData from a dict +omr_details_step_data_from_dict = OmrDetailsStepData.from_dict(omr_details_step_data_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/reference/OmrDetailsSubmission.md b/docs/reference/OmrDetailsSubmission.md new file mode 100644 index 0000000..9ccccf6 --- /dev/null +++ b/docs/reference/OmrDetailsSubmission.md @@ -0,0 +1,33 @@ +# OmrDetailsSubmission + +Overrides for the `details` step. Omitted fields keep the server's detected values. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**step** | **str** | Discriminator for `OmrStepSubmission`; always `details` for this submission. | +**title** | **str** | Override the detected work title. | [optional] +**main_language** | **str** | Override the main language (BCP 47) used for lyric and text reading on resume. Defaults to the job locale (`locales`); set this to correct it on the review screen. | [optional] +**instruments** | [**List[OmrInstrumentOverride]**](OmrInstrumentOverride.md) | Per-part overrides, each matched to a detected part by `index`. | [optional] + +## Example + +```python +from flat_api.models.omr_details_submission import OmrDetailsSubmission + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrDetailsSubmission from a JSON string +omr_details_submission_instance = OmrDetailsSubmission.from_json(json) +# print the JSON string representation of the object +print(OmrDetailsSubmission.to_json()) + +# convert the object into a dict +omr_details_submission_dict = omr_details_submission_instance.to_dict() +# create an instance of OmrDetailsSubmission from a dict +omr_details_submission_from_dict = OmrDetailsSubmission.from_dict(omr_details_submission_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/reference/OmrDetectedInstrument.md b/docs/reference/OmrDetectedInstrument.md new file mode 100644 index 0000000..d50e44f --- /dev/null +++ b/docs/reference/OmrDetectedInstrument.md @@ -0,0 +1,36 @@ +# OmrDetectedInstrument + +One detected part. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **int** | 0-based position of the part in the score. | +**part_name** | **str** | Verbatim part name read from the score. | [optional] +**instrument_id** | **str** | Flat instrument ID in dotted `<group>.<instrument>` form, for example `brass.horn` or `vocals.voice-oohs`. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments). Always the canonical (non-premium) ID. | [optional] +**instrument_name** | **str** | Localized display name, resolved server-side so the client needs no instruments dictionary. | [optional] +**midi_program** | **int** | General MIDI program number. | [optional] +**transpose_key** | **str** | Transposition or written key shown in the UI, for example `F` for Horn in F. | [optional] +**resolved_confidence** | **str** | Server confidence in the resolved instrument match. | [optional] + +## Example + +```python +from flat_api.models.omr_detected_instrument import OmrDetectedInstrument + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrDetectedInstrument from a JSON string +omr_detected_instrument_instance = OmrDetectedInstrument.from_json(json) +# print the JSON string representation of the object +print(OmrDetectedInstrument.to_json()) + +# convert the object into a dict +omr_detected_instrument_dict = omr_detected_instrument_instance.to_dict() +# create an instance of OmrDetectedInstrument from a dict +omr_detected_instrument_from_dict = OmrDetectedInstrument.from_dict(omr_detected_instrument_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/reference/OmrImportedMetadata.md b/docs/reference/OmrImportedMetadata.md new file mode 100644 index 0000000..e435e78 --- /dev/null +++ b/docs/reference/OmrImportedMetadata.md @@ -0,0 +1,33 @@ +# OmrImportedMetadata + +Metadata extracted from the recognized score. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**instruments** | **List[str]** | Instrument IDs of the assembled parts. | [optional] +**number_measures** | **int** | Number of measures in the recognized score. | [optional] +**main_tempo_qpm** | **float** | Main tempo, in quarter notes per minute. | [optional] +**main_key_signature** | **int** | Main key signature as a fifths count (negative for flats, positive for sharps, 0 for C major / A minor). | [optional] + +## Example + +```python +from flat_api.models.omr_imported_metadata import OmrImportedMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrImportedMetadata from a JSON string +omr_imported_metadata_instance = OmrImportedMetadata.from_json(json) +# print the JSON string representation of the object +print(OmrImportedMetadata.to_json()) + +# convert the object into a dict +omr_imported_metadata_dict = omr_imported_metadata_instance.to_dict() +# create an instance of OmrImportedMetadata from a dict +omr_imported_metadata_from_dict = OmrImportedMetadata.from_dict(omr_imported_metadata_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/reference/OmrInstrumentOverride.md b/docs/reference/OmrInstrumentOverride.md new file mode 100644 index 0000000..9ac242c --- /dev/null +++ b/docs/reference/OmrInstrumentOverride.md @@ -0,0 +1,34 @@ +# OmrInstrumentOverride + +Override for a single detected part, matched by `index`. Omitted fields keep the detected value. To set the instrument you may use **either** `instrumentId` (Flat's instrument id) **or** `midiProgram` (a standard General MIDI program) — whichever your integration prefers; you do not need both. If both are sent, `instrumentId` wins; otherwise `midiProgram` is resolved to the matching instrument; otherwise the detected instrument is kept. `transposeKey` and `partName` apply independently on top. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**index** | **int** | 0-based position of the part to override, matching the `index` of the detected part. | +**instrument_id** | **str** | Override the resolved instrument with this Flat instrument id, for example `brass.horn`. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments) for valid values. Both the dotted `<group>.<instrument>` form (`brass.horn`) and the bare instrument key (`horn`) are accepted. Use this or `midiProgram`. Takes precedence over `midiProgram` when both are set. | [optional] +**part_name** | **str** | Override the part name. | [optional] +**transpose_key** | **str** | Override the transposition / written key: a pitch class as a letter `A`-`G` with an optional accidental. For example `F` for Horn in F or `Bb` for a B flat clarinet. The accidental may be ASCII `b` (flat) or `#` (sharp), or the Unicode music glyphs `♭` (U+266D) and `♯` (U+266F). Unicode accidentals are normalized to their ASCII equivalent, so `B♭` is stored and returned as `Bb`. | [optional] +**midi_program** | **int** | Override the instrument with a standard General MIDI program number (0-127), resolved server-side to the matching Flat instrument. Use this when you do not want to map Flat instrument ids. Ignored if `instrumentId` is also set. | [optional] + +## Example + +```python +from flat_api.models.omr_instrument_override import OmrInstrumentOverride + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrInstrumentOverride from a JSON string +omr_instrument_override_instance = OmrInstrumentOverride.from_json(json) +# print the JSON string representation of the object +print(OmrInstrumentOverride.to_json()) + +# convert the object into a dict +omr_instrument_override_dict = omr_instrument_override_instance.to_dict() +# create an instance of OmrInstrumentOverride from a dict +omr_instrument_override_from_dict = OmrInstrumentOverride.from_dict(omr_instrument_override_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/reference/OmrJob.md b/docs/reference/OmrJob.md new file mode 100644 index 0000000..6547237 --- /dev/null +++ b/docs/reference/OmrJob.md @@ -0,0 +1,45 @@ +# OmrJob + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Unique identifier of the OMR job. | +**status** | [**OmrJobStatus**](OmrJobStatus.md) | | +**output** | [**OmrJobOutput**](OmrJobOutput.md) | | [default to OmrJobOutput.LIBRARY] +**interactive_steps** | [**List[OmrStepName]**](OmrStepName.md) | Steps this job pauses at for client input, echoing the value set at creation. | +**locales** | **List[str]** | Locale hints (BCP 47) the job was created with, used for OCR and as the default main language at the `details` step. | [optional] +**current_step** | [**OmrStepName**](OmrStepName.md) | The pending step when `status` is `awaitingInput`. Omitted otherwise. | [optional] +**pending_step** | [**OmrPendingStep**](OmrPendingStep.md) | | [optional] +**estimated_credits** | **int** | Credits that will be or were charged at start (page-based), so a client can show a confirmation before charging. | [optional] +**progress** | [**OmrJobProgress**](OmrJobProgress.md) | | [optional] +**original_file_metadata** | [**OmrJobFileMetadata**](OmrJobFileMetadata.md) | | [optional] +**imported_metadata** | [**OmrImportedMetadata**](OmrImportedMetadata.md) | | [optional] +**result** | [**OmrJobResult**](OmrJobResult.md) | | [optional] +**retention** | [**OmrJobRetention**](OmrJobRetention.md) | | [optional] +**error_code** | **str** | Stable, engine-agnostic failure code, present when `status` is `error`. Branch on this for custom handling, and render `errorMessage` for the user-facing text. This is an open string: new codes may be added over time, so keep a generic fallback and never hardcode an exhaustive switch. Current values: * `NO_MUSIC_DETECTED`: no musical content found (poor scan, rotated page, or tablature). * `CORRUPTED_FILE`: the input file is corrupted and could not be read. * `UNSUPPORTED_FORMAT`: the file format or notation is not supported yet. * `UNSUPPORTED_TABLATURE`: the file is guitar tablature, not supported yet. * `ENCRYPTED_PDF`: the PDF is password-protected. * `TOO_LARGE`: the document is too large or has an unusual shape to process. * `ENGINE_TIMEOUT`: recognition took longer than expected and was stopped. * `GENERIC`: unspecified failure. | [optional] +**error_message** | **str** | Localized, user-facing error message, present when `status` is `error`. Rendered in the caller's locale and safe to display as-is. Pair with `errorCode` for branching. | [optional] +**creation_date** | **datetime** | When the job was created. | [optional] +**modification_date** | **datetime** | When the job was last updated. | [optional] + +## Example + +```python +from flat_api.models.omr_job import OmrJob + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJob from a JSON string +omr_job_instance = OmrJob.from_json(json) +# print the JSON string representation of the object +print(OmrJob.to_json()) + +# convert the object into a dict +omr_job_dict = omr_job_instance.to_dict() +# create an instance of OmrJob from a dict +omr_job_from_dict = OmrJob.from_dict(omr_job_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/reference/OmrJobCreation.md b/docs/reference/OmrJobCreation.md new file mode 100644 index 0000000..97e7e21 --- /dev/null +++ b/docs/reference/OmrJobCreation.md @@ -0,0 +1,36 @@ +# OmrJobCreation + +Parameters to create an OMR job. Send without `files` to create a draft (then add files with `addOmrJobFile` and run `startOmrJob`), or include `files` and `autoStart: true` to import in a single request. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**output** | [**OmrJobOutput**](OmrJobOutput.md) | | [optional] [default to OmrJobOutput.LIBRARY] +**interactive_steps** | [**List[OmrStepName]**](OmrStepName.md) | Steps at which the pipeline should pause for this client. Omit or send `[]` for a fully automatic import. The server only pauses at the steps listed here; declare only steps your client can actually render. | [optional] [default to []] +**locales** | **List[str]** | Locale hints (BCP 47) to improve text and lyric detection, for example `[\"ja\", \"en\"]`. The first entry drives the OCR reader. This is the input hint; the detected main language is confirmed later at the `details` step. | [optional] +**collection** | **str** | Target collection ID. Only used when `output` is `library`. | [optional] +**idempotency_key** | **str** | Optional client-supplied key. A retry with the same key returns the existing job instead of creating a duplicate, for safe retries on flaky networks. | [optional] +**files** | [**List[OmrJobInputFile]**](OmrJobInputFile.md) | Optional inline inputs for a one-shot import. For multi-image or mobile capture, omit this and use `addOmrJobFile`. | [optional] +**auto_start** | **bool** | Start processing immediately. Only valid when `files` is provided. | [optional] + +## Example + +```python +from flat_api.models.omr_job_creation import OmrJobCreation + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobCreation from a JSON string +omr_job_creation_instance = OmrJobCreation.from_json(json) +# print the JSON string representation of the object +print(OmrJobCreation.to_json()) + +# convert the object into a dict +omr_job_creation_dict = omr_job_creation_instance.to_dict() +# create an instance of OmrJobCreation from a dict +omr_job_creation_from_dict = OmrJobCreation.from_dict(omr_job_creation_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/reference/OmrJobFileMetadata.md b/docs/reference/OmrJobFileMetadata.md new file mode 100644 index 0000000..6c51447 --- /dev/null +++ b/docs/reference/OmrJobFileMetadata.md @@ -0,0 +1,35 @@ +# OmrJobFileMetadata + +Metadata about the uploaded input. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**number_of_pages** | **int** | Total number of pages across all input files. | [optional] +**file_count** | **int** | Number of input files attached. | [optional] +**filename** | **str** | Original filename of the input as uploaded (of the first file when several were combined). | [optional] +**file_size** | **int** | Combined size of the input files, in bytes. | [optional] +**mime_type** | **str** | MIME type of the input (of the first file when several were combined). | [optional] +**file_extension** | **str** | File extension of the input, without the leading dot (for example `pdf`). | [optional] + +## Example + +```python +from flat_api.models.omr_job_file_metadata import OmrJobFileMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobFileMetadata from a JSON string +omr_job_file_metadata_instance = OmrJobFileMetadata.from_json(json) +# print the JSON string representation of the object +print(OmrJobFileMetadata.to_json()) + +# convert the object into a dict +omr_job_file_metadata_dict = omr_job_file_metadata_instance.to_dict() +# create an instance of OmrJobFileMetadata from a dict +omr_job_file_metadata_from_dict = OmrJobFileMetadata.from_dict(omr_job_file_metadata_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/reference/OmrJobFileUpload.md b/docs/reference/OmrJobFileUpload.md new file mode 100644 index 0000000..eef4135 --- /dev/null +++ b/docs/reference/OmrJobFileUpload.md @@ -0,0 +1,31 @@ +# OmrJobFileUpload + +One image or PDF added to a draft job. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | **bytes** | File data, base64-encoded. The type is read from the content itself, so no declared MIME type or filename extension is needed. Accepted types are listed by `getOmrCapabilities` in `acceptedMimeTypes`. | +**filename** | **str** | Optional original filename, kept for display. | [optional] + +## Example + +```python +from flat_api.models.omr_job_file_upload import OmrJobFileUpload + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobFileUpload from a JSON string +omr_job_file_upload_instance = OmrJobFileUpload.from_json(json) +# print the JSON string representation of the object +print(OmrJobFileUpload.to_json()) + +# convert the object into a dict +omr_job_file_upload_dict = omr_job_file_upload_instance.to_dict() +# create an instance of OmrJobFileUpload from a dict +omr_job_file_upload_from_dict = OmrJobFileUpload.from_dict(omr_job_file_upload_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/reference/OmrJobFileUploadResult.md b/docs/reference/OmrJobFileUploadResult.md new file mode 100644 index 0000000..cdf991e --- /dev/null +++ b/docs/reference/OmrJobFileUploadResult.md @@ -0,0 +1,31 @@ +# OmrJobFileUploadResult + +Result of adding a file to a draft job. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file_index** | **int** | 0-based index assigned to the uploaded file. | [optional] +**file_count** | **int** | Total number of files now attached to the job. | [optional] + +## Example + +```python +from flat_api.models.omr_job_file_upload_result import OmrJobFileUploadResult + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobFileUploadResult from a JSON string +omr_job_file_upload_result_instance = OmrJobFileUploadResult.from_json(json) +# print the JSON string representation of the object +print(OmrJobFileUploadResult.to_json()) + +# convert the object into a dict +omr_job_file_upload_result_dict = omr_job_file_upload_result_instance.to_dict() +# create an instance of OmrJobFileUploadResult from a dict +omr_job_file_upload_result_from_dict = OmrJobFileUploadResult.from_dict(omr_job_file_upload_result_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/reference/OmrJobInputFile.md b/docs/reference/OmrJobInputFile.md new file mode 100644 index 0000000..fe74a57 --- /dev/null +++ b/docs/reference/OmrJobInputFile.md @@ -0,0 +1,31 @@ +# OmrJobInputFile + +A single image or PDF input, base64-encoded. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**file** | **bytes** | File data, base64-encoded. The type is read from the content itself, so no declared MIME type or filename extension is needed. Accepted types are listed by `getOmrCapabilities` in `acceptedMimeTypes`. | +**filename** | **str** | Optional original filename, kept for display. | [optional] + +## Example + +```python +from flat_api.models.omr_job_input_file import OmrJobInputFile + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobInputFile from a JSON string +omr_job_input_file_instance = OmrJobInputFile.from_json(json) +# print the JSON string representation of the object +print(OmrJobInputFile.to_json()) + +# convert the object into a dict +omr_job_input_file_dict = omr_job_input_file_instance.to_dict() +# create an instance of OmrJobInputFile from a dict +omr_job_input_file_from_dict = OmrJobInputFile.from_dict(omr_job_input_file_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/reference/OmrJobOutput.md b/docs/reference/OmrJobOutput.md new file mode 100644 index 0000000..1275fba --- /dev/null +++ b/docs/reference/OmrJobOutput.md @@ -0,0 +1,13 @@ +# OmrJobOutput + +Where the result of the job goes. * `library`: import the result into the Flat Library and create a score (default). * `musicxml`: finalize the result only, downloadable via `getOmrJobExport`. No score is created, for third-party integrations that do not use the Library. + +## Enum + +* `LIBRARY` (value: `'library'`) + +* `MUSICXML` (value: `'musicxml'`) + +[[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/reference/OmrJobProgress.md b/docs/reference/OmrJobProgress.md new file mode 100644 index 0000000..268f18b --- /dev/null +++ b/docs/reference/OmrJobProgress.md @@ -0,0 +1,32 @@ +# OmrJobProgress + +Live progress while the job is processing. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**percent** | **float** | Completion percentage (0-100). | [optional] +**text** | **str** | Localized progress message, ready to display. | [optional] +**key** | **str** | Stable progress key (for example `OMR_QUEUED`, `OMR_PROCESSING_PAGE`, `OMR_CREATING_SCORE`), for matching the current phase in a stepper UI independent of locale. | [optional] + +## Example + +```python +from flat_api.models.omr_job_progress import OmrJobProgress + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobProgress from a JSON string +omr_job_progress_instance = OmrJobProgress.from_json(json) +# print the JSON string representation of the object +print(OmrJobProgress.to_json()) + +# convert the object into a dict +omr_job_progress_dict = omr_job_progress_instance.to_dict() +# create an instance of OmrJobProgress from a dict +omr_job_progress_from_dict = OmrJobProgress.from_dict(omr_job_progress_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/reference/OmrJobResult.md b/docs/reference/OmrJobResult.md new file mode 100644 index 0000000..534695d --- /dev/null +++ b/docs/reference/OmrJobResult.md @@ -0,0 +1,31 @@ +# OmrJobResult + +The outcome of a finished job. Present when `status` is `done`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**score** | **str** | Created score ID, when `output` is `library`. | [optional] +**exports** | **List[str]** | Formats available via `getOmrJobExport`, for example `[\"musicxml\", \"mxl\", \"midi\"]`. | [optional] + +## Example + +```python +from flat_api.models.omr_job_result import OmrJobResult + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobResult from a JSON string +omr_job_result_instance = OmrJobResult.from_json(json) +# print the JSON string representation of the object +print(OmrJobResult.to_json()) + +# convert the object into a dict +omr_job_result_dict = omr_job_result_instance.to_dict() +# create an instance of OmrJobResult from a dict +omr_job_result_from_dict = OmrJobResult.from_dict(omr_job_result_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/reference/OmrJobRetention.md b/docs/reference/OmrJobRetention.md new file mode 100644 index 0000000..49b68e4 --- /dev/null +++ b/docs/reference/OmrJobRetention.md @@ -0,0 +1,31 @@ +# OmrJobRetention + +Data-retention state of the job. Present only on jobs whose `output` is `musicxml`. Jobs imported into the Flat library are part of your library content, are not covered by this policy, and omit this object entirely. Erasure is performed by a periodic cleanup pass, so the files are removed shortly after `expiryDate` rather than exactly on it. Plan for the deadline, not the instant. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**expiry_date** | **datetime** | When this job's uploaded files and recognition results become eligible for erasure. Fixed when the job is created: changing the account's retention period does not move the deadline of jobs that already exist. | +**expired_date** | **datetime** | When the job's stored files were actually erased. Present only once that happened. An expired job keeps the `status` it finished with and stays listable, but its `result` is no longer served and downloads fail with `OMR_JOB_EXPIRED`. | [optional] + +## Example + +```python +from flat_api.models.omr_job_retention import OmrJobRetention + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrJobRetention from a JSON string +omr_job_retention_instance = OmrJobRetention.from_json(json) +# print the JSON string representation of the object +print(OmrJobRetention.to_json()) + +# convert the object into a dict +omr_job_retention_dict = omr_job_retention_instance.to_dict() +# create an instance of OmrJobRetention from a dict +omr_job_retention_from_dict = OmrJobRetention.from_dict(omr_job_retention_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/reference/OmrJobStatus.md b/docs/reference/OmrJobStatus.md new file mode 100644 index 0000000..a278a5a --- /dev/null +++ b/docs/reference/OmrJobStatus.md @@ -0,0 +1,21 @@ +# OmrJobStatus + +Public, client-facing status of the job, derived from the internal job and task state. * `draft`: created, files can still be added; not yet started or charged. * `processing`: the pipeline is running. * `awaitingInput`: paused on the `currentStep`, waiting for the client to submit it. * `done`: finished. See `result`. * `error`: failed. See `errorCode`. * `canceled`: canceled by the client. + +## Enum + +* `DRAFT` (value: `'draft'`) + +* `PROCESSING` (value: `'processing'`) + +* `AWAITINGINPUT` (value: `'awaitingInput'`) + +* `DONE` (value: `'done'`) + +* `ERROR` (value: `'error'`) + +* `CANCELED` (value: `'canceled'`) + +[[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/reference/OmrLocaleDetails.md b/docs/reference/OmrLocaleDetails.md new file mode 100644 index 0000000..601aa3a --- /dev/null +++ b/docs/reference/OmrLocaleDetails.md @@ -0,0 +1,31 @@ +# OmrLocaleDetails + +An OCR-selectable locale with its English name. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | BCP 47 locale code. Always one of the codes listed in `locales`. | +**name** | **str** | English name of the language, for display in a picker. | + +## Example + +```python +from flat_api.models.omr_locale_details import OmrLocaleDetails + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrLocaleDetails from a JSON string +omr_locale_details_instance = OmrLocaleDetails.from_json(json) +# print the JSON string representation of the object +print(OmrLocaleDetails.to_json()) + +# convert the object into a dict +omr_locale_details_dict = omr_locale_details_instance.to_dict() +# create an instance of OmrLocaleDetails from a dict +omr_locale_details_from_dict = OmrLocaleDetails.from_dict(omr_locale_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/reference/OmrPendingStep.md b/docs/reference/OmrPendingStep.md new file mode 100644 index 0000000..147c1fe --- /dev/null +++ b/docs/reference/OmrPendingStep.md @@ -0,0 +1,31 @@ +# OmrPendingStep + +The step currently awaiting client input. The `data` shape is keyed by `step`. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**step** | [**OmrStepName**](OmrStepName.md) | | +**data** | [**OmrDetailsStepData**](OmrDetailsStepData.md) | | + +## Example + +```python +from flat_api.models.omr_pending_step import OmrPendingStep + +# TODO update the JSON string below +json = "{}" +# create an instance of OmrPendingStep from a JSON string +omr_pending_step_instance = OmrPendingStep.from_json(json) +# print the JSON string representation of the object +print(OmrPendingStep.to_json()) + +# convert the object into a dict +omr_pending_step_dict = omr_pending_step_instance.to_dict() +# create an instance of OmrPendingStep from a dict +omr_pending_step_from_dict = OmrPendingStep.from_dict(omr_pending_step_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/reference/OmrStepName.md b/docs/reference/OmrStepName.md new file mode 100644 index 0000000..544dc5d --- /dev/null +++ b/docs/reference/OmrStepName.md @@ -0,0 +1,11 @@ +# OmrStepName + +Interactive pipeline step. Forward-compatible: new values may be added over time. Only steps a client lists in `interactiveSteps` can pause that client's job; any step a client does not list (including future ones) is auto-resolved by the server. * `details`: confirm or adjust the detected title, main language and instruments before assembly. Pauses after note recognition, so resuming re-runs only the cheap assembly and finalize stages. + +## Enum + +* `DETAILS` (value: `'details'`) + +[[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/OrganizationApi.md b/docs/reference/OrganizationApi.md similarity index 73% rename from docs/OrganizationApi.md rename to docs/reference/OrganizationApi.md index da7c65b..5747b10 100644 --- a/docs/OrganizationApi.md +++ b/docs/reference/OrganizationApi.md @@ -5,22 +5,26 @@ All URIs are relative to *https://api.flat.io/v2* Method | HTTP request | Description ------------- | ------------- | ------------- [**count_orga_users**](OrganizationApi.md#count_orga_users) | **GET** /organizations/users/count | Count the organization users using the provided filters +[**create_lti_configuration**](OrganizationApi.md#create_lti_configuration) | **POST** /organizations/lti/configurations | Create a new LTI configuration (1.1 or 1.3) [**create_lti_credentials**](OrganizationApi.md#create_lti_credentials) | **POST** /organizations/lti/credentials | Create a new couple of LTI 1.x credentials [**create_organization_invitation**](OrganizationApi.md#create_organization_invitation) | **POST** /organizations/invitations | Create a new invitation to join the organization [**create_organization_user**](OrganizationApi.md#create_organization_user) | **POST** /organizations/users | Create a new user account [**create_organization_user_access_token**](OrganizationApi.md#create_organization_user_access_token) | **POST** /organizations/users/{user}/accessToken | Create a delegated API access token for an organization user [**create_organization_user_signin_link**](OrganizationApi.md#create_organization_user_signin_link) | **POST** /organizations/users/{user}/signinLink | Create a sign in link for an organization user +[**delete_lti_configuration**](OrganizationApi.md#delete_lti_configuration) | **DELETE** /organizations/lti/configurations/{configuration} | Delete an LTI configuration +[**list_lti_configurations**](OrganizationApi.md#list_lti_configurations) | **GET** /organizations/lti/configurations | List LTI configurations (1.1 and 1.3) [**list_lti_credentials**](OrganizationApi.md#list_lti_credentials) | **GET** /organizations/lti/credentials | List LTI 1.x credentials [**list_organization_invitations**](OrganizationApi.md#list_organization_invitations) | **GET** /organizations/invitations | List the organization invitations [**list_organization_users**](OrganizationApi.md#list_organization_users) | **GET** /organizations/users | List the organization users [**remove_organization_invitation**](OrganizationApi.md#remove_organization_invitation) | **DELETE** /organizations/invitations/{invitation} | Remove an organization invitation [**remove_organization_user**](OrganizationApi.md#remove_organization_user) | **DELETE** /organizations/users/{user} | Remove an account from Flat [**revoke_lti_credentials**](OrganizationApi.md#revoke_lti_credentials) | **DELETE** /organizations/lti/credentials/{credentials} | Revoke LTI 1.x credentials +[**update_lti_configuration**](OrganizationApi.md#update_lti_configuration) | **PUT** /organizations/lti/configurations/{configuration} | Update an existing LTI configuration (edit 1.3; 1.1 not editable) [**update_organization_user**](OrganizationApi.md#update_organization_user) | **PUT** /organizations/users/{user} | Update account information # **count_orga_users** -> List[UserDetailsAdmin] count_orga_users(role=role, q=q, group=group, no_active_license=no_active_license) +> int count_orga_users(role=role, q=q, group=group, no_active_license=no_active_license, test_accounts=test_accounts) Count the organization users using the provided filters @@ -30,7 +34,6 @@ Count the organization users using the provided filters ```python import flat_api -from flat_api.models.user_details_admin import UserDetailsAdmin from flat_api.rest import ApiException from pprint import pprint @@ -55,10 +58,11 @@ with flat_api.ApiClient(configuration) as api_client: q = 'q_example' # str | The query to search (optional) group = ['group_example'] # List[str] | Filter users by group (optional) no_active_license = True # bool | Filter users who don't have an active license (optional) + test_accounts = 'test_accounts_example' # str | Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. (optional) try: # Count the organization users using the provided filters - api_response = api_instance.count_orga_users(role=role, q=q, group=group, no_active_license=no_active_license) + api_response = api_instance.count_orga_users(role=role, q=q, group=group, no_active_license=no_active_license, test_accounts=test_accounts) print("The response of OrganizationApi->count_orga_users:\n") pprint(api_response) except Exception as e: @@ -76,10 +80,11 @@ Name | Type | Description | Notes **q** | **str**| The query to search | [optional] **group** | [**List[str]**](str.md)| Filter users by group | [optional] **no_active_license** | **bool**| Filter users who don't have an active license | [optional] + **test_accounts** | **str**| Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. | [optional] ### Return type -[**List[UserDetailsAdmin]**](UserDetailsAdmin.md) +**int** ### Authorization @@ -99,12 +104,91 @@ 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) +# **create_lti_configuration** +> CreateLtiConfiguration200Response create_lti_configuration(lti_configuration_create) + +Create a new LTI configuration (1.1 or 1.3) + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.create_lti_configuration200_response import CreateLtiConfiguration200Response +from flat_api.models.lti_configuration_create import LtiConfigurationCreate +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OrganizationApi(api_client) + lti_configuration_create = flat_api.LtiConfigurationCreate() # LtiConfigurationCreate | + + try: + # Create a new LTI configuration (1.1 or 1.3) + api_response = api_instance.create_lti_configuration(lti_configuration_create) + print("The response of OrganizationApi->create_lti_configuration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationApi->create_lti_configuration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **lti_configuration_create** | [**LtiConfigurationCreate**](LtiConfigurationCreate.md)| | + +### Return type + +[**CreateLtiConfiguration200Response**](CreateLtiConfiguration200Response.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The created LTI configuration | - | +**0** | Error | - | + +[[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) + # **create_lti_credentials** > LtiCredentials create_lti_credentials(body) Create a new couple of LTI 1.x credentials -Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). +DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. +Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + +Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). + ### Example @@ -182,7 +266,12 @@ Name | Type | Description | Notes Create a new invitation to join the organization -This method creates and sends invitation for teachers and admins. Invitations can only be used by new Flat users or users who are not part of the organization yet. If the email of the user is already associated to a user of your organization, the API will simply update the role of the existing user and won't send an invitation. In this case, the property `usedBy` will be directly filled with the uniquer identifier of the corresponding user. +This method creates and sends invitation for teachers and admins. + +Invitations can only be used by new Flat users or users who are not part of the organization yet. + +If the email of the user is already associated to a user of your organization, the API will simply update the role of the existing user and won't send an invitation. In this case, the property `usedBy` will be directly filled with the uniquer identifier of the corresponding user. + ### Example @@ -334,7 +423,9 @@ Name | Type | Description | Notes Create a delegated API access token for an organization user -This operation will create an API access token for a chosen organization user. This token will be valid for a limited time and can be used to access the API as the organization user. +This operation will create an API access token for a chosen organization user. +This token will be valid for a limited time and can be used to access the API as the organization user. + ### Example @@ -485,11 +576,156 @@ 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) +# **delete_lti_configuration** +> delete_lti_configuration(configuration) + +Delete an LTI configuration + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OrganizationApi(api_client) + configuration = 'configuration_example' # str | Configuration unique identifier + + try: + # Delete an LTI configuration + api_instance.delete_lti_configuration(configuration) + except Exception as e: + print("Exception when calling OrganizationApi->delete_lti_configuration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **configuration** | **str**| Configuration unique identifier | + +### Return type + +void (empty response body) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Configuration deleted | - | +**0** | Error | - | + +[[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_lti_configurations** +> List[LtiConfiguration] list_lti_configurations() + +List LTI configurations (1.1 and 1.3) + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.lti_configuration import LtiConfiguration +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OrganizationApi(api_client) + + try: + # List LTI configurations (1.1 and 1.3) + api_response = api_instance.list_lti_configurations() + print("The response of OrganizationApi->list_lti_configurations:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationApi->list_lti_configurations: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[LtiConfiguration]**](LtiConfiguration.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The list of LTI configurations for the caller's organization | - | +**0** | Error | - | + +[[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_lti_credentials** > List[LtiCredentials] list_lti_credentials() List LTI 1.x credentials +DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. +Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + ### Example * OAuth Authentication (OAuth2): @@ -637,7 +873,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_organization_users** -> List[UserDetailsAdmin] list_organization_users(sort=sort, direction=direction, next=next, previous=previous, role=role, q=q, group=group, no_active_license=no_active_license, license_expiration_date=license_expiration_date, only_ids=only_ids, limit=limit) +> List[UserDetailsAdmin] list_organization_users(sort=sort, direction=direction, next=next, previous=previous, role=role, q=q, group=group, no_active_license=no_active_license, test_accounts=test_accounts, license_expiration_date=license_expiration_date, only_ids=only_ids, limit=limit) List the organization users @@ -668,7 +904,7 @@ configuration.access_token = os.environ["ACCESS_TOKEN"] with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.OrganizationApi(api_client) - sort = ['sort_example'] # List[str] | The order to sort the user list (optional) + sort = 'sort_example' # str | The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. (optional) direction = 'direction_example' # str | Sort direction (optional) next = 'next_example' # str | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) previous = 'previous_example' # str | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) @@ -676,13 +912,14 @@ with flat_api.ApiClient(configuration) as api_client: q = 'q_example' # str | The query to search (optional) group = ['group_example'] # List[str] | Filter users by group (optional) no_active_license = True # bool | Filter users who don't have an active license (optional) + test_accounts = 'test_accounts_example' # str | Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. (optional) license_expiration_date = ['license_expiration_date_example'] # List[str] | Filter users by license expiration date or `active` / `notActive` (optional) only_ids = True # bool | Return only user ids (optional) limit = 25 # int | This is the maximum number of objects that may be returned (optional) (default to 25) try: # List the organization users - api_response = api_instance.list_organization_users(sort=sort, direction=direction, next=next, previous=previous, role=role, q=q, group=group, no_active_license=no_active_license, license_expiration_date=license_expiration_date, only_ids=only_ids, limit=limit) + api_response = api_instance.list_organization_users(sort=sort, direction=direction, next=next, previous=previous, role=role, q=q, group=group, no_active_license=no_active_license, test_accounts=test_accounts, license_expiration_date=license_expiration_date, only_ids=only_ids, limit=limit) print("The response of OrganizationApi->list_organization_users:\n") pprint(api_response) except Exception as e: @@ -696,7 +933,7 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **sort** | [**List[str]**](str.md)| The order to sort the user list | [optional] + **sort** | **str**| The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. | [optional] **direction** | **str**| Sort direction | [optional] **next** | **str**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] **previous** | **str**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] @@ -704,6 +941,7 @@ Name | Type | Description | Notes **q** | **str**| The query to search | [optional] **group** | [**List[str]**](str.md)| Filter users by group | [optional] **no_active_license** | **bool**| Filter users who don't have an active license | [optional] + **test_accounts** | **str**| Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. | [optional] **license_expiration_date** | [**List[str]**](str.md)| Filter users by license expiration date or `active` / `notActive` | [optional] **only_ids** | **bool**| Return only user ids | [optional] **limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 25] @@ -806,7 +1044,10 @@ void (empty response body) Remove an account from Flat -This operation removes an account from Flat and its data, including: * The music scores created by this user (documents, history, comments, collaboration information) * Education related data (assignments and classroom information) +This operation removes an account from Flat and its data, including: +* The music scores created by this user (documents, history, comments, collaboration information) +* Education related data (assignments and classroom information) + ### Example @@ -881,6 +1122,10 @@ void (empty response body) Revoke LTI 1.x credentials +DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. +Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + ### Example * OAuth Authentication (OAuth2): @@ -949,6 +1194,83 @@ void (empty response body) [[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) +# **update_lti_configuration** +> LtiConfiguration update_lti_configuration(configuration, lti_configuration_update) + +Update an existing LTI configuration (edit 1.3; 1.1 not editable) + +### Example + +* OAuth Authentication (OAuth2): + +```python +import flat_api +from flat_api.models.lti_configuration import LtiConfiguration +from flat_api.models.lti_configuration_update import LtiConfigurationUpdate +from flat_api.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.flat.io/v2 +# See configuration.py for a list of all supported configuration parameters. +configuration = flat_api.Configuration( + host = "https://api.flat.io/v2" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +configuration.access_token = os.environ["ACCESS_TOKEN"] + +# Enter a context with an instance of the API client +with flat_api.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = flat_api.OrganizationApi(api_client) + configuration = 'configuration_example' # str | Configuration unique identifier + lti_configuration_update = flat_api.LtiConfigurationUpdate() # LtiConfigurationUpdate | + + try: + # Update an existing LTI configuration (edit 1.3; 1.1 not editable) + api_response = api_instance.update_lti_configuration(configuration, lti_configuration_update) + print("The response of OrganizationApi->update_lti_configuration:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling OrganizationApi->update_lti_configuration: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **configuration** | **str**| Configuration unique identifier | + **lti_configuration_update** | [**LtiConfigurationUpdate**](LtiConfigurationUpdate.md)| | + +### Return type + +[**LtiConfiguration**](LtiConfiguration.md) + +### Authorization + +[OAuth2](../README.md#OAuth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The updated configuration | - | +**0** | Error | - | + +[[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) + # **update_organization_user** > UserDetailsAdmin update_organization_user(user, body) diff --git a/docs/OrganizationInvitation.md b/docs/reference/OrganizationInvitation.md similarity index 87% rename from docs/OrganizationInvitation.md rename to docs/reference/OrganizationInvitation.md index 142e227..50489e7 100644 --- a/docs/OrganizationInvitation.md +++ b/docs/reference/OrganizationInvitation.md @@ -13,6 +13,7 @@ Name | Type | Description | Notes **custom_code** | **str** | Enrollment code to use when joining this organization | **email** | **str** | The email address this invitation was sent to | [optional] **invited_by** | **str** | The unique identifier of the User who created this invitation | [optional] +**html_url** | **str** | URL to join the organization using this invitation | [optional] **allow_multiple_use** | **bool** | If true, the invitation can be used multiple times. If false, the invitation can only be used once. | **used_by** | **List[str]** | List of users who used this invitation | [optional] @@ -26,12 +27,12 @@ json = "{}" # create an instance of OrganizationInvitation from a JSON string organization_invitation_instance = OrganizationInvitation.from_json(json) # print the JSON string representation of the object -print OrganizationInvitation.to_json() +print(OrganizationInvitation.to_json()) # convert the object into a dict organization_invitation_dict = organization_invitation_instance.to_dict() # create an instance of OrganizationInvitation from a dict -organization_invitation_form_dict = organization_invitation.from_dict(organization_invitation_dict) +organization_invitation_from_dict = OrganizationInvitation.from_dict(organization_invitation_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/OrganizationInvitationCreation.md b/docs/reference/OrganizationInvitationCreation.md similarity index 86% rename from docs/OrganizationInvitationCreation.md rename to docs/reference/OrganizationInvitationCreation.md index 74b2d6e..756cada 100644 --- a/docs/OrganizationInvitationCreation.md +++ b/docs/reference/OrganizationInvitationCreation.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of OrganizationInvitationCreation from a JSON string organization_invitation_creation_instance = OrganizationInvitationCreation.from_json(json) # print the JSON string representation of the object -print OrganizationInvitationCreation.to_json() +print(OrganizationInvitationCreation.to_json()) # convert the object into a dict organization_invitation_creation_dict = organization_invitation_creation_instance.to_dict() # create an instance of OrganizationInvitationCreation from a dict -organization_invitation_creation_form_dict = organization_invitation_creation.from_dict(organization_invitation_creation_dict) +organization_invitation_creation_from_dict = OrganizationInvitationCreation.from_dict(organization_invitation_creation_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/OrganizationRoles.md b/docs/reference/OrganizationRoles.md similarity index 62% rename from docs/OrganizationRoles.md rename to docs/reference/OrganizationRoles.md index 0f91a74..d21b15a 100644 --- a/docs/OrganizationRoles.md +++ b/docs/reference/OrganizationRoles.md @@ -2,10 +2,15 @@ User's Organization Role (for Edu users only) -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ADMIN` (value: `'admin'`) + +* `ACCOUNTADMIN` (value: `'accountAdmin'`) + +* `TEACHER` (value: `'teacher'`) + +* `USER` (value: `'user'`) [[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/OrganizationUserAccessTokenCreation.md b/docs/reference/OrganizationUserAccessTokenCreation.md similarity index 84% rename from docs/OrganizationUserAccessTokenCreation.md rename to docs/reference/OrganizationUserAccessTokenCreation.md index 86a142f..df48fbe 100644 --- a/docs/OrganizationUserAccessTokenCreation.md +++ b/docs/reference/OrganizationUserAccessTokenCreation.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of OrganizationUserAccessTokenCreation from a JSON string organization_user_access_token_creation_instance = OrganizationUserAccessTokenCreation.from_json(json) # print the JSON string representation of the object -print OrganizationUserAccessTokenCreation.to_json() +print(OrganizationUserAccessTokenCreation.to_json()) # convert the object into a dict organization_user_access_token_creation_dict = organization_user_access_token_creation_instance.to_dict() # create an instance of OrganizationUserAccessTokenCreation from a dict -organization_user_access_token_creation_form_dict = organization_user_access_token_creation.from_dict(organization_user_access_token_creation_dict) +organization_user_access_token_creation_from_dict = OrganizationUserAccessTokenCreation.from_dict(organization_user_access_token_creation_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/reference/RenameGroupRequest.md b/docs/reference/RenameGroupRequest.md new file mode 100644 index 0000000..b82a4fd --- /dev/null +++ b/docs/reference/RenameGroupRequest.md @@ -0,0 +1,29 @@ +# RenameGroupRequest + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | New name for the group | + +## Example + +```python +from flat_api.models.rename_group_request import RenameGroupRequest + +# TODO update the JSON string below +json = "{}" +# create an instance of RenameGroupRequest from a JSON string +rename_group_request_instance = RenameGroupRequest.from_json(json) +# print the JSON string representation of the object +print(RenameGroupRequest.to_json()) + +# convert the object into a dict +rename_group_request_dict = rename_group_request_instance.to_dict() +# create an instance of RenameGroupRequest from a dict +rename_group_request_from_dict = RenameGroupRequest.from_dict(rename_group_request_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/ResourceCollaborator.md b/docs/reference/ResourceCollaborator.md similarity index 87% rename from docs/ResourceCollaborator.md rename to docs/reference/ResourceCollaborator.md index 1fda2b8..0e1edbe 100644 --- a/docs/ResourceCollaborator.md +++ b/docs/reference/ResourceCollaborator.md @@ -1,5 +1,6 @@ # ResourceCollaborator +A collaborator of a score. The `userEmail` and `group` are only available if the requesting user is a collaborator of the related score (in this case these permissions will eventualy not be listed and exposed publicly). ## Properties @@ -8,7 +9,7 @@ Name | Type | Description | Notes **acl_read** | **bool** | `True` if the current user can read the current document | [default to False] **acl_write** | **bool** | `True` if the current user can modify the current document. If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. | [default to False] **acl_admin** | **bool** | `True` if the current user can manage the current document (i.e. share, delete) If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. | [default to False] -**is_collaborator** | **bool** | `True` if the current user is a collaborator of the current document (direct or via group). | [default to False] +**is_collaborator** | **bool** | `True` if the current user is a collaborator of the current document (direct or via group). | [optional] [default to False] **collaborator_type** | **str** | The type of the collaborator for the resource | [optional] **id** | **str** | The unique identifier of the permission | [optional] **var_date** | **datetime** | The date when the permission was added | [optional] @@ -29,12 +30,12 @@ json = "{}" # create an instance of ResourceCollaborator from a JSON string resource_collaborator_instance = ResourceCollaborator.from_json(json) # print the JSON string representation of the object -print ResourceCollaborator.to_json() +print(ResourceCollaborator.to_json()) # convert the object into a dict resource_collaborator_dict = resource_collaborator_instance.to_dict() # create an instance of ResourceCollaborator from a dict -resource_collaborator_form_dict = resource_collaborator.from_dict(resource_collaborator_dict) +resource_collaborator_from_dict = ResourceCollaborator.from_dict(resource_collaborator_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/ResourceCollaboratorCreation.md b/docs/reference/ResourceCollaboratorCreation.md similarity index 91% rename from docs/ResourceCollaboratorCreation.md rename to docs/reference/ResourceCollaboratorCreation.md index e44aa3a..989a97c 100644 --- a/docs/ResourceCollaboratorCreation.md +++ b/docs/reference/ResourceCollaboratorCreation.md @@ -24,12 +24,12 @@ json = "{}" # create an instance of ResourceCollaboratorCreation from a JSON string resource_collaborator_creation_instance = ResourceCollaboratorCreation.from_json(json) # print the JSON string representation of the object -print ResourceCollaboratorCreation.to_json() +print(ResourceCollaboratorCreation.to_json()) # convert the object into a dict resource_collaborator_creation_dict = resource_collaborator_creation_instance.to_dict() # create an instance of ResourceCollaboratorCreation from a dict -resource_collaborator_creation_form_dict = resource_collaborator_creation.from_dict(resource_collaborator_creation_dict) +resource_collaborator_creation_from_dict = ResourceCollaboratorCreation.from_dict(resource_collaborator_creation_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/ResourceRights.md b/docs/reference/ResourceRights.md similarity index 92% rename from docs/ResourceRights.md rename to docs/reference/ResourceRights.md index ff93d65..70139a1 100644 --- a/docs/ResourceRights.md +++ b/docs/reference/ResourceRights.md @@ -9,7 +9,7 @@ Name | Type | Description | Notes **acl_read** | **bool** | `True` if the current user can read the current document | [default to False] **acl_write** | **bool** | `True` if the current user can modify the current document. If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. | [default to False] **acl_admin** | **bool** | `True` if the current user can manage the current document (i.e. share, delete) If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. | [default to False] -**is_collaborator** | **bool** | `True` if the current user is a collaborator of the current document (direct or via group). | [default to False] +**is_collaborator** | **bool** | `True` if the current user is a collaborator of the current document (direct or via group). | [optional] [default to False] **collaborator_type** | **str** | The type of the collaborator for the resource | [optional] ## Example @@ -22,12 +22,12 @@ json = "{}" # create an instance of ResourceRights from a JSON string resource_rights_instance = ResourceRights.from_json(json) # print the JSON string representation of the object -print ResourceRights.to_json() +print(ResourceRights.to_json()) # convert the object into a dict resource_rights_dict = resource_rights_instance.to_dict() # create an instance of ResourceRights from a dict -resource_rights_form_dict = resource_rights.from_dict(resource_rights_dict) +resource_rights_from_dict = ResourceRights.from_dict(resource_rights_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/ScoreApi.md b/docs/reference/ScoreApi.md similarity index 89% rename from docs/ScoreApi.md rename to docs/reference/ScoreApi.md index 85b9f2c..867e84d 100644 --- a/docs/ScoreApi.md +++ b/docs/reference/ScoreApi.md @@ -41,7 +41,12 @@ Method | HTTP request | Description Add a new collaborator -Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the `user` property. - To invite an external user to the resource, specify its email in the `userEmail` property. - To add a Flat group to the resource, specify its unique identifier in the `group` property. - To update an existing collaborator, process the same request with different rights. +Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. +- To add an existing Flat user to the resource, specify its unique identifier in the `user` property. +- To invite an external user to the resource, specify its email in the `userEmail` property. +- To add a Flat group to the resource, specify its unique identifier in the `group` property. +- To update an existing collaborator, process the same request with different rights. + ### Example @@ -119,11 +124,13 @@ 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) # **add_score_track** -> ScoreTrack add_score_track(score, body) +> ScoreTrackCreationResponse add_score_track(score, body) Add a new video or audio track to the score -Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo. +Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. +This API method support medias hosted on SoundCloud, YouTube and Vimeo. + ### Example @@ -131,8 +138,8 @@ Use this method to add new track to the score. This track can then be played on ```python import flat_api -from flat_api.models.score_track import ScoreTrack from flat_api.models.score_track_creation import ScoreTrackCreation +from flat_api.models.score_track_creation_response import ScoreTrackCreationResponse from flat_api.rest import ApiException from pprint import pprint @@ -177,7 +184,7 @@ Name | Type | Description | Notes ### Return type -[**ScoreTrack**](ScoreTrack.md) +[**ScoreTrackCreationResponse**](ScoreTrackCreationResponse.md) ### Authorization @@ -204,7 +211,9 @@ Name | Type | Description | Notes Create a new score export task -Some of the exports of a score takes are longer to process than a simple API requests. Use this endpoint to launch a new export of one score hosted on Flat. +Some of the exports of a score takes are longer to process than a simple API requests. +Use this endpoint to launch a new export of one score hosted on Flat. + ### Example @@ -292,7 +301,54 @@ Name | Type | Description | Notes Create a new score -Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import an existing MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`), Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar, or MuseScore file to create the new Flat document. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. +Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: + +* `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. +* `ScoreCreationFileImport`: Import a file to create the new Flat document. + + **Preferred formats**: + * **MusicXML**: `.xml`, `.musicxml`, `.mxl` (compressed) — MIME: `vnd.recordare.musicxml+xml`, `vnd.recordare.musicxml`. This is the only format that preserves all notation data (articulations, dynamics, layout, etc.) with full round-trip support. + * **MIDI**: `.mid`, `.midi` — MIME: `audio/midi`. Only preserves pitch, timing, and instrument data; notation details are lost. + + **Also supported** (converted to MusicXML on import, some notation details may be lost): + * **Guitar Pro**: `.gp`, `.gp3`, `.gp4`, `.gp5`, `.gpx`, `.gtp` + * **MuseScore**: `.mscz`, `.mscx` + * **Finale**: `.musx` + * **ABC notation**: `.abc` — MIME: `text/vnd.abc` + * **PowerTab**: `.ptb` + * **Capella**: `.cap`, `.capx` + * **MEI**: `.mei` + * **Overture**: `.ove` + * **TablEdit**: `.tef` + * **Band-in-a-Box**: `.mgu`, `.sgu` + * **Karaoke MIDI**: `.kar` + * **MuseData**: `.md` + * **Score Writer**: `.scw` + * **Bagpipe Music Writer**: `.bmw`, `.bww` + * **Encore**: `.enc` + + **Scanned music** (requires `supportsTasks`, runs our music recognition and spends + credits): + * **PDF**: `.pdf` + * **Images**: `.jpg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`, `.heic`, `.heif` + + The file is identified by its own content, so its extension and any declared type do + not have to match. **One file per request**: a multi-page PDF or a multi-frame TIFF is + fine, but several separate images of the same score (a page photographed at a time) + need `createOmrJob`, which takes many inputs in one job and bills them as a single + document. Its live limits are served by `getOmrCapabilities`. +* `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. + +This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). + +The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). + +If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). + +If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. + +You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. + ### Example @@ -359,9 +415,10 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Score created | - | +**200** | Score created | * x-flat-score-revision -
* x-flat-score-revision-date -
| +**202** | Score will be imported using an asynchronous task (the API client has set `supportsTasks` to true) | - | **400** | Bad score creation request | - | -**402** | Account overquota | - | +**402** | Account overquota or feature not included in plan | - | **0** | Error | - | [[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) @@ -371,7 +428,8 @@ Name | Type | Description | Notes Create a new revision -Update a score by uploading a new revision for this one. +Update a score by uploading a new revision for this one. + ### Example @@ -453,7 +511,12 @@ Name | Type | Description | Notes Delete a score -This method can be used by the owner/admin (`aclAdmin` rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. When called by a regular collaborator (`aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections). +This method can be used by anyone that has at least read access to the document: + +- When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. +- When called by a collaborator, the score will be unshared (i.e. removed from the account & own collections). +- When called by another user that has the score in its collections, the score will be removed from all the user collections. + ### Example @@ -526,7 +589,7 @@ void (empty response body) [[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) # **delete_score_comment** -> delete_score_comment(score, comment, sharing_key=sharing_key) +> delete_score_comment(score, comment, event_properties=event_properties, sharing_key=sharing_key) Delete a comment @@ -558,11 +621,12 @@ with flat_api.ApiClient(configuration) as api_client: api_instance = flat_api.ScoreApi(api_client) score = 'score_example' # str | Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). comment = 'comment_example' # str | Unique identifier of a sheet music comment + event_properties = '{\"context\":\"discover\",\"screenLevel0\":\"home\",\"screenRoute\":\"/discover\"}' # str | Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` (optional) sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) try: # Delete a comment - api_instance.delete_score_comment(score, comment, sharing_key=sharing_key) + api_instance.delete_score_comment(score, comment, event_properties=event_properties, sharing_key=sharing_key) except Exception as e: print("Exception when calling ScoreApi->delete_score_comment: %s\n" % e) ``` @@ -576,6 +640,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **score** | **str**| Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). | **comment** | **str**| Unique identifier of a sheet music comment | + **event_properties** | **str**| Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` | [optional] **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] ### Return type @@ -588,7 +653,7 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -682,7 +747,13 @@ void (empty response body) Edit a score's metadata -This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`). When editing the `title`, `subtitle`, `composer`, `lyricist`, `arranger` or `licenseText`, the metadatas will be instantly be updated, and a real-time action will be pushed to update the document lazily. This pending document modification will be automatically be saved as a new version by either a connected client or our internal versioning service. +This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional. + +To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`). + +When editing the `title`, `subtitle`, `composer`, `lyricist`, `arranger` or `licenseText`, the metadatas will be instantly be updated, and a real-time action will be pushed to update the document lazily. +This pending document modification will be automatically be saved as a new version by either a connected client or our internal versioning service. + ### Example @@ -764,7 +835,10 @@ Name | Type | Description | Notes Fork a score -This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to `private`. When using a [Flat for Education](https://flat.io/edu) account, the inline and contextualized comments will be accessible in the child document. +This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to `private`. + +When using a [Flat for Education](https://flat.io/edu) account, the inline and contextualized comments will be accessible in the child document. + ### Example @@ -848,7 +922,8 @@ Name | Type | Description | Notes List group's scores -Get the list of scores shared with a group. +Get the list of scores shared with a group. + ### Example @@ -917,6 +992,7 @@ Name | Type | Description | Notes | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | The group's scores | - | +**404** | Not Found - Group not found or user not member of group | - | **0** | Error | - | [[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) @@ -926,7 +1002,9 @@ Name | Type | Description | Notes Get a score's metadata -Get the details of a score identified by the `score` parameter in the URL. The currently authenticated user must have at least a read access to the document to use this API call. +Get the details of a score identified by the `score` parameter in the URL. +The currently authenticated user must have at least a read access to the document to use this API call. + ### Example @@ -1007,7 +1085,8 @@ Name | Type | Description | Notes Get a collaborator -Get the information about a collaborator (User or Group). +Get the information about a collaborator (User or Group). + ### Example @@ -1090,7 +1169,10 @@ Name | Type | Description | Notes List the collaborators -This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document. Collaborators can be a single user (the object `user` will be populated) or a group (the object `group` will be populated). +This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document. + +Collaborators can be a single user (the object `user` will be populated) or a group (the object `group` will be populated). + ### Example @@ -1167,7 +1249,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) # **get_score_comments** -> List[ScoreComment] get_score_comments(score, sharing_key=sharing_key, type=type, sort=sort, direction=direction) +> List[ScoreComment] get_score_comments(score, type=type, sort=sort, direction=direction, sharing_key=sharing_key) List comments @@ -1201,14 +1283,14 @@ with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.ScoreApi(api_client) score = 'score_example' # str | Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). - sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) type = 'type_example' # str | Filter the comments by type (optional) sort = 'sort_example' # str | Sort (optional) direction = 'direction_example' # str | Sort direction (optional) + sharing_key = 'sharing_key_example' # str | This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. (optional) try: # List comments - api_response = api_instance.get_score_comments(score, sharing_key=sharing_key, type=type, sort=sort, direction=direction) + api_response = api_instance.get_score_comments(score, type=type, sort=sort, direction=direction, sharing_key=sharing_key) print("The response of ScoreApi->get_score_comments:\n") pprint(api_response) except Exception as e: @@ -1223,10 +1305,10 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **score** | **str**| Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). | - **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] **type** | **str**| Filter the comments by type | [optional] **sort** | **str**| Sort | [optional] **direction** | **str**| Sort direction | [optional] + **sharing_key** | **str**| This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. | [optional] ### Return type @@ -1258,7 +1340,9 @@ Name | Type | Description | Notes Get a score revision -When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific revision metadata. +When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific +revision metadata. + ### Example @@ -1337,11 +1421,17 @@ 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) # **get_score_revision_data** -> bytearray get_score_revision_data(score, revision, format, sharing_key=sharing_key, parts=parts, default_track=default_track, url=url) +> bytes get_score_revision_data(score, revision, format, sharing_key=sharing_key, parts=parts, default_track=default_track, url=url) Get a score revision data -Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, MP3 `mp3`, WAV `wav`, MIDI `midi`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. +Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML +`mxl`/`xml`, ABC notation `abc`, MP3 `mp3`, WAV `wav`, MIDI `midi`, Flat `flat`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. + +ABC notation is a text format that cannot express everything a score +contains. Like MIDI, the export is lossy: notation ABC has no equivalent +for is approximated or dropped rather than failing the request. + ### Example @@ -1403,7 +1493,7 @@ Name | Type | Description | Notes ### Return type -**bytearray** +**bytes** ### Authorization @@ -1412,13 +1502,13 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, application/vnd.recordare.musicxml+xml, application/vnd.recordare.musicxml, audio/mp3, audio/wav, audio/midi, image/png + - **Accept**: application/json, application/vnd.recordare.musicxml+xml, application/vnd.recordare.musicxml, audio/mp3, audio/wav, audio/midi, image/png, application/octet-stream ### HTTP response details | Status code | Description | Response headers | |-------------|-------------|------------------| -**200** | Revision data | - | +**200** | Revision data | * x-flat-score-revision -
* x-flat-score-revision-date -
| **402** | Account overquota | - | **403** | Not granted to access to this score | - | **404** | Score or associated file not found | - | @@ -1431,7 +1521,10 @@ Name | Type | Description | Notes List the revisions -When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification. Depending the plan of the account, this list can be trunked to the few last revisions. +When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification. + +Depending the plan of the account, this list can be trunked to the few last revisions. + ### Example @@ -1512,7 +1605,8 @@ Name | Type | Description | Notes List submissions related to the score -This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. +This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + ### Example @@ -1746,11 +1840,14 @@ 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) # **get_user_scores** -> List[ScoreDetails] get_user_scores(user, parent=parent) +> List[ScoreDetails] get_user_scores(user, paginate=paginate, sort=sort, direction=direction, limit=limit, next=next, previous=previous) List user's scores -Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. +Get the list of public scores owned by a User. +If you want to access to private scores, please use the [Collections API](#tag/Collection). +For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + ### Example @@ -1780,11 +1877,16 @@ with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.ScoreApi(api_client) user = 'user_example' # str | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. - parent = 'parent_example' # str | Filter the score forked from the score id `parent` (optional) + paginate = False # bool | When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. (optional) (default to False) + sort = 'sort_example' # str | Sort (optional) + direction = 'direction_example' # str | Sort direction (optional) + limit = 25 # int | This is the maximum number of objects that may be returned (optional) (default to 25) + next = 'next_example' # str | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) + previous = 'previous_example' # str | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) try: # List user's scores - api_response = api_instance.get_user_scores(user, parent=parent) + api_response = api_instance.get_user_scores(user, paginate=paginate, sort=sort, direction=direction, limit=limit, next=next, previous=previous) print("The response of ScoreApi->get_user_scores:\n") pprint(api_response) except Exception as e: @@ -1799,7 +1901,12 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | **str**| Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. | - **parent** | **str**| Filter the score forked from the score id `parent` | [optional] + **paginate** | **bool**| When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. | [optional] [default to False] + **sort** | **str**| Sort | [optional] + **direction** | **str**| Sort direction | [optional] + **limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 25] + **next** | **str**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] + **previous** | **str**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] ### Return type @@ -1828,6 +1935,18 @@ Name | Type | Description | Notes List the audio or video tracks linked to a score +List all audio or video tracks linked to a score. + +**Access Control for Performance Submission Tracks:** + +Tracks with `purpose: 'performanceSubmission'` are filtered based on user role: + +* **Students**: Can only see their own performance submission tracks, plus all non-performance tracks +* **Teachers and score admins**: Can see all tracks from all students + +The `assignment` query parameter can be used to filter tracks for a specific assignment, but the access control rules above still apply. + + ### Example * OAuth Authentication (OAuth2): @@ -2064,7 +2183,10 @@ void (empty response body) Post a new comment -Post a document or a contextualized comment on a document. Please note that this method includes an anti-spam system for public scores. We don't guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a `403` HTTP error and hidden from other users when the `spam` property is `true`. +Post a document or a contextualized comment on a document. + +Please note that this method includes an anti-spam system for public scores. We don't guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a `403` HTTP error and hidden from other users when the `spam` property is `true`. + ### Example @@ -2144,11 +2266,12 @@ 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) # **remove_score_collaborator** -> remove_score_collaborator(score, collaborator) +> remove_score_collaborator(score, collaborator, event_properties=event_properties) Delete a collaborator -Remove the specified collaborator from the score +Remove the specified collaborator from the score + ### Example @@ -2178,10 +2301,11 @@ with flat_api.ApiClient(configuration) as api_client: api_instance = flat_api.ScoreApi(api_client) score = 'score_example' # str | Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). collaborator = 'collaborator_example' # str | Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** + event_properties = '{\"context\":\"discover\",\"screenLevel0\":\"home\",\"screenRoute\":\"/discover\"}' # str | Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` (optional) try: # Delete a collaborator - api_instance.remove_score_collaborator(score, collaborator) + api_instance.remove_score_collaborator(score, collaborator, event_properties=event_properties) except Exception as e: print("Exception when calling ScoreApi->remove_score_collaborator: %s\n" % e) ``` @@ -2195,6 +2319,7 @@ Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **score** | **str**| Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). | **collaborator** | **str**| Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** | + **event_properties** | **str**| Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` | [optional] ### Return type @@ -2206,7 +2331,7 @@ void (empty response body) ### HTTP request headers - - **Content-Type**: Not defined + - **Content-Type**: application/x-www-form-urlencoded - **Accept**: application/json ### HTTP response details @@ -2225,7 +2350,8 @@ void (empty response body) Untrash a score -This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections. +This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections. + ### Example diff --git a/docs/ScoreComment.md b/docs/reference/ScoreComment.md similarity index 81% rename from docs/ScoreComment.md rename to docs/reference/ScoreComment.md index eeb7d29..a9be2e4 100644 --- a/docs/ScoreComment.md +++ b/docs/reference/ScoreComment.md @@ -6,16 +6,16 @@ Comment added on a sheet music Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | The comment unique identifier | [optional] -**type** | **str** | The type of the comment | [optional] -**user** | **str** | The author unique identifier | [optional] -**score** | **str** | The unique identifier of the score where the comment was posted | [optional] +**id** | **str** | The comment unique identifier | +**type** | **str** | The type of the comment | +**user** | **str** | The author unique identifier | +**score** | **str** | The unique identifier of the score where the comment was posted | **revision** | **str** | The unique identifier of revision the comment was posted | [optional] **reply_to** | **str** | When the comment is a reply to another comment, the unique identifier of the parent comment | [optional] -**var_date** | **datetime** | The date when the comment was posted | [optional] +**var_date** | **datetime** | The date when the comment was posted | **modification_date** | **datetime** | The date of the last comment modification | [optional] -**comment** | **str** | The comment text that can includes mentions using the following format: `@[id:username]`. | [optional] -**raw_comment** | **str** | A raw version of the comment, that can be displayed without parsing the mentions. | [optional] +**comment** | **str** | The comment text that can includes mentions using the following format: `@[id:username]`. | +**raw_comment** | **str** | A raw version of the comment, that can be displayed without parsing the mentions. | **context** | [**ScoreCommentContext**](ScoreCommentContext.md) | | [optional] **mentions** | **List[str]** | The list of user identifier mentioned on the score | [optional] **resolved** | **bool** | For inline comments, the comment can be marked as resolved and will be hidden in the future responses | [optional] @@ -33,12 +33,12 @@ json = "{}" # create an instance of ScoreComment from a JSON string score_comment_instance = ScoreComment.from_json(json) # print the JSON string representation of the object -print ScoreComment.to_json() +print(ScoreComment.to_json()) # convert the object into a dict score_comment_dict = score_comment_instance.to_dict() # create an instance of ScoreComment from a dict -score_comment_form_dict = score_comment.from_dict(score_comment_dict) +score_comment_from_dict = ScoreComment.from_dict(score_comment_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/ScoreCommentContext.md b/docs/reference/ScoreCommentContext.md similarity index 91% rename from docs/ScoreCommentContext.md rename to docs/reference/ScoreCommentContext.md index db3aed3..843e4ef 100644 --- a/docs/ScoreCommentContext.md +++ b/docs/reference/ScoreCommentContext.md @@ -25,12 +25,12 @@ json = "{}" # create an instance of ScoreCommentContext from a JSON string score_comment_context_instance = ScoreCommentContext.from_json(json) # print the JSON string representation of the object -print ScoreCommentContext.to_json() +print(ScoreCommentContext.to_json()) # convert the object into a dict score_comment_context_dict = score_comment_context_instance.to_dict() # create an instance of ScoreCommentContext from a dict -score_comment_context_form_dict = score_comment_context.from_dict(score_comment_context_dict) +score_comment_context_from_dict = ScoreCommentContext.from_dict(score_comment_context_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/ScoreCommentCreation.md b/docs/reference/ScoreCommentCreation.md similarity index 79% rename from docs/ScoreCommentCreation.md rename to docs/reference/ScoreCommentCreation.md index f9133da..ae522f2 100644 --- a/docs/ScoreCommentCreation.md +++ b/docs/reference/ScoreCommentCreation.md @@ -6,7 +6,7 @@ Creation of a comment Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**revision** | **str** | The unique indentifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. | [optional] +**revision** | **str** | The unique identifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. | [optional] **comment** | **str** | The comment text that can includes mentions using the following format: `@[id:username]`. | **raw_comment** | **str** | A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set. | [optional] **mentions** | **List[str]** | The list of user identifiers mentioned in this comment | [optional] @@ -23,12 +23,12 @@ json = "{}" # create an instance of ScoreCommentCreation from a JSON string score_comment_creation_instance = ScoreCommentCreation.from_json(json) # print the JSON string representation of the object -print ScoreCommentCreation.to_json() +print(ScoreCommentCreation.to_json()) # convert the object into a dict score_comment_creation_dict = score_comment_creation_instance.to_dict() # create an instance of ScoreCommentCreation from a dict -score_comment_creation_form_dict = score_comment_creation.from_dict(score_comment_creation_dict) +score_comment_creation_from_dict = ScoreCommentCreation.from_dict(score_comment_creation_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/ScoreCommentModeration.md b/docs/reference/ScoreCommentModeration.md similarity index 88% rename from docs/ScoreCommentModeration.md rename to docs/reference/ScoreCommentModeration.md index 279922b..576be45 100644 --- a/docs/ScoreCommentModeration.md +++ b/docs/reference/ScoreCommentModeration.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of ScoreCommentModeration from a JSON string score_comment_moderation_instance = ScoreCommentModeration.from_json(json) # print the JSON string representation of the object -print ScoreCommentModeration.to_json() +print(ScoreCommentModeration.to_json()) # convert the object into a dict score_comment_moderation_dict = score_comment_moderation_instance.to_dict() # create an instance of ScoreCommentModeration from a dict -score_comment_moderation_form_dict = score_comment_moderation.from_dict(score_comment_moderation_dict) +score_comment_moderation_from_dict = ScoreCommentModeration.from_dict(score_comment_moderation_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/ScoreCommentUpdate.md b/docs/reference/ScoreCommentUpdate.md similarity index 76% rename from docs/ScoreCommentUpdate.md rename to docs/reference/ScoreCommentUpdate.md index 87f4673..40ec275 100644 --- a/docs/ScoreCommentUpdate.md +++ b/docs/reference/ScoreCommentUpdate.md @@ -6,7 +6,7 @@ Update of a comment Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**revision** | **str** | The unique indentifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. | [optional] +**revision** | **str** | The unique identifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. | [optional] **comment** | **str** | The comment text that can includes mentions using the following format: `@[id:username]`. | [optional] **raw_comment** | **str** | A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set. | [optional] **context** | [**ScoreCommentContext**](ScoreCommentContext.md) | | [optional] @@ -21,12 +21,12 @@ json = "{}" # create an instance of ScoreCommentUpdate from a JSON string score_comment_update_instance = ScoreCommentUpdate.from_json(json) # print the JSON string representation of the object -print ScoreCommentUpdate.to_json() +print(ScoreCommentUpdate.to_json()) # convert the object into a dict score_comment_update_dict = score_comment_update_instance.to_dict() # create an instance of ScoreCommentUpdate from a dict -score_comment_update_form_dict = score_comment_update.from_dict(score_comment_update_dict) +score_comment_update_from_dict = ScoreCommentUpdate.from_dict(score_comment_update_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/ScoreCommentsCounts.md b/docs/reference/ScoreCommentsCounts.md similarity index 75% rename from docs/ScoreCommentsCounts.md rename to docs/reference/ScoreCommentsCounts.md index 6c8117f..66a055b 100644 --- a/docs/ScoreCommentsCounts.md +++ b/docs/reference/ScoreCommentsCounts.md @@ -1,6 +1,6 @@ # ScoreCommentsCounts -A computed version of the total, unique, weekly and monthly number of comments added on the documents (this doesn't include inline comments). +A computed version of the total, unique, weekly, monthly and yearly number of comments added on the documents (this doesn't include inline comments). ## Properties @@ -10,6 +10,7 @@ Name | Type | Description | Notes **unique** | **float** | The unique (1/user) number of comments added to the score | [optional] **weekly** | **float** | The weekly unique number of comments added to the score | [optional] **monthly** | **float** | The monthly unique number of comments added to the score | [optional] +**yearly** | **float** | The yearly unique number of comments added to the score | [optional] ## Example @@ -21,12 +22,12 @@ json = "{}" # create an instance of ScoreCommentsCounts from a JSON string score_comments_counts_instance = ScoreCommentsCounts.from_json(json) # print the JSON string representation of the object -print ScoreCommentsCounts.to_json() +print(ScoreCommentsCounts.to_json()) # convert the object into a dict score_comments_counts_dict = score_comments_counts_instance.to_dict() # create an instance of ScoreCommentsCounts from a dict -score_comments_counts_form_dict = score_comments_counts.from_dict(score_comments_counts_dict) +score_comments_counts_from_dict = ScoreCommentsCounts.from_dict(score_comments_counts_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/ScoreCreation.md b/docs/reference/ScoreCreation.md similarity index 64% rename from docs/ScoreCreation.md rename to docs/reference/ScoreCreation.md index 1760f2c..66c52d0 100644 --- a/docs/ScoreCreation.md +++ b/docs/reference/ScoreCreation.md @@ -6,14 +6,15 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") | [optional] -**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] -**collection** | **str** | Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will be stored in the `root` directory. | [optional] +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] [default to ScorePrivacy.PRIVATE] +**collection** | **str** | Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. | [optional] **google_drive_folder** | **str** | If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. | [optional] -**builder_data** | [**ScoreCreationBuilderData**](ScoreCreationBuilderData.md) | | [optional] +**builder_data** | [**ScoreCreationBuilderDataAllOfBuilderData**](ScoreCreationBuilderDataAllOfBuilderData.md) | | **filename** | **str** | If this is an imported file, its filename | [optional] -**data** | **str** | The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file. Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. | [optional] +**data** | **str** | The data of the score file. See the `POST /scores` endpoint description for the full list of supported formats. Binary payloads (e.g. compressed MusicXML, MIDI, Guitar Pro) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. | **data_encoding** | **str** | The optional encoding of the score data. This property must match the encoding used for the `data` property. | [optional] -**source** | [**ScoreSource**](ScoreSource.md) | | [optional] +**supports_tasks** | **bool** | Set this to `true` if the client supports asynchronous task flows. When importing a score that requires OMR processing (a PDF or a page image), the API will return a 202 Accepted response along with a task reference. The client can then check the task status using the endpoint `GET /v2/tasks/{task}`. | [optional] +**source** | [**ScoreSource**](ScoreSource.md) | | ## Example @@ -25,12 +26,12 @@ json = "{}" # create an instance of ScoreCreation from a JSON string score_creation_instance = ScoreCreation.from_json(json) # print the JSON string representation of the object -print ScoreCreation.to_json() +print(ScoreCreation.to_json()) # convert the object into a dict score_creation_dict = score_creation_instance.to_dict() # create an instance of ScoreCreation from a dict -score_creation_form_dict = score_creation.from_dict(score_creation_dict) +score_creation_from_dict = ScoreCreation.from_dict(score_creation_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/reference/ScoreCreationBuilderData.md b/docs/reference/ScoreCreationBuilderData.md new file mode 100644 index 0000000..b511cc8 --- /dev/null +++ b/docs/reference/ScoreCreationBuilderData.md @@ -0,0 +1,33 @@ +# ScoreCreationBuilderData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") | [optional] +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] [default to ScorePrivacy.PRIVATE] +**collection** | **str** | Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. | [optional] +**google_drive_folder** | **str** | If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. | [optional] +**builder_data** | [**ScoreCreationBuilderDataAllOfBuilderData**](ScoreCreationBuilderDataAllOfBuilderData.md) | | + +## Example + +```python +from flat_api.models.score_creation_builder_data import ScoreCreationBuilderData + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreCreationBuilderData from a JSON string +score_creation_builder_data_instance = ScoreCreationBuilderData.from_json(json) +# print the JSON string representation of the object +print(ScoreCreationBuilderData.to_json()) + +# convert the object into a dict +score_creation_builder_data_dict = score_creation_builder_data_instance.to_dict() +# create an instance of ScoreCreationBuilderData from a dict +score_creation_builder_data_from_dict = ScoreCreationBuilderData.from_dict(score_creation_builder_data_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/reference/ScoreCreationBuilderDataAllOfBuilderData.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderData.md new file mode 100644 index 0000000..1cb972f --- /dev/null +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderData.md @@ -0,0 +1,30 @@ +# ScoreCreationBuilderDataAllOfBuilderData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**score_data** | [**ScoreCreationBuilderDataAllOfBuilderDataScoreData**](ScoreCreationBuilderDataAllOfBuilderDataScoreData.md) | | +**layout_data** | [**ScoreCreationBuilderDataAllOfBuilderDataLayoutData**](ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md) | | [optional] + +## Example + +```python +from flat_api.models.score_creation_builder_data_all_of_builder_data import ScoreCreationBuilderDataAllOfBuilderData + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreCreationBuilderDataAllOfBuilderData from a JSON string +score_creation_builder_data_all_of_builder_data_instance = ScoreCreationBuilderDataAllOfBuilderData.from_json(json) +# print the JSON string representation of the object +print(ScoreCreationBuilderDataAllOfBuilderData.to_json()) + +# convert the object into a dict +score_creation_builder_data_all_of_builder_data_dict = score_creation_builder_data_all_of_builder_data_instance.to_dict() +# create an instance of ScoreCreationBuilderDataAllOfBuilderData from a dict +score_creation_builder_data_all_of_builder_data_from_dict = ScoreCreationBuilderDataAllOfBuilderData.from_dict(score_creation_builder_data_all_of_builder_data_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/ScoreCreationBuilderDataLayoutData.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md similarity index 60% rename from docs/ScoreCreationBuilderDataLayoutData.md rename to docs/reference/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md index a67db30..3f575bb 100644 --- a/docs/ScoreCreationBuilderDataLayoutData.md +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataLayoutData.md @@ -1,4 +1,4 @@ -# ScoreCreationBuilderDataLayoutData +# ScoreCreationBuilderDataAllOfBuilderDataLayoutData Control the appearance of the score. If missing, default values are used. @@ -18,19 +18,19 @@ Name | Type | Description | Notes ## Example ```python -from flat_api.models.score_creation_builder_data_layout_data import ScoreCreationBuilderDataLayoutData +from flat_api.models.score_creation_builder_data_all_of_builder_data_layout_data import ScoreCreationBuilderDataAllOfBuilderDataLayoutData # TODO update the JSON string below json = "{}" -# create an instance of ScoreCreationBuilderDataLayoutData from a JSON string -score_creation_builder_data_layout_data_instance = ScoreCreationBuilderDataLayoutData.from_json(json) +# create an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData from a JSON string +score_creation_builder_data_all_of_builder_data_layout_data_instance = ScoreCreationBuilderDataAllOfBuilderDataLayoutData.from_json(json) # print the JSON string representation of the object -print ScoreCreationBuilderDataLayoutData.to_json() +print(ScoreCreationBuilderDataAllOfBuilderDataLayoutData.to_json()) # convert the object into a dict -score_creation_builder_data_layout_data_dict = score_creation_builder_data_layout_data_instance.to_dict() -# create an instance of ScoreCreationBuilderDataLayoutData from a dict -score_creation_builder_data_layout_data_form_dict = score_creation_builder_data_layout_data.from_dict(score_creation_builder_data_layout_data_dict) +score_creation_builder_data_all_of_builder_data_layout_data_dict = score_creation_builder_data_all_of_builder_data_layout_data_instance.to_dict() +# create an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData from a dict +score_creation_builder_data_all_of_builder_data_layout_data_from_dict = ScoreCreationBuilderDataAllOfBuilderDataLayoutData.from_dict(score_creation_builder_data_all_of_builder_data_layout_data_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/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md new file mode 100644 index 0000000..0860166 --- /dev/null +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreData.md @@ -0,0 +1,34 @@ +# ScoreCreationBuilderDataAllOfBuilderDataScoreData + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**use_tab_staff** | **bool** | true if the TAB staff is displayed with fretted instruments | [optional] +**use_chord_grid** | **bool** | true if the chord grid must be displayed with fretted instruments | [optional] +**fifths** | **float** | The key signature of the score (expressed between -7 and 7). Major C is used when the value is not provided. | [optional] +**nb_beats** | **float** | The number of beats in the measure | [optional] +**beat_type** | **float** | The duration of a beat in the measure | [optional] +**instruments** | [**List[ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments]**](ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md) | The list of instruments to add to the score. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments) for the possible values for `group` and `instrument` (also available as the [`@flat/instruments`](https://www.npmjs.com/package/@flat/instruments) package). | + +## Example + +```python +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data import ScoreCreationBuilderDataAllOfBuilderDataScoreData + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData from a JSON string +score_creation_builder_data_all_of_builder_data_score_data_instance = ScoreCreationBuilderDataAllOfBuilderDataScoreData.from_json(json) +# print the JSON string representation of the object +print(ScoreCreationBuilderDataAllOfBuilderDataScoreData.to_json()) + +# convert the object into a dict +score_creation_builder_data_all_of_builder_data_score_data_dict = score_creation_builder_data_all_of_builder_data_score_data_instance.to_dict() +# create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData from a dict +score_creation_builder_data_all_of_builder_data_score_data_from_dict = ScoreCreationBuilderDataAllOfBuilderDataScoreData.from_dict(score_creation_builder_data_all_of_builder_data_score_data_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/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md new file mode 100644 index 0000000..bf09535 --- /dev/null +++ b/docs/reference/ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.md @@ -0,0 +1,33 @@ +# ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**group** | **str** | The of the instrument group (e.g. `keyboards`, `brass`) | +**instrument** | **str** | The identifier of the instrument (e.g. `piano`, `trumpet`) | +**long_name** | **str** | The full name of the instrument | [optional] +**short_name** | **str** | The abbreviation of the name of the instrument | [optional] +**has_quarter_tone** | **bool** | True if the part can use quarter tone (prevent the part to have a TAB/chord grid) | [optional] + +## Example + +```python +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data_instruments import ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments from a JSON string +score_creation_builder_data_all_of_builder_data_score_data_instruments_instance = ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.from_json(json) +# print the JSON string representation of the object +print(ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.to_json()) + +# convert the object into a dict +score_creation_builder_data_all_of_builder_data_score_data_instruments_dict = score_creation_builder_data_all_of_builder_data_score_data_instruments_instance.to_dict() +# create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments from a dict +score_creation_builder_data_all_of_builder_data_score_data_instruments_from_dict = ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.from_dict(score_creation_builder_data_all_of_builder_data_score_data_instruments_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/reference/ScoreCreationCommon.md b/docs/reference/ScoreCreationCommon.md new file mode 100644 index 0000000..ecd02d3 --- /dev/null +++ b/docs/reference/ScoreCreationCommon.md @@ -0,0 +1,32 @@ +# ScoreCreationCommon + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") | [optional] +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] [default to ScorePrivacy.PRIVATE] +**collection** | **str** | Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. | [optional] +**google_drive_folder** | **str** | If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. | [optional] + +## Example + +```python +from flat_api.models.score_creation_common import ScoreCreationCommon + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreCreationCommon from a JSON string +score_creation_common_instance = ScoreCreationCommon.from_json(json) +# print the JSON string representation of the object +print(ScoreCreationCommon.to_json()) + +# convert the object into a dict +score_creation_common_dict = score_creation_common_instance.to_dict() +# create an instance of ScoreCreationCommon from a dict +score_creation_common_from_dict = ScoreCreationCommon.from_dict(score_creation_common_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/reference/ScoreCreationFileImport.md b/docs/reference/ScoreCreationFileImport.md new file mode 100644 index 0000000..8356711 --- /dev/null +++ b/docs/reference/ScoreCreationFileImport.md @@ -0,0 +1,36 @@ +# ScoreCreationFileImport + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") | [optional] +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] [default to ScorePrivacy.PRIVATE] +**collection** | **str** | Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. | [optional] +**google_drive_folder** | **str** | If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. | [optional] +**filename** | **str** | If this is an imported file, its filename | [optional] +**data** | **str** | The data of the score file. See the `POST /scores` endpoint description for the full list of supported formats. Binary payloads (e.g. compressed MusicXML, MIDI, Guitar Pro) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. | +**data_encoding** | **str** | The optional encoding of the score data. This property must match the encoding used for the `data` property. | [optional] +**supports_tasks** | **bool** | Set this to `true` if the client supports asynchronous task flows. When importing a score that requires OMR processing (a PDF or a page image), the API will return a 202 Accepted response along with a task reference. The client can then check the task status using the endpoint `GET /v2/tasks/{task}`. | [optional] + +## Example + +```python +from flat_api.models.score_creation_file_import import ScoreCreationFileImport + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreCreationFileImport from a JSON string +score_creation_file_import_instance = ScoreCreationFileImport.from_json(json) +# print the JSON string representation of the object +print(ScoreCreationFileImport.to_json()) + +# convert the object into a dict +score_creation_file_import_dict = score_creation_file_import_instance.to_dict() +# create an instance of ScoreCreationFileImport from a dict +score_creation_file_import_from_dict = ScoreCreationFileImport.from_dict(score_creation_file_import_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/reference/ScoreCreationGoogleDriveImport.md b/docs/reference/ScoreCreationGoogleDriveImport.md new file mode 100644 index 0000000..8fbd201 --- /dev/null +++ b/docs/reference/ScoreCreationGoogleDriveImport.md @@ -0,0 +1,33 @@ +# ScoreCreationGoogleDriveImport + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**title** | **str** | The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") | [optional] +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] [default to ScorePrivacy.PRIVATE] +**collection** | **str** | Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. | [optional] +**google_drive_folder** | **str** | If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. | [optional] +**source** | [**ScoreSource**](ScoreSource.md) | | + +## Example + +```python +from flat_api.models.score_creation_google_drive_import import ScoreCreationGoogleDriveImport + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreCreationGoogleDriveImport from a JSON string +score_creation_google_drive_import_instance = ScoreCreationGoogleDriveImport.from_json(json) +# print the JSON string representation of the object +print(ScoreCreationGoogleDriveImport.to_json()) + +# convert the object into a dict +score_creation_google_drive_import_dict = score_creation_google_drive_import_instance.to_dict() +# create an instance of ScoreCreationGoogleDriveImport from a dict +score_creation_google_drive_import_from_dict = ScoreCreationGoogleDriveImport.from_dict(score_creation_google_drive_import_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/ScoreCreationType.md b/docs/reference/ScoreCreationType.md similarity index 67% rename from docs/ScoreCreationType.md rename to docs/reference/ScoreCreationType.md index 62ce471..976af5a 100644 --- a/docs/ScoreCreationType.md +++ b/docs/reference/ScoreCreationType.md @@ -2,10 +2,13 @@ The type of creation (an orginal, an arrangement) -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `ORIGINAL` (value: `'original'`) + +* `ARRANGEMENT` (value: `'arrangement'`) + +* `OTHER` (value: `'other'`) [[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/ScoreDetails.md b/docs/reference/ScoreDetails.md similarity index 76% rename from docs/ScoreDetails.md rename to docs/reference/ScoreDetails.md index dc11ce5..609c7c0 100644 --- a/docs/ScoreDetails.md +++ b/docs/reference/ScoreDetails.md @@ -1,5 +1,6 @@ # ScoreDetails +The score and all its details ## Properties @@ -8,9 +9,10 @@ Name | Type | Description | Notes **id** | **str** | The unique identifier of the score | **sharing_key** | **str** | The private sharing key of the score (available when the `privacy` mode is set to `privateLink`) | [optional] **title** | **str** | The title of the score | -**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [default to ScorePrivacy.PRIVATE] **user** | [**UserPublic**](UserPublic.md) | | **html_url** | **str** | The url where the score can be viewed in a web browser | +**edit_html_url** | **str** | The url where the score can be edited in a web browser | **subtitle** | **str** | Subtitle of the score | [optional] **lyricist** | **str** | Lyricist of the score | [optional] **arranger** | **str** | Arranger of the score | [optional] @@ -25,21 +27,24 @@ Name | Type | Description | Notes **main_tempo_qpm** | **float** | The main tempo of the score (in QPM) | [optional] **main_key_signature** | **float** | The main key signature of the score (expressed between -7 and 7). | [optional] **rights** | [**ResourceRights**](ResourceRights.md) | | [optional] -**collaborators** | [**List[ResourceCollaborator]**](ResourceCollaborator.md) | The list of the collaborators of the score | [optional] -**creation_date** | **datetime** | The date when the score was created | [optional] +**collaborators** | [**List[ResourceCollaborator]**](ResourceCollaborator.md) | The list of the collaborators of the score | +**creation_date** | **datetime** | The date when the score was created | **modification_date** | **datetime** | The date of the last revision of the score | [optional] **publication_date** | **datetime** | The date when the score was published on Flat | [optional] +**scheduled_deletion_date** | **datetime** | The date when the score will be definitively deleted. This date can be in the past if the score will be deleted at the next deletion batch, in this case you can display something like \"Deleted shortly\". Schedule: * For all paying users, the scores will be definitively deleted after 90 days. * For free users, the scores are no longer available after 24 hours, an can be restored with a paying account up to 90 days. | [optional] **highlighted_date** | **datetime** | The date when the score was highlighted (featured) on our community | [optional] **organization** | **str** | If the score has been created in an organization, the identifier of this organization. This property is especially used with the score privacy `organizationPublic`. | [optional] **parent_score** | **str** | If the score has been forked, the unique identifier of the parent score. | [optional] -**instruments** | **List[str]** | An array of the instrument identifiers used in the last version of the score. This is mainly used to display a list of the instruments in the Flat's UI or instruments icons. The format of the strings is `{instrument-group}.{instrument-id}`. | [optional] -**samples** | **List[str]** | An array of the audio samples identifiers used the different score parts. The format of the strings is `{instrument-group}.{sample-id}`. | [optional] +**instruments** | **List[str]** | An array of the instrument identifiers used in the last version of the score. This is mainly used to display a list of the instruments in the Flat's UI or instruments icons. The format of the strings is `{instrument-group}.{instrument-id}`. | +**instruments_names** | **List[str]** | An array of the instrument names used in the last version of the score. This list is localized and ready-to-display and will match the indexes from the `instruments` list. | +**samples** | **List[str]** | An array of the audio samples identifiers used the different score parts. The format of the strings is `{instrument-group}.{sample-id}`. | **google_drive_file_id** | **str** | If the user uses Google Drive and the score exists on Google Drive, this field will contain the unique identifier of the Flat score on Google Drive. You can access the document using the url: `https://drive.google.com/open?id={googleDriveFileId}` | [optional] **likes** | [**ScoreLikesCounts**](ScoreLikesCounts.md) | | [optional] **comments** | [**ScoreCommentsCounts**](ScoreCommentsCounts.md) | | [optional] **views** | [**ScoreViewsCounts**](ScoreViewsCounts.md) | | [optional] **plays** | [**ScorePlaysCounts**](ScorePlaysCounts.md) | | [optional] **collections** | **List[str]** | The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them. | [optional] +**me** | [**ScoreDetailsAllOfMe**](ScoreDetailsAllOfMe.md) | | [optional] ## Example @@ -51,12 +56,12 @@ json = "{}" # create an instance of ScoreDetails from a JSON string score_details_instance = ScoreDetails.from_json(json) # print the JSON string representation of the object -print ScoreDetails.to_json() +print(ScoreDetails.to_json()) # convert the object into a dict score_details_dict = score_details_instance.to_dict() # create an instance of ScoreDetails from a dict -score_details_form_dict = score_details.from_dict(score_details_dict) +score_details_from_dict = ScoreDetails.from_dict(score_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/reference/ScoreDetailsAllOfMe.md b/docs/reference/ScoreDetailsAllOfMe.md new file mode 100644 index 0000000..c117d10 --- /dev/null +++ b/docs/reference/ScoreDetailsAllOfMe.md @@ -0,0 +1,31 @@ +# ScoreDetailsAllOfMe + +Information about the authenticated user and this score + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**is_liked** | **bool** | True if the current user likes this score | +**is_in_library** | **bool** | True if the score is stored in one of the user's collections | + +## Example + +```python +from flat_api.models.score_details_all_of_me import ScoreDetailsAllOfMe + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreDetailsAllOfMe from a JSON string +score_details_all_of_me_instance = ScoreDetailsAllOfMe.from_json(json) +# print the JSON string representation of the object +print(ScoreDetailsAllOfMe.to_json()) + +# convert the object into a dict +score_details_all_of_me_dict = score_details_all_of_me_instance.to_dict() +# create an instance of ScoreDetailsAllOfMe from a dict +score_details_all_of_me_from_dict = ScoreDetailsAllOfMe.from_dict(score_details_all_of_me_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/ScoreFork.md b/docs/reference/ScoreFork.md similarity index 76% rename from docs/ScoreFork.md rename to docs/reference/ScoreFork.md index da7055f..05fa80e 100644 --- a/docs/ScoreFork.md +++ b/docs/reference/ScoreFork.md @@ -6,7 +6,7 @@ Options to fork the score Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**collection** | **str** | Unique identifier of a collection where the score will be copied. If no collection identifier is provided, the score will be stored in the `root` directory. If null is provided, the score won't be added to any collections | [optional] [default to 'root'] +**collection** | **str** | Unique identifier of a collection where the score will be copied. If no collection identifier is provided, a virtual collection is used, or `null` is provided, the score won't be added to any collection and will only be visible in the `allScores` virtual collection. | [optional] **google_drive_disabled** | **bool** | If set to `true`, the API won't create the score on Google Drive | [optional] [default to False] **keep_original_title** | **bool** | Option to keep the original title of the score (i.e. don't prepend it with \"Copy of \", or add the student name in assignment usage). | [optional] @@ -20,12 +20,12 @@ json = "{}" # create an instance of ScoreFork from a JSON string score_fork_instance = ScoreFork.from_json(json) # print the JSON string representation of the object -print ScoreFork.to_json() +print(ScoreFork.to_json()) # convert the object into a dict score_fork_dict = score_fork_instance.to_dict() # create an instance of ScoreFork from a dict -score_fork_form_dict = score_fork.from_dict(score_fork_dict) +score_fork_from_dict = ScoreFork.from_dict(score_fork_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/reference/ScoreLicense.md b/docs/reference/ScoreLicense.md new file mode 100644 index 0000000..c13bd48 --- /dev/null +++ b/docs/reference/ScoreLicense.md @@ -0,0 +1,25 @@ +# ScoreLicense + +License of the creation. Read more about the Creative Commons licenses on https://creativecommons.org/licenses/ + +## Enum + +* `COPYRIGHT` (value: `'copyright'`) + +* `CC0` (value: `'cc0'`) + +* `CC_MINUS_BY` (value: `'cc-by'`) + +* `CC_MINUS_BY_MINUS_SA` (value: `'cc-by-sa'`) + +* `CC_MINUS_BY_MINUS_ND` (value: `'cc-by-nd'`) + +* `CC_MINUS_BY_MINUS_NC` (value: `'cc-by-nc'`) + +* `CC_MINUS_BY_MINUS_NC_MINUS_SA` (value: `'cc-by-nc-sa'`) + +* `CC_MINUS_BY_MINUS_NC_MINUS_ND` (value: `'cc-by-nc-nd'`) + +[[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/ScoreLikesCounts.md b/docs/reference/ScoreLikesCounts.md similarity index 73% rename from docs/ScoreLikesCounts.md rename to docs/reference/ScoreLikesCounts.md index 40aad8e..c017f28 100644 --- a/docs/ScoreLikesCounts.md +++ b/docs/reference/ScoreLikesCounts.md @@ -1,14 +1,15 @@ # ScoreLikesCounts -A computed version of the weekly, monthly and total of number of likes for a score +A computed version of the weekly, monthly, yearly and total number of likes for a score ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**total** | **float** | The total number of likes of the score | [default to 0] -**weekly** | **float** | The number of new likes during the last week | [default to 0] -**monthly** | **float** | The number of new likes during the last month | [default to 0] +**total** | **float** | The total number of likes of the score | [optional] +**weekly** | **float** | The number of new likes during the last week | [optional] +**monthly** | **float** | The number of new likes during the last month | [optional] +**yearly** | **float** | The number of new likes during the last year | [optional] ## Example @@ -20,12 +21,12 @@ json = "{}" # create an instance of ScoreLikesCounts from a JSON string score_likes_counts_instance = ScoreLikesCounts.from_json(json) # print the JSON string representation of the object -print ScoreLikesCounts.to_json() +print(ScoreLikesCounts.to_json()) # convert the object into a dict score_likes_counts_dict = score_likes_counts_instance.to_dict() # create an instance of ScoreLikesCounts from a dict -score_likes_counts_form_dict = score_likes_counts.from_dict(score_likes_counts_dict) +score_likes_counts_from_dict = ScoreLikesCounts.from_dict(score_likes_counts_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/ScoreModification.md b/docs/reference/ScoreModification.md similarity index 91% rename from docs/ScoreModification.md rename to docs/reference/ScoreModification.md index ec46914..8ec3448 100644 --- a/docs/ScoreModification.md +++ b/docs/reference/ScoreModification.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **composer** | **str** | The composer of the score | [optional] **lyricist** | **str** | The lyricist of the score | [optional] **arranger** | **str** | The arranger of the score | [optional] -**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [optional] [default to ScorePrivacy.PRIVATE] **sharing_key** | **str** | When using the `privacy` mode `privateLink`, this property can be used to set a custom sharing key, otherwise a new key will be generated. | [optional] **description** | **str** | Description of the creation | [optional] **tags** | **List[str]** | Tags describing the score | [optional] @@ -29,12 +29,12 @@ json = "{}" # create an instance of ScoreModification from a JSON string score_modification_instance = ScoreModification.from_json(json) # print the JSON string representation of the object -print ScoreModification.to_json() +print(ScoreModification.to_json()) # convert the object into a dict score_modification_dict = score_modification_instance.to_dict() # create an instance of ScoreModification from a dict -score_modification_form_dict = score_modification.from_dict(score_modification_dict) +score_modification_from_dict = ScoreModification.from_dict(score_modification_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/ScorePlaysCounts.md b/docs/reference/ScorePlaysCounts.md similarity index 77% rename from docs/ScorePlaysCounts.md rename to docs/reference/ScorePlaysCounts.md index f05b4a8..1b064fa 100644 --- a/docs/ScorePlaysCounts.md +++ b/docs/reference/ScorePlaysCounts.md @@ -1,6 +1,6 @@ # ScorePlaysCounts -A computed version of the total, weekly, and monthly number of plays of the score +A computed version of the total, weekly, monthly, and yearly number of plays of the score ## Properties @@ -9,6 +9,7 @@ Name | Type | Description | Notes **total** | **float** | The total number of plays of the score | [optional] **weekly** | **float** | The weekly number of plays of the score | [optional] **monthly** | **float** | The monthly number of plays of the score | [optional] +**yearly** | **float** | The yearly number of plays of the score | [optional] ## Example @@ -20,12 +21,12 @@ json = "{}" # create an instance of ScorePlaysCounts from a JSON string score_plays_counts_instance = ScorePlaysCounts.from_json(json) # print the JSON string representation of the object -print ScorePlaysCounts.to_json() +print(ScorePlaysCounts.to_json()) # convert the object into a dict score_plays_counts_dict = score_plays_counts_instance.to_dict() # create an instance of ScorePlaysCounts from a dict -score_plays_counts_form_dict = score_plays_counts.from_dict(score_plays_counts_dict) +score_plays_counts_from_dict = ScorePlaysCounts.from_dict(score_plays_counts_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/ScorePrivacy.md b/docs/reference/ScorePrivacy.md similarity index 89% rename from docs/ScorePrivacy.md rename to docs/reference/ScorePrivacy.md index 7eed374..6fc865e 100644 --- a/docs/ScorePrivacy.md +++ b/docs/reference/ScorePrivacy.md @@ -2,10 +2,15 @@ The score main privacy mode. - `public`: The score is public on the Internet. This one can be accessible at the url `https://flat.io/score/{score}` and can be modified and administred by specified collaborators users. - `private`: The score is private and can be only accessed, modified and administred by specified collaborators users. - `privateLink`: The score is private but can be accessed using a private link `htmlUrl` or the private key in the property `sharingKey`. - `organizationPublic`: _Available only with [Flat for Education](https://flat.io/edu)._ The score is public in the organization: users of the same organization can access to this one. The score can be modified and administred by specified collaborators users. The score can also be individually shared to a set of users or groups using the different collaborators API methods. When a file is synchronized from an external source (e.g. Google Drive) and the sharing options are changed on the source, Flat will chose the best privacy mode for the file. When using a [Flat for Education](https://flat.io/edu) account, some of the modes may not be available if disabled by an administrator of the organization (e.g. by default the `public` mode is not available). -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `PUBLIC` (value: `'public'`) + +* `PRIVATE` (value: `'private'`) + +* `ORGANIZATIONPUBLIC` (value: `'organizationPublic'`) + +* `PRIVATELINK` (value: `'privateLink'`) [[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/ScoreRevision.md b/docs/reference/ScoreRevision.md similarity index 81% rename from docs/ScoreRevision.md rename to docs/reference/ScoreRevision.md index faa9878..dc513b2 100644 --- a/docs/ScoreRevision.md +++ b/docs/reference/ScoreRevision.md @@ -6,10 +6,11 @@ A score revision metadata Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**id** | **str** | The unique identifier of the revision. | [optional] +**id** | **str** | The unique identifier of the revision. | **user** | **str** | The user identifier who created the revision | [optional] +**score** | **str** | The score identifier | **collaborators** | **List[str]** | | [optional] -**creation_date** | **datetime** | The date when this revision was created | [optional] +**var_date** | **datetime** | The date when this revision was created | **event** | **str** | The last event (action id) of the revision | [optional] **description** | **str** | A description associated to the revision | [optional] **autosave** | **bool** | True if this revision was automatically generated by Flat and not on purpose by the user. | [optional] @@ -25,12 +26,12 @@ json = "{}" # create an instance of ScoreRevision from a JSON string score_revision_instance = ScoreRevision.from_json(json) # print the JSON string representation of the object -print ScoreRevision.to_json() +print(ScoreRevision.to_json()) # convert the object into a dict score_revision_dict = score_revision_instance.to_dict() # create an instance of ScoreRevision from a dict -score_revision_form_dict = score_revision.from_dict(score_revision_dict) +score_revision_from_dict = ScoreRevision.from_dict(score_revision_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/ScoreRevisionCreation.md b/docs/reference/ScoreRevisionCreation.md similarity index 92% rename from docs/ScoreRevisionCreation.md rename to docs/reference/ScoreRevisionCreation.md index 05b9b6e..7fd51c4 100644 --- a/docs/ScoreRevisionCreation.md +++ b/docs/reference/ScoreRevisionCreation.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of ScoreRevisionCreation from a JSON string score_revision_creation_instance = ScoreRevisionCreation.from_json(json) # print the JSON string representation of the object -print ScoreRevisionCreation.to_json() +print(ScoreRevisionCreation.to_json()) # convert the object into a dict score_revision_creation_dict = score_revision_creation_instance.to_dict() # create an instance of ScoreRevisionCreation from a dict -score_revision_creation_form_dict = score_revision_creation.from_dict(score_revision_creation_dict) +score_revision_creation_from_dict = ScoreRevisionCreation.from_dict(score_revision_creation_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/ScoreRevisionStatistics.md b/docs/reference/ScoreRevisionStatistics.md similarity index 89% rename from docs/ScoreRevisionStatistics.md rename to docs/reference/ScoreRevisionStatistics.md index aec7fc7..fb3c122 100644 --- a/docs/ScoreRevisionStatistics.md +++ b/docs/reference/ScoreRevisionStatistics.md @@ -21,12 +21,12 @@ json = "{}" # create an instance of ScoreRevisionStatistics from a JSON string score_revision_statistics_instance = ScoreRevisionStatistics.from_json(json) # print the JSON string representation of the object -print ScoreRevisionStatistics.to_json() +print(ScoreRevisionStatistics.to_json()) # convert the object into a dict score_revision_statistics_dict = score_revision_statistics_instance.to_dict() # create an instance of ScoreRevisionStatistics from a dict -score_revision_statistics_form_dict = score_revision_statistics.from_dict(score_revision_statistics_dict) +score_revision_statistics_from_dict = ScoreRevisionStatistics.from_dict(score_revision_statistics_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/ScoreSource.md b/docs/reference/ScoreSource.md similarity index 90% rename from docs/ScoreSource.md rename to docs/reference/ScoreSource.md index 794a423..473a5f6 100644 --- a/docs/ScoreSource.md +++ b/docs/reference/ScoreSource.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of ScoreSource from a JSON string score_source_instance = ScoreSource.from_json(json) # print the JSON string representation of the object -print ScoreSource.to_json() +print(ScoreSource.to_json()) # convert the object into a dict score_source_dict = score_source_instance.to_dict() # create an instance of ScoreSource from a dict -score_source_form_dict = score_source.from_dict(score_source_dict) +score_source_from_dict = ScoreSource.from_dict(score_source_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/reference/ScoreSummary.md b/docs/reference/ScoreSummary.md new file mode 100644 index 0000000..b10aa84 --- /dev/null +++ b/docs/reference/ScoreSummary.md @@ -0,0 +1,35 @@ +# ScoreSummary + +A summary of the score details + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The unique identifier of the score | +**sharing_key** | **str** | The private sharing key of the score (available when the `privacy` mode is set to `privateLink`) | [optional] +**title** | **str** | The title of the score | +**privacy** | [**ScorePrivacy**](ScorePrivacy.md) | | [default to ScorePrivacy.PRIVATE] +**user** | [**UserPublic**](UserPublic.md) | | +**html_url** | **str** | The url where the score can be viewed in a web browser | + +## Example + +```python +from flat_api.models.score_summary import ScoreSummary + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreSummary from a JSON string +score_summary_instance = ScoreSummary.from_json(json) +# print the JSON string representation of the object +print(ScoreSummary.to_json()) + +# convert the object into a dict +score_summary_dict = score_summary_instance.to_dict() +# create an instance of ScoreSummary from a dict +score_summary_from_dict = ScoreSummary.from_dict(score_summary_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/ScoreTrack.md b/docs/reference/ScoreTrack.md similarity index 81% rename from docs/ScoreTrack.md rename to docs/reference/ScoreTrack.md index 7113f3e..53ad324 100644 --- a/docs/ScoreTrack.md +++ b/docs/reference/ScoreTrack.md @@ -8,14 +8,14 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The unique identifier of the score track | **title** | **str** | Title of the track | [optional] -**score** | **str** | The unique identifier of the score | +**score** | **str** | The unique identifier of the score. Absent for Free Record performance submissions, which are recorded without an attached score. | [optional] **creator** | **str** | The unique identifier of the track creator | **creation_date** | **datetime** | The creation date of the track | **modification_date** | **datetime** | The modification date of the track | **default** | **bool** | True if the track should be used as default audio source | -**state** | [**ScoreTrackState**](ScoreTrackState.md) | | +**state** | [**ScoreTrackState**](ScoreTrackState.md) | | [default to ScoreTrackState.DRAFT] **type** | [**ScoreTrackType**](ScoreTrackType.md) | | -**purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | +**purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | [default to ScoreTrackPurpose.COMMON] **url** | **str** | The URL of the track | [optional] **media_id** | **str** | The unique identifier of the track when hosted on an external service. For example, if the url is `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, `mediaId` will be `dQw4w9WgXcQ` | [optional] **synchronization_points** | [**List[ScoreTrackPoint]**](ScoreTrackPoint.md) | | [optional] @@ -30,12 +30,12 @@ json = "{}" # create an instance of ScoreTrack from a JSON string score_track_instance = ScoreTrack.from_json(json) # print the JSON string representation of the object -print ScoreTrack.to_json() +print(ScoreTrack.to_json()) # convert the object into a dict score_track_dict = score_track_instance.to_dict() # create an instance of ScoreTrack from a dict -score_track_form_dict = score_track.from_dict(score_track_dict) +score_track_from_dict = ScoreTrack.from_dict(score_track_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/ScoreTrackCreation.md b/docs/reference/ScoreTrackCreation.md similarity index 85% rename from docs/ScoreTrackCreation.md rename to docs/reference/ScoreTrackCreation.md index f07feb4..f49123d 100644 --- a/docs/ScoreTrackCreation.md +++ b/docs/reference/ScoreTrackCreation.md @@ -8,8 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | Title of the track | [optional] **default** | **bool** | True if the track should be used as default audio source | [optional] -**state** | [**ScoreTrackState**](ScoreTrackState.md) | | [optional] -**purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | [optional] +**state** | [**ScoreTrackState**](ScoreTrackState.md) | | [optional] [default to ScoreTrackState.DRAFT] +**purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | [optional] [default to ScoreTrackPurpose.COMMON] **url** | **str** | The URL of the track | [optional] **synchronization_points** | [**List[ScoreTrackPoint]**](ScoreTrackPoint.md) | | [optional] @@ -23,12 +23,12 @@ json = "{}" # create an instance of ScoreTrackCreation from a JSON string score_track_creation_instance = ScoreTrackCreation.from_json(json) # print the JSON string representation of the object -print ScoreTrackCreation.to_json() +print(ScoreTrackCreation.to_json()) # convert the object into a dict score_track_creation_dict = score_track_creation_instance.to_dict() # create an instance of ScoreTrackCreation from a dict -score_track_creation_form_dict = score_track_creation.from_dict(score_track_creation_dict) +score_track_creation_from_dict = ScoreTrackCreation.from_dict(score_track_creation_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/reference/ScoreTrackCreationResponse.md b/docs/reference/ScoreTrackCreationResponse.md new file mode 100644 index 0000000..216af53 --- /dev/null +++ b/docs/reference/ScoreTrackCreationResponse.md @@ -0,0 +1,30 @@ +# ScoreTrackCreationResponse + +Response for track creation including optional upload information + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**track** | [**ScoreTrack**](ScoreTrack.md) | | + +## Example + +```python +from flat_api.models.score_track_creation_response import ScoreTrackCreationResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of ScoreTrackCreationResponse from a JSON string +score_track_creation_response_instance = ScoreTrackCreationResponse.from_json(json) +# print the JSON string representation of the object +print(ScoreTrackCreationResponse.to_json()) + +# convert the object into a dict +score_track_creation_response_dict = score_track_creation_response_instance.to_dict() +# create an instance of ScoreTrackCreationResponse from a dict +score_track_creation_response_from_dict = ScoreTrackCreationResponse.from_dict(score_track_creation_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/ScoreTrackPoint.md b/docs/reference/ScoreTrackPoint.md similarity index 84% rename from docs/ScoreTrackPoint.md rename to docs/reference/ScoreTrackPoint.md index b817616..68cea4f 100644 --- a/docs/ScoreTrackPoint.md +++ b/docs/reference/ScoreTrackPoint.md @@ -7,7 +7,7 @@ A track synchronization point Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **type** | **str** | The type of the synchronization point. If the type is `measure`, the measure uuid must be present in `measureUuid` | -**measure_uuid** | **str** | The measure unique identifier | [optional] +**measure_uuid** | **UUID** | The measure unique identifier | [optional] **time** | **float** | The corresponding time in seconds | ## Example @@ -20,12 +20,12 @@ json = "{}" # create an instance of ScoreTrackPoint from a JSON string score_track_point_instance = ScoreTrackPoint.from_json(json) # print the JSON string representation of the object -print ScoreTrackPoint.to_json() +print(ScoreTrackPoint.to_json()) # convert the object into a dict score_track_point_dict = score_track_point_instance.to_dict() # create an instance of ScoreTrackPoint from a dict -score_track_point_form_dict = score_track_point.from_dict(score_track_point_dict) +score_track_point_from_dict = ScoreTrackPoint.from_dict(score_track_point_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/ScoreTrackPurpose.md b/docs/reference/ScoreTrackPurpose.md similarity index 66% rename from docs/ScoreTrackPurpose.md rename to docs/reference/ScoreTrackPurpose.md index f7747e0..4032fba 100644 --- a/docs/ScoreTrackPurpose.md +++ b/docs/reference/ScoreTrackPurpose.md @@ -2,10 +2,11 @@ The purpose of the audio track -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `COMMON` (value: `'common'`) + +* `PERFORMANCESUBMISSION` (value: `'performanceSubmission'`) [[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/ScoreTrackState.md b/docs/reference/ScoreTrackState.md similarity index 65% rename from docs/ScoreTrackState.md rename to docs/reference/ScoreTrackState.md index 8aa8259..ec09aa3 100644 --- a/docs/ScoreTrackState.md +++ b/docs/reference/ScoreTrackState.md @@ -2,10 +2,13 @@ State of the track -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `DRAFT` (value: `'draft'`) + +* `COMPLETED` (value: `'completed'`) + +* `DELETED` (value: `'deleted'`) [[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/ScoreTrackType.md b/docs/reference/ScoreTrackType.md similarity index 60% rename from docs/ScoreTrackType.md rename to docs/reference/ScoreTrackType.md index a975b2c..30363bd 100644 --- a/docs/ScoreTrackType.md +++ b/docs/reference/ScoreTrackType.md @@ -2,10 +2,15 @@ The type of an audio track -## Properties +## Enum -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +* `AUDIO` (value: `'audio'`) + +* `SOUNDCLOUD` (value: `'soundcloud'`) + +* `YOUTUBE` (value: `'youtube'`) + +* `VIMEO` (value: `'vimeo'`) [[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/ScoreTrackUpdate.md b/docs/reference/ScoreTrackUpdate.md similarity index 80% rename from docs/ScoreTrackUpdate.md rename to docs/reference/ScoreTrackUpdate.md index d734275..56e4db1 100644 --- a/docs/ScoreTrackUpdate.md +++ b/docs/reference/ScoreTrackUpdate.md @@ -8,7 +8,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **title** | **str** | Title of the track | [optional] **default** | **bool** | True if the track should be used as default audio source | [optional] -**state** | [**ScoreTrackState**](ScoreTrackState.md) | | [optional] +**state** | [**ScoreTrackState**](ScoreTrackState.md) | | [optional] [default to ScoreTrackState.DRAFT] +**purpose** | [**ScoreTrackPurpose**](ScoreTrackPurpose.md) | | [optional] [default to ScoreTrackPurpose.COMMON] **synchronization_points** | [**List[ScoreTrackPoint]**](ScoreTrackPoint.md) | | [optional] ## Example @@ -21,12 +22,12 @@ json = "{}" # create an instance of ScoreTrackUpdate from a JSON string score_track_update_instance = ScoreTrackUpdate.from_json(json) # print the JSON string representation of the object -print ScoreTrackUpdate.to_json() +print(ScoreTrackUpdate.to_json()) # convert the object into a dict score_track_update_dict = score_track_update_instance.to_dict() # create an instance of ScoreTrackUpdate from a dict -score_track_update_form_dict = score_track_update.from_dict(score_track_update_dict) +score_track_update_from_dict = ScoreTrackUpdate.from_dict(score_track_update_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/ScoreViewsCounts.md b/docs/reference/ScoreViewsCounts.md similarity index 77% rename from docs/ScoreViewsCounts.md rename to docs/reference/ScoreViewsCounts.md index 5988f15..269f207 100644 --- a/docs/ScoreViewsCounts.md +++ b/docs/reference/ScoreViewsCounts.md @@ -1,6 +1,6 @@ # ScoreViewsCounts -A computed version of the total, weekly, and monthly number of views of the score +A computed version of the total, weekly, monthly, and yearly number of views of the score ## Properties @@ -9,6 +9,7 @@ Name | Type | Description | Notes **total** | **float** | The total number of views of the score | [optional] **weekly** | **float** | The weekly number of views of the score | [optional] **monthly** | **float** | The monthly number of views of the score | [optional] +**yearly** | **float** | The yearly number of views of the score | [optional] ## Example @@ -20,12 +21,12 @@ json = "{}" # create an instance of ScoreViewsCounts from a JSON string score_views_counts_instance = ScoreViewsCounts.from_json(json) # print the JSON string representation of the object -print ScoreViewsCounts.to_json() +print(ScoreViewsCounts.to_json()) # convert the object into a dict score_views_counts_dict = score_views_counts_instance.to_dict() # create an instance of ScoreViewsCounts from a dict -score_views_counts_form_dict = score_views_counts.from_dict(score_views_counts_dict) +score_views_counts_from_dict = ScoreViewsCounts.from_dict(score_views_counts_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/Task.md b/docs/reference/Task.md similarity index 65% rename from docs/Task.md rename to docs/reference/Task.md index c156d1c..3da49d4 100644 --- a/docs/Task.md +++ b/docs/reference/Task.md @@ -7,16 +7,19 @@ An asynchronous task Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Unique identifier of the task | -**type** | **str** | Type of the task (e.g. audio-export) | [optional] +**type** | **str** | Type of the task: * `audio-export`: Exports a score to audio format (MP3, WAV) * `score-save`: Saves or updates a score document * `import-omr`: Processes a PDF through OMR (Optical Music Recognition) and imports it as a score | [optional] **state** | **str** | State of the Task | **format** | **str** | For files processing, the file format (e.g. `mp3`, `wav`) | [optional] **score** | **str** | The score unique identifier for tasks related to scores | [optional] +**revision** | **str** | The score revision identifier for tasks related to scores | [optional] **progress** | [**TaskProgress**](TaskProgress.md) | | [optional] **creation_date** | **datetime** | The creation date of the task | [optional] **modification_date** | **datetime** | The last modification date of the task | [optional] **done_date** | **datetime** | The date when the task has been completed | [optional] **result** | [**TaskResult**](TaskResult.md) | | [optional] **error_history** | **List[str]** | If any errors happened when processing this task, the list of errors identifiers | [optional] +**is_cancellable** | **bool** | Whether the task can be canceled by the user. Only `true` when the task is in `created` state (waiting to be processed). | [optional] [readonly] +**children** | [**List[Task]**](Task.md) | Child tasks for hierarchical task structures (e.g., conversion subtasks) | [optional] ## Example @@ -28,12 +31,12 @@ json = "{}" # create an instance of Task from a JSON string task_instance = Task.from_json(json) # print the JSON string representation of the object -print Task.to_json() +print(Task.to_json()) # convert the object into a dict task_dict = task_instance.to_dict() # create an instance of Task from a dict -task_form_dict = task.from_dict(task_dict) +task_from_dict = Task.from_dict(task_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/TaskApi.md b/docs/reference/TaskApi.md similarity index 98% rename from docs/TaskApi.md rename to docs/reference/TaskApi.md index 29bdcf5..859c91f 100644 --- a/docs/TaskApi.md +++ b/docs/reference/TaskApi.md @@ -12,7 +12,8 @@ Method | HTTP request | Description Get a task details -This method can be used to follow a task progression, for example while a score is being exported. +This method can be used to follow a task progression, for example while a score is being exported. + ### Example diff --git a/docs/TaskExportOptions.md b/docs/reference/TaskExportOptions.md similarity index 87% rename from docs/TaskExportOptions.md rename to docs/reference/TaskExportOptions.md index 1c60b2f..863b4a3 100644 --- a/docs/TaskExportOptions.md +++ b/docs/reference/TaskExportOptions.md @@ -18,12 +18,12 @@ json = "{}" # create an instance of TaskExportOptions from a JSON string task_export_options_instance = TaskExportOptions.from_json(json) # print the JSON string representation of the object -print TaskExportOptions.to_json() +print(TaskExportOptions.to_json()) # convert the object into a dict task_export_options_dict = task_export_options_instance.to_dict() # create an instance of TaskExportOptions from a dict -task_export_options_form_dict = task_export_options.from_dict(task_export_options_dict) +task_export_options_from_dict = TaskExportOptions.from_dict(task_export_options_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/TaskProgress.md b/docs/reference/TaskProgress.md similarity index 90% rename from docs/TaskProgress.md rename to docs/reference/TaskProgress.md index 2846d7e..903b81d 100644 --- a/docs/TaskProgress.md +++ b/docs/reference/TaskProgress.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of TaskProgress from a JSON string task_progress_instance = TaskProgress.from_json(json) # print the JSON string representation of the object -print TaskProgress.to_json() +print(TaskProgress.to_json()) # convert the object into a dict task_progress_dict = task_progress_instance.to_dict() # create an instance of TaskProgress from a dict -task_progress_form_dict = task_progress.from_dict(task_progress_dict) +task_progress_from_dict = TaskProgress.from_dict(task_progress_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/TaskResult.md b/docs/reference/TaskResult.md similarity index 90% rename from docs/TaskResult.md rename to docs/reference/TaskResult.md index bc2cebd..c2639ad 100644 --- a/docs/TaskResult.md +++ b/docs/reference/TaskResult.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of TaskResult from a JSON string task_result_instance = TaskResult.from_json(json) # print the JSON string representation of the object -print TaskResult.to_json() +print(TaskResult.to_json()) # convert the object into a dict task_result_dict = task_result_instance.to_dict() # create an instance of TaskResult from a dict -task_result_form_dict = task_result.from_dict(task_result_dict) +task_result_from_dict = TaskResult.from_dict(task_result_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/reference/TeachingTheme.md b/docs/reference/TeachingTheme.md new file mode 100644 index 0000000..4a05a01 --- /dev/null +++ b/docs/reference/TeachingTheme.md @@ -0,0 +1,27 @@ +# TeachingTheme + +Teaching theme + +## Enum + +* `COMPOSITION` (value: `'composition'`) + +* `MUSIC_MINUS_THEORY` (value: `'music-theory'`) + +* `GENERAL_MINUS_MUSIC` (value: `'general-music'`) + +* `BAND` (value: `'band'`) + +* `CHOIR` (value: `'choir'`) + +* `ORCHESTRA` (value: `'orchestra'`) + +* `JAZZ_MINUS_ENSEMBLE` (value: `'jazz-ensemble'`) + +* `MUSIC_MINUS_TECHNOLOGY` (value: `'music-technology'`) + +* `OTHER` (value: `'other'`) + +[[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/reference/TutteoProduct.md b/docs/reference/TutteoProduct.md new file mode 100644 index 0000000..7b4538a --- /dev/null +++ b/docs/reference/TutteoProduct.md @@ -0,0 +1,17 @@ +# TutteoProduct + +A Tutteo product. * `flat`: [Flat](https://flat.io) - Music notation software for individual users * `flatEdu`: [Flat for Education](https://flat.io/edu) - Music notation software for schools and educators * `msnippet`: [Music Snippet](https://musicsnippet.com) - Embeddable music snippets for websites * `embed`: [Flat Embed](https://flat.io/developers/embed) - Embeddable music notation editor + +## Enum + +* `FLAT` (value: `'flat'`) + +* `FLATEDU` (value: `'flatEdu'`) + +* `MSNIPPET` (value: `'msnippet'`) + +* `EMBED` (value: `'embed'`) + +[[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/UserAdminUpdate.md b/docs/reference/UserAdminUpdate.md similarity index 91% rename from docs/UserAdminUpdate.md rename to docs/reference/UserAdminUpdate.md index c754b5b..cfcddd8 100644 --- a/docs/UserAdminUpdate.md +++ b/docs/reference/UserAdminUpdate.md @@ -23,12 +23,12 @@ json = "{}" # create an instance of UserAdminUpdate from a JSON string user_admin_update_instance = UserAdminUpdate.from_json(json) # print the JSON string representation of the object -print UserAdminUpdate.to_json() +print(UserAdminUpdate.to_json()) # convert the object into a dict user_admin_update_dict = user_admin_update_instance.to_dict() # create an instance of UserAdminUpdate from a dict -user_admin_update_form_dict = user_admin_update.from_dict(user_admin_update_dict) +user_admin_update_from_dict = UserAdminUpdate.from_dict(user_admin_update_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/UserApi.md b/docs/reference/UserApi.md similarity index 76% rename from docs/UserApi.md rename to docs/reference/UserApi.md index b0897be..035aa91 100644 --- a/docs/UserApi.md +++ b/docs/reference/UserApi.md @@ -14,7 +14,8 @@ Method | HTTP request | Description Get a public user profile -Get a profile of a Flat or Flat for Education User. +Get a profile of a Flat or Flat for Education User. + ### Example @@ -168,11 +169,14 @@ 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) # **get_user_scores** -> List[ScoreDetails] get_user_scores(user, parent=parent) +> List[ScoreDetails] get_user_scores(user, paginate=paginate, sort=sort, direction=direction, limit=limit, next=next, previous=previous) List user's scores -Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. +Get the list of public scores owned by a User. +If you want to access to private scores, please use the [Collections API](#tag/Collection). +For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + ### Example @@ -202,11 +206,16 @@ with flat_api.ApiClient(configuration) as api_client: # Create an instance of the API class api_instance = flat_api.UserApi(api_client) user = 'user_example' # str | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. - parent = 'parent_example' # str | Filter the score forked from the score id `parent` (optional) + paginate = False # bool | When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. (optional) (default to False) + sort = 'sort_example' # str | Sort (optional) + direction = 'direction_example' # str | Sort direction (optional) + limit = 25 # int | This is the maximum number of objects that may be returned (optional) (default to 25) + next = 'next_example' # str | An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) + previous = 'previous_example' # str | An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. (optional) try: # List user's scores - api_response = api_instance.get_user_scores(user, parent=parent) + api_response = api_instance.get_user_scores(user, paginate=paginate, sort=sort, direction=direction, limit=limit, next=next, previous=previous) print("The response of UserApi->get_user_scores:\n") pprint(api_response) except Exception as e: @@ -221,7 +230,12 @@ with flat_api.ApiClient(configuration) as api_client: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user** | **str**| Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. | - **parent** | **str**| Filter the score forked from the score id `parent` | [optional] + **paginate** | **bool**| When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. | [optional] [default to False] + **sort** | **str**| Sort | [optional] + **direction** | **str**| Sort direction | [optional] + **limit** | **int**| This is the maximum number of objects that may be returned | [optional] [default to 25] + **next** | **str**| An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] + **previous** | **str**| An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. | [optional] ### Return type diff --git a/docs/UserAzureDetails.md b/docs/reference/UserAzureDetails.md similarity index 89% rename from docs/UserAzureDetails.md rename to docs/reference/UserAzureDetails.md index d3dc906..5ddd467 100644 --- a/docs/UserAzureDetails.md +++ b/docs/reference/UserAzureDetails.md @@ -19,12 +19,12 @@ json = "{}" # create an instance of UserAzureDetails from a JSON string user_azure_details_instance = UserAzureDetails.from_json(json) # print the JSON string representation of the object -print UserAzureDetails.to_json() +print(UserAzureDetails.to_json()) # convert the object into a dict user_azure_details_dict = user_azure_details_instance.to_dict() # create an instance of UserAzureDetails from a dict -user_azure_details_form_dict = user_azure_details.from_dict(user_azure_details_dict) +user_azure_details_from_dict = UserAzureDetails.from_dict(user_azure_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/reference/UserBasics.md b/docs/reference/UserBasics.md new file mode 100644 index 0000000..5cbbf03 --- /dev/null +++ b/docs/reference/UserBasics.md @@ -0,0 +1,38 @@ +# UserBasics + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | The user unique identifier | +**type** | **str** | The type of user account | +**product** | [**TutteoProduct**](TutteoProduct.md) | | [default to TutteoProduct.FLAT] +**username** | **str** | The user name (unique for the organization) | +**printable_name** | **str** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] +**firstname** | **str** | Firstname of the user (for education users) | [optional] +**lastname** | **str** | Lastname of the user (for education users) | [optional] +**name** | **str** | A displayable name for the user (for consumer users) | [optional] +**picture** | **str** | The URL of the picture to display | +**badges** | **List[str]** | List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` | [optional] + +## Example + +```python +from flat_api.models.user_basics import UserBasics + +# TODO update the JSON string below +json = "{}" +# create an instance of UserBasics from a JSON string +user_basics_instance = UserBasics.from_json(json) +# print the JSON string representation of the object +print(UserBasics.to_json()) + +# convert the object into a dict +user_basics_dict = user_basics_instance.to_dict() +# create an instance of UserBasics from a dict +user_basics_from_dict = UserBasics.from_dict(user_basics_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/UserCommunityProfileLinks.md b/docs/reference/UserCommunityProfileLinks.md similarity index 89% rename from docs/UserCommunityProfileLinks.md rename to docs/reference/UserCommunityProfileLinks.md index 52f79a8..c176122 100644 --- a/docs/UserCommunityProfileLinks.md +++ b/docs/reference/UserCommunityProfileLinks.md @@ -23,12 +23,12 @@ json = "{}" # create an instance of UserCommunityProfileLinks from a JSON string user_community_profile_links_instance = UserCommunityProfileLinks.from_json(json) # print the JSON string representation of the object -print UserCommunityProfileLinks.to_json() +print(UserCommunityProfileLinks.to_json()) # convert the object into a dict user_community_profile_links_dict = user_community_profile_links_instance.to_dict() # create an instance of UserCommunityProfileLinks from a dict -user_community_profile_links_form_dict = user_community_profile_links.from_dict(user_community_profile_links_dict) +user_community_profile_links_from_dict = UserCommunityProfileLinks.from_dict(user_community_profile_links_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/UserCreation.md b/docs/reference/UserCreation.md similarity index 82% rename from docs/UserCreation.md rename to docs/reference/UserCreation.md index 62a38b8..1e60190 100644 --- a/docs/UserCreation.md +++ b/docs/reference/UserCreation.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **lastname** | **str** | Last name of the user | [optional] **email** | **str** | Email of the new account | [optional] **password** | **str** | Password of the new account | -**locale** | [**FlatLocales**](FlatLocales.md) | | [optional] +**locale** | **str** | User language. Input values will be automatically normalized to a supported locale code. | [optional] [default to 'en'] **role** | **str** | Role of the new account | [optional] [default to 'user'] ## Example @@ -24,12 +24,12 @@ json = "{}" # create an instance of UserCreation from a JSON string user_creation_instance = UserCreation.from_json(json) # print the JSON string representation of the object -print UserCreation.to_json() +print(UserCreation.to_json()) # convert the object into a dict user_creation_dict = user_creation_instance.to_dict() # create an instance of UserCreation from a dict -user_creation_form_dict = user_creation.from_dict(user_creation_dict) +user_creation_from_dict = UserCreation.from_dict(user_creation_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/UserDetails.md b/docs/reference/UserDetails.md similarity index 70% rename from docs/UserDetails.md rename to docs/reference/UserDetails.md index 393c52e..61a18cd 100644 --- a/docs/UserDetails.md +++ b/docs/reference/UserDetails.md @@ -1,5 +1,6 @@ # UserDetails +User details ## Properties @@ -7,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The user unique identifier | **type** | **str** | The type of user account | -**product** | [**TutteoProduct**](TutteoProduct.md) | | +**product** | [**TutteoProduct**](TutteoProduct.md) | | [default to TutteoProduct.FLAT] **username** | **str** | The user name (unique for the organization) | **printable_name** | **str** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] **firstname** | **str** | Firstname of the user (for education users) | [optional] @@ -25,13 +26,16 @@ Name | Type | Description | Notes **followers_count** | **int** | Number of followers the user have | [optional] **following_count** | **int** | Number of people the user follow | [optional] **owned_public_scores_count** | **int** | Number of public scores the user have | [optional] +**all_public_scores_count** | **int** | Total number of public scores the user participates in (owned + joined) | [optional] +**likes_count** | **int** | Number of likes on the user published scores | [optional] +**plays_count** | **int** | Number of plays on the user published scores | [optional] **cover_picture** | **str** | Cover picture (backgroud) for the profile | [optional] **profile_theme** | **str** | Theme (background) for the profile | [optional] -**instruments** | **List[str]** | An array of the instrument identifiers. The format of the strings is `{instrument-group}.{instrument-id}`. | [optional] **links** | [**UserCommunityProfileLinks**](UserCommunityProfileLinks.md) | | [optional] +**is_email_verified** | **bool** | Whether the user's email address has been verified | [optional] **azure_details** | [**UserAzureDetails**](UserAzureDetails.md) | | [optional] **private_profile** | **bool** | Tell either this user profile is private or not (individual accounts only) | [optional] -**locale** | [**FlatLocales**](FlatLocales.md) | | [optional] +**locale** | **str** | The user language. Input values will be automatically normalized to a supported locale code. Unknown locales will default to `en`. Current supported locales include: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ja-HIRA`, `ko`, `ms`, `nb`, `nl`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW` | [optional] [default to 'en'] **groups** | **List[str]** | For Flat for Education accounts, list of Group identifiers the user is part of. | [optional] **picture_file** | **str** | The ID of the user profile picture | [optional] **cover_picture_file** | **str** | The ID of the user profile cover picture | [optional] @@ -46,12 +50,12 @@ json = "{}" # create an instance of UserDetails from a JSON string user_details_instance = UserDetails.from_json(json) # print the JSON string representation of the object -print UserDetails.to_json() +print(UserDetails.to_json()) # convert the object into a dict user_details_dict = user_details_instance.to_dict() # create an instance of UserDetails from a dict -user_details_form_dict = user_details.from_dict(user_details_dict) +user_details_from_dict = UserDetails.from_dict(user_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/UserDetailsAdmin.md b/docs/reference/UserDetailsAdmin.md similarity index 76% rename from docs/UserDetailsAdmin.md rename to docs/reference/UserDetailsAdmin.md index 7939a9d..4d0a98f 100644 --- a/docs/UserDetailsAdmin.md +++ b/docs/reference/UserDetailsAdmin.md @@ -1,5 +1,6 @@ # UserDetailsAdmin +User details (view for organization teacher / admin) ## Properties @@ -7,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The user unique identifier | **type** | **str** | The type of user account | -**product** | [**TutteoProduct**](TutteoProduct.md) | | +**product** | [**TutteoProduct**](TutteoProduct.md) | | [default to TutteoProduct.FLAT] **username** | **str** | The user name (unique for the organization) | **printable_name** | **str** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] **firstname** | **str** | Firstname of the user (for education users) | [optional] @@ -21,8 +22,9 @@ Name | Type | Description | Notes **html_url** | **str** | Link to user profile (for Indiv. users only) | [optional] **email** | **str** | Email of the user | [optional] **last_activity_date** | **datetime** | Date of the last user activity | [optional] -**license** | [**UserDetailsAdminLicense**](UserDetailsAdminLicense.md) | | [optional] +**license** | [**UserDetailsAdminAllOfLicense**](UserDetailsAdminAllOfLicense.md) | | [optional] **groups** | **List[str]** | For Flat for Education accounts, list of Group identifiers the user is part of. | [optional] +**is_edu_testing_student** | **bool** | Indicates if the user account is marked as a testing student account. Testing students are typically excluded from certain educational integrations and workflows. This field helps API clients distinguish between regular students and testing accounts. | [optional] ## Example @@ -34,12 +36,12 @@ json = "{}" # create an instance of UserDetailsAdmin from a JSON string user_details_admin_instance = UserDetailsAdmin.from_json(json) # print the JSON string representation of the object -print UserDetailsAdmin.to_json() +print(UserDetailsAdmin.to_json()) # convert the object into a dict user_details_admin_dict = user_details_admin_instance.to_dict() # create an instance of UserDetailsAdmin from a dict -user_details_admin_form_dict = user_details_admin.from_dict(user_details_admin_dict) +user_details_admin_from_dict = UserDetailsAdmin.from_dict(user_details_admin_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/UserDetailsAdminLicense.md b/docs/reference/UserDetailsAdminAllOfLicense.md similarity index 55% rename from docs/UserDetailsAdminLicense.md rename to docs/reference/UserDetailsAdminAllOfLicense.md index 7c08b34..9f172e0 100644 --- a/docs/UserDetailsAdminLicense.md +++ b/docs/reference/UserDetailsAdminAllOfLicense.md @@ -1,4 +1,4 @@ -# UserDetailsAdminLicense +# UserDetailsAdminAllOfLicense Current active license of the user @@ -8,26 +8,26 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | ID of the current license | [optional] **expiration_date** | **datetime** | Date when the license expires | [optional] -**source** | [**LicenseSources**](LicenseSources.md) | | [optional] +**source** | [**LicenseSources**](LicenseSources.md) | | [optional] [default to LicenseSources.ORDER] **mode** | [**LicenseMode**](LicenseMode.md) | | [optional] **active** | **bool** | ID of the current license | [optional] ## Example ```python -from flat_api.models.user_details_admin_license import UserDetailsAdminLicense +from flat_api.models.user_details_admin_all_of_license import UserDetailsAdminAllOfLicense # TODO update the JSON string below json = "{}" -# create an instance of UserDetailsAdminLicense from a JSON string -user_details_admin_license_instance = UserDetailsAdminLicense.from_json(json) +# create an instance of UserDetailsAdminAllOfLicense from a JSON string +user_details_admin_all_of_license_instance = UserDetailsAdminAllOfLicense.from_json(json) # print the JSON string representation of the object -print UserDetailsAdminLicense.to_json() +print(UserDetailsAdminAllOfLicense.to_json()) # convert the object into a dict -user_details_admin_license_dict = user_details_admin_license_instance.to_dict() -# create an instance of UserDetailsAdminLicense from a dict -user_details_admin_license_form_dict = user_details_admin_license.from_dict(user_details_admin_license_dict) +user_details_admin_all_of_license_dict = user_details_admin_all_of_license_instance.to_dict() +# create an instance of UserDetailsAdminAllOfLicense from a dict +user_details_admin_all_of_license_from_dict = UserDetailsAdminAllOfLicense.from_dict(user_details_admin_all_of_license_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/UserPublic.md b/docs/reference/UserPublic.md similarity index 83% rename from docs/UserPublic.md rename to docs/reference/UserPublic.md index 8a068e3..9d95c47 100644 --- a/docs/UserPublic.md +++ b/docs/reference/UserPublic.md @@ -1,5 +1,6 @@ # UserPublic +Public User details ## Properties @@ -7,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The user unique identifier | **type** | **str** | The type of user account | -**product** | [**TutteoProduct**](TutteoProduct.md) | | +**product** | [**TutteoProduct**](TutteoProduct.md) | | [default to TutteoProduct.FLAT] **username** | **str** | The user name (unique for the organization) | **printable_name** | **str** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] **firstname** | **str** | Firstname of the user (for education users) | [optional] @@ -25,9 +26,11 @@ Name | Type | Description | Notes **followers_count** | **int** | Number of followers the user have | [optional] **following_count** | **int** | Number of people the user follow | [optional] **owned_public_scores_count** | **int** | Number of public scores the user have | [optional] +**all_public_scores_count** | **int** | Total number of public scores the user participates in (owned + joined) | [optional] +**likes_count** | **int** | Number of likes on the user published scores | [optional] +**plays_count** | **int** | Number of plays on the user published scores | [optional] **cover_picture** | **str** | Cover picture (backgroud) for the profile | [optional] **profile_theme** | **str** | Theme (background) for the profile | [optional] -**instruments** | **List[str]** | An array of the instrument identifiers. The format of the strings is `{instrument-group}.{instrument-id}`. | [optional] **links** | [**UserCommunityProfileLinks**](UserCommunityProfileLinks.md) | | [optional] ## Example @@ -40,12 +43,12 @@ json = "{}" # create an instance of UserPublic from a JSON string user_public_instance = UserPublic.from_json(json) # print the JSON string representation of the object -print UserPublic.to_json() +print(UserPublic.to_json()) # convert the object into a dict user_public_dict = user_public_instance.to_dict() # create an instance of UserPublic from a dict -user_public_form_dict = user_public.from_dict(user_public_dict) +user_public_from_dict = UserPublic.from_dict(user_public_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/UserPublicSummary.md b/docs/reference/UserPublicSummary.md similarity index 88% rename from docs/UserPublicSummary.md rename to docs/reference/UserPublicSummary.md index 1e35c1b..720e7c8 100644 --- a/docs/UserPublicSummary.md +++ b/docs/reference/UserPublicSummary.md @@ -1,5 +1,6 @@ # UserPublicSummary +Public User details summary ## Properties @@ -7,7 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | The user unique identifier | **type** | **str** | The type of user account | -**product** | [**TutteoProduct**](TutteoProduct.md) | | +**product** | [**TutteoProduct**](TutteoProduct.md) | | [default to TutteoProduct.FLAT] **username** | **str** | The user name (unique for the organization) | **printable_name** | **str** | The name that can be directly printed (name, firstname & lastname, or username) | [optional] **firstname** | **str** | Firstname of the user (for education users) | [optional] @@ -30,12 +31,12 @@ json = "{}" # create an instance of UserPublicSummary from a JSON string user_public_summary_instance = UserPublicSummary.from_json(json) # print the JSON string representation of the object -print UserPublicSummary.to_json() +print(UserPublicSummary.to_json()) # convert the object into a dict user_public_summary_dict = user_public_summary_instance.to_dict() # create an instance of UserPublicSummary from a dict -user_public_summary_form_dict = user_public_summary.from_dict(user_public_summary_dict) +user_public_summary_from_dict = UserPublicSummary.from_dict(user_public_summary_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/UserSigninLink.md b/docs/reference/UserSigninLink.md similarity index 80% rename from docs/UserSigninLink.md rename to docs/reference/UserSigninLink.md index 0c10014..f888803 100644 --- a/docs/UserSigninLink.md +++ b/docs/reference/UserSigninLink.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **str** | URL to use to sign in to this account | [optional] +**token** | **str** | Raw sign-in token, can be used to build custom URLs (e.g. deep links) | [optional] **expiration_date** | **datetime** | Date when the link expires | [optional] ## Example @@ -18,12 +19,12 @@ json = "{}" # create an instance of UserSigninLink from a JSON string user_signin_link_instance = UserSigninLink.from_json(json) # print the JSON string representation of the object -print UserSigninLink.to_json() +print(UserSigninLink.to_json()) # convert the object into a dict user_signin_link_dict = user_signin_link_instance.to_dict() # create an instance of UserSigninLink from a dict -user_signin_link_form_dict = user_signin_link.from_dict(user_signin_link_dict) +user_signin_link_from_dict = UserSigninLink.from_dict(user_signin_link_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/UserSigninLinkCreation.md b/docs/reference/UserSigninLinkCreation.md similarity index 86% rename from docs/UserSigninLinkCreation.md rename to docs/reference/UserSigninLinkCreation.md index ca0ec5a..0a15746 100644 --- a/docs/UserSigninLinkCreation.md +++ b/docs/reference/UserSigninLinkCreation.md @@ -17,12 +17,12 @@ json = "{}" # create an instance of UserSigninLinkCreation from a JSON string user_signin_link_creation_instance = UserSigninLinkCreation.from_json(json) # print the JSON string representation of the object -print UserSigninLinkCreation.to_json() +print(UserSigninLinkCreation.to_json()) # convert the object into a dict user_signin_link_creation_dict = user_signin_link_creation_instance.to_dict() # create an instance of UserSigninLinkCreation from a dict -user_signin_link_creation_form_dict = user_signin_link_creation.from_dict(user_signin_link_creation_dict) +user_signin_link_creation_from_dict = UserSigninLinkCreation.from_dict(user_signin_link_creation_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/flat_api/__init__.py b/flat_api/__init__.py index 86aa239..f842e5a 100644 --- a/flat_api/__init__.py +++ b/flat_api/__init__.py @@ -1,3 +1,50 @@ +"""Flat API client. + + from flat_api import FlatClient + client = FlatClient(access_token="...") + +Async: + + from flat_api import AsyncFlatClient + client = AsyncFlatClient(access_token="...") +""" + +# --- flat_api ergonomic surface (tools/patches/90_exports.py) --- +__version__ = "2.0.0" + +from flat_api.client import AsyncFlatClient, FlatClient +from flat_api.errors import ( + FlatAuthenticationError, + FlatAuthorizationError, + FlatError, + FlatNotFoundError, + FlatQuotaError, + FlatRateLimitError, + FlatServerError, + FlatValidationError, +) +from flat_api.oauth import OAuth2Helper, Tokens +from flat_api.pagination import paginate +from flat_api._retry import RetryPolicy + +__all__ = [ + "AsyncFlatClient", + "FlatClient", + "FlatAuthenticationError", + "FlatAuthorizationError", + "FlatError", + "FlatNotFoundError", + "FlatQuotaError", + "FlatRateLimitError", + "FlatServerError", + "FlatValidationError", + "OAuth2Helper", + "RetryPolicy", + "Tokens", + "paginate", + "__version__", +] +# --- end --- # coding: utf-8 # flake8: noqa @@ -5,9 +52,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -15,160 +62,447 @@ """ # noqa: E501 -__version__ = "1.1.3" +__version__ = "2.0.0" + +# Define package exports +__all__ = [ + "AccountApi", + "ClassApi", + "CollectionApi", + "EduResourcesApi", + "GroupApi", + "OMRApi", + "OrganizationApi", + "ScoreApi", + "TaskApi", + "UserApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AddGroupUser200Response", + "AddGroupUserRequest", + "ApiAccessToken", + "AppScopes", + "Assignment", + "AssignmentCapabilities", + "AssignmentCapabilitiesCanPublishInClassError", + "AssignmentCopy", + "AssignmentCopyResponse", + "AssignmentCopyToClass", + "AssignmentCopyToResourceLibrary", + "AssignmentGroup", + "AssignmentSubmission", + "AssignmentSubmissionComment", + "AssignmentSubmissionCommentCreation", + "AssignmentSubmissionComments", + "AssignmentSubmissionHistory", + "AssignmentSubmissionHistoryAttachment", + "AssignmentSubmissionHistoryState", + "AssignmentSubmissionLti", + "AssignmentSubmissionPlayback", + "AssignmentSubmissionState", + "AssignmentSubmissionStudentsMode", + "AssignmentSubmissionUpdate", + "AssignmentType", + "AssignmentUpdate", + "ClassAssignment", + "ClassAssignmentAllOfCanvas", + "ClassAssignmentAllOfLti", + "ClassAssignmentAllOfMfc", + "ClassAssignmentUpdate", + "ClassAssignmentUpdateAllOfGoogleClassroom", + "ClassAssignmentUpdateAllOfMicrosoftGraph", + "ClassAttachmentCreation", + "ClassCreation", + "ClassDetails", + "ClassDetailsCanvas", + "ClassDetailsClever", + "ClassDetailsGoogleClassroom", + "ClassDetailsGoogleDrive", + "ClassDetailsIssues", + "ClassDetailsIssuesSyncInner", + "ClassDetailsLti", + "ClassDetailsMfc", + "ClassDetailsMicrosoftGraph", + "ClassGradeLevel", + "ClassRoles", + "ClassState", + "ClassUpdate", + "Collection", + "CollectionApp", + "CollectionCapabilities", + "CollectionContents", + "CollectionCreation", + "CollectionModification", + "CollectionPrivacy", + "CollectionType", + "CreateLtiConfiguration200Response", + "CreditTransaction", + "EduLibrary", + "EduResource", + "EduResourceAssignmentCreation", + "EduResourceCapabilities", + "EduResourceCopy", + "EduResourceCreation", + "EduResourceFolder", + "EduResourceLtiLink", + "EduResourceMove", + "EduResourcePrivacy", + "EduResourceResource", + "EduResourceType", + "EduResourceUpdate", + "EduResourceUseInClass", + "FlatErrorResponse", + "GoogleClassroomCoursework", + "GoogleClassroomSubmission", + "Grade", + "Group", + "GroupCreation", + "GroupDetails", + "GroupType", + "LicenseMode", + "LicenseSources", + "LmsName", + "LtiConfiguration", + "LtiConfiguration1p1", + "LtiConfiguration1p1AllOfTool", + "LtiConfiguration1p3", + "LtiConfiguration1p3Base", + "LtiConfiguration1p3BaseSupportedServices", + "LtiConfiguration1p3BaseSupportedServicesAgs", + "LtiConfiguration1p3BaseSupportedServicesDeepLinking", + "LtiConfiguration1p3BaseSupportedServicesNrps", + "LtiConfiguration1p3BaseTool", + "LtiConfiguration1p3Deployment", + "LtiConfiguration1p3Dynamic", + "LtiConfiguration1p3Manual", + "LtiConfigurationBase", + "LtiConfigurationCreate", + "LtiConfigurationCreate1p1", + "LtiConfigurationCreate1p3Deployment", + "LtiConfigurationCreate1p3Dynamic", + "LtiConfigurationCreate1p3DynamicPlatformInfo", + "LtiConfigurationCreate1p3Manual", + "LtiConfigurationUpdate", + "LtiConfigurationUpdateDeployment", + "LtiConfigurationUpdateStandalone", + "LtiCredentials", + "LtiCredentialsCreation", + "MediaAttachment", + "MediaScoreSharingMode", + "MicrosoftGraphAssignment", + "MicrosoftGraphSubmission", + "OmrCapabilities", + "OmrDetailsStepData", + "OmrDetailsSubmission", + "OmrDetectedInstrument", + "OmrImportedMetadata", + "OmrInstrumentOverride", + "OmrJob", + "OmrJobCreation", + "OmrJobFileMetadata", + "OmrJobFileUpload", + "OmrJobFileUploadResult", + "OmrJobInputFile", + "OmrJobOutput", + "OmrJobProgress", + "OmrJobResult", + "OmrJobRetention", + "OmrJobStatus", + "OmrLocaleDetails", + "OmrPendingStep", + "OmrStepName", + "OrganizationInvitation", + "OrganizationInvitationCreation", + "OrganizationRoles", + "OrganizationUserAccessTokenCreation", + "RenameGroupRequest", + "ResourceCollaborator", + "ResourceCollaboratorCreation", + "ResourceRights", + "ScoreComment", + "ScoreCommentContext", + "ScoreCommentCreation", + "ScoreCommentModeration", + "ScoreCommentUpdate", + "ScoreCommentsCounts", + "ScoreCreation", + "ScoreCreationBuilderData", + "ScoreCreationBuilderDataAllOfBuilderData", + "ScoreCreationBuilderDataAllOfBuilderDataLayoutData", + "ScoreCreationBuilderDataAllOfBuilderDataScoreData", + "ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments", + "ScoreCreationCommon", + "ScoreCreationFileImport", + "ScoreCreationGoogleDriveImport", + "ScoreCreationType", + "ScoreDetails", + "ScoreDetailsAllOfMe", + "ScoreFork", + "ScoreLicense", + "ScoreLikesCounts", + "ScoreModification", + "ScorePlaysCounts", + "ScorePrivacy", + "ScoreRevision", + "ScoreRevisionCreation", + "ScoreRevisionStatistics", + "ScoreSource", + "ScoreSummary", + "ScoreTrack", + "ScoreTrackCreation", + "ScoreTrackCreationResponse", + "ScoreTrackPoint", + "ScoreTrackPurpose", + "ScoreTrackState", + "ScoreTrackType", + "ScoreTrackUpdate", + "ScoreViewsCounts", + "Task", + "TaskExportOptions", + "TaskProgress", + "TaskResult", + "TeachingTheme", + "TutteoProduct", + "UserAdminUpdate", + "UserAzureDetails", + "UserBasics", + "UserCommunityProfileLinks", + "UserCreation", + "UserDetails", + "UserDetailsAdmin", + "UserDetailsAdminAllOfLicense", + "UserPublic", + "UserPublicSummary", + "UserSigninLink", + "UserSigninLinkCreation", +] # import apis into sdk package -from flat_api.api.account_api import AccountApi -from flat_api.api.class_api import ClassApi -from flat_api.api.collection_api import CollectionApi -from flat_api.api.edu_resources_api import EduResourcesApi -from flat_api.api.group_api import GroupApi -from flat_api.api.organization_api import OrganizationApi -from flat_api.api.score_api import ScoreApi -from flat_api.api.task_api import TaskApi -from flat_api.api.user_api import UserApi +from flat_api.api.account_api import AccountApi as AccountApi +from flat_api.api.class_api import ClassApi as ClassApi +from flat_api.api.collection_api import CollectionApi as CollectionApi +from flat_api.api.edu_resources_api import EduResourcesApi as EduResourcesApi +from flat_api.api.group_api import GroupApi as GroupApi +from flat_api.api.omr_api import OMRApi as OMRApi +from flat_api.api.organization_api import OrganizationApi as OrganizationApi +from flat_api.api.score_api import ScoreApi as ScoreApi +from flat_api.api.task_api import TaskApi as TaskApi +from flat_api.api.user_api import UserApi as UserApi # import ApiClient -from flat_api.api_response import ApiResponse -from flat_api.api_client import ApiClient -from flat_api.configuration import Configuration -from flat_api.exceptions import OpenApiException -from flat_api.exceptions import ApiTypeError -from flat_api.exceptions import ApiValueError -from flat_api.exceptions import ApiKeyError -from flat_api.exceptions import ApiAttributeError -from flat_api.exceptions import ApiException +from flat_api.api_response import ApiResponse as ApiResponse +from flat_api.api_client import ApiClient as ApiClient +from flat_api.configuration import Configuration as Configuration +from flat_api.exceptions import OpenApiException as OpenApiException +from flat_api.exceptions import ApiTypeError as ApiTypeError +from flat_api.exceptions import ApiValueError as ApiValueError +from flat_api.exceptions import ApiKeyError as ApiKeyError +from flat_api.exceptions import ApiAttributeError as ApiAttributeError +from flat_api.exceptions import ApiException as ApiException # import models into sdk package -from flat_api.models.api_access_token import ApiAccessToken -from flat_api.models.app_scopes import AppScopes -from flat_api.models.assignment import Assignment -from flat_api.models.assignment_copy import AssignmentCopy -from flat_api.models.assignment_copy_response import AssignmentCopyResponse -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities -from flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error import AssignmentCopyResponseCapabilitiesCanPublishInClassError -from flat_api.models.assignment_submission import AssignmentSubmission -from flat_api.models.assignment_submission_comment import AssignmentSubmissionComment -from flat_api.models.assignment_submission_comment_creation import AssignmentSubmissionCommentCreation -from flat_api.models.assignment_submission_comments import AssignmentSubmissionComments -from flat_api.models.assignment_submission_history import AssignmentSubmissionHistory -from flat_api.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment -from flat_api.models.assignment_submission_history_state import AssignmentSubmissionHistoryState -from flat_api.models.assignment_submission_lti import AssignmentSubmissionLti -from flat_api.models.assignment_submission_playback_inner import AssignmentSubmissionPlaybackInner -from flat_api.models.assignment_submission_state import AssignmentSubmissionState -from flat_api.models.assignment_submission_update import AssignmentSubmissionUpdate -from flat_api.models.assignment_type import AssignmentType -from flat_api.models.assignment_update import AssignmentUpdate -from flat_api.models.class_assignment import ClassAssignment -from flat_api.models.class_assignment_canvas import ClassAssignmentCanvas -from flat_api.models.class_assignment_lti import ClassAssignmentLti -from flat_api.models.class_assignment_mfc import ClassAssignmentMfc -from flat_api.models.class_assignment_update import ClassAssignmentUpdate -from flat_api.models.class_assignment_update_google_classroom import ClassAssignmentUpdateGoogleClassroom -from flat_api.models.class_assignment_update_microsoft_graph import ClassAssignmentUpdateMicrosoftGraph -from flat_api.models.class_attachment_creation import ClassAttachmentCreation -from flat_api.models.class_creation import ClassCreation -from flat_api.models.class_details import ClassDetails -from flat_api.models.class_details_canvas import ClassDetailsCanvas -from flat_api.models.class_details_clever import ClassDetailsClever -from flat_api.models.class_details_google_classroom import ClassDetailsGoogleClassroom -from flat_api.models.class_details_google_drive import ClassDetailsGoogleDrive -from flat_api.models.class_details_issues import ClassDetailsIssues -from flat_api.models.class_details_issues_sync_inner import ClassDetailsIssuesSyncInner -from flat_api.models.class_details_lti import ClassDetailsLti -from flat_api.models.class_details_mfc import ClassDetailsMfc -from flat_api.models.class_details_microsoft_graph import ClassDetailsMicrosoftGraph -from flat_api.models.class_grade_level import ClassGradeLevel -from flat_api.models.class_roles import ClassRoles -from flat_api.models.class_state import ClassState -from flat_api.models.class_update import ClassUpdate -from flat_api.models.collection import Collection -from flat_api.models.collection_app import CollectionApp -from flat_api.models.collection_capabilities import CollectionCapabilities -from flat_api.models.collection_creation import CollectionCreation -from flat_api.models.collection_modification import CollectionModification -from flat_api.models.collection_privacy import CollectionPrivacy -from flat_api.models.collection_type import CollectionType -from flat_api.models.edu_library import EduLibrary -from flat_api.models.edu_resource import EduResource -from flat_api.models.edu_resource_capabilities import EduResourceCapabilities -from flat_api.models.edu_resource_copy import EduResourceCopy -from flat_api.models.edu_resource_creation import EduResourceCreation -from flat_api.models.edu_resource_lti_link import EduResourceLtiLink -from flat_api.models.edu_resource_move import EduResourceMove -from flat_api.models.edu_resource_privacy import EduResourcePrivacy -from flat_api.models.edu_resource_resource import EduResourceResource -from flat_api.models.edu_resource_type import EduResourceType -from flat_api.models.edu_resource_update import EduResourceUpdate -from flat_api.models.edu_resource_use_in_class import EduResourceUseInClass -from flat_api.models.flat_error_response import FlatErrorResponse -from flat_api.models.flat_locales import FlatLocales -from flat_api.models.google_classroom_coursework import GoogleClassroomCoursework -from flat_api.models.google_classroom_submission import GoogleClassroomSubmission -from flat_api.models.group import Group -from flat_api.models.group_details import GroupDetails -from flat_api.models.group_type import GroupType -from flat_api.models.license_mode import LicenseMode -from flat_api.models.license_sources import LicenseSources -from flat_api.models.lms_name import LmsName -from flat_api.models.lti_credentials import LtiCredentials -from flat_api.models.lti_credentials_creation import LtiCredentialsCreation -from flat_api.models.media_attachment import MediaAttachment -from flat_api.models.media_score_sharing_mode import MediaScoreSharingMode -from flat_api.models.microsoft_graph_assignment import MicrosoftGraphAssignment -from flat_api.models.microsoft_graph_submission import MicrosoftGraphSubmission -from flat_api.models.organization_invitation import OrganizationInvitation -from flat_api.models.organization_invitation_creation import OrganizationInvitationCreation -from flat_api.models.organization_roles import OrganizationRoles -from flat_api.models.organization_user_access_token_creation import OrganizationUserAccessTokenCreation -from flat_api.models.resource_collaborator import ResourceCollaborator -from flat_api.models.resource_collaborator_creation import ResourceCollaboratorCreation -from flat_api.models.resource_rights import ResourceRights -from flat_api.models.score_comment import ScoreComment -from flat_api.models.score_comment_context import ScoreCommentContext -from flat_api.models.score_comment_creation import ScoreCommentCreation -from flat_api.models.score_comment_moderation import ScoreCommentModeration -from flat_api.models.score_comment_update import ScoreCommentUpdate -from flat_api.models.score_comments_counts import ScoreCommentsCounts -from flat_api.models.score_creation import ScoreCreation -from flat_api.models.score_creation_builder_data import ScoreCreationBuilderData -from flat_api.models.score_creation_builder_data_layout_data import ScoreCreationBuilderDataLayoutData -from flat_api.models.score_creation_builder_data_score_data import ScoreCreationBuilderDataScoreData -from flat_api.models.score_creation_builder_data_score_data_instruments_inner import ScoreCreationBuilderDataScoreDataInstrumentsInner -from flat_api.models.score_creation_type import ScoreCreationType -from flat_api.models.score_details import ScoreDetails -from flat_api.models.score_fork import ScoreFork -from flat_api.models.score_license import ScoreLicense -from flat_api.models.score_likes_counts import ScoreLikesCounts -from flat_api.models.score_modification import ScoreModification -from flat_api.models.score_plays_counts import ScorePlaysCounts -from flat_api.models.score_privacy import ScorePrivacy -from flat_api.models.score_revision import ScoreRevision -from flat_api.models.score_revision_creation import ScoreRevisionCreation -from flat_api.models.score_revision_statistics import ScoreRevisionStatistics -from flat_api.models.score_source import ScoreSource -from flat_api.models.score_track import ScoreTrack -from flat_api.models.score_track_creation import ScoreTrackCreation -from flat_api.models.score_track_point import ScoreTrackPoint -from flat_api.models.score_track_purpose import ScoreTrackPurpose -from flat_api.models.score_track_state import ScoreTrackState -from flat_api.models.score_track_type import ScoreTrackType -from flat_api.models.score_track_update import ScoreTrackUpdate -from flat_api.models.score_views_counts import ScoreViewsCounts -from flat_api.models.task import Task -from flat_api.models.task_export_options import TaskExportOptions -from flat_api.models.task_progress import TaskProgress -from flat_api.models.task_result import TaskResult -from flat_api.models.tutteo_product import TutteoProduct -from flat_api.models.user_admin_update import UserAdminUpdate -from flat_api.models.user_azure_details import UserAzureDetails -from flat_api.models.user_community_profile_links import UserCommunityProfileLinks -from flat_api.models.user_creation import UserCreation -from flat_api.models.user_details import UserDetails -from flat_api.models.user_details_admin import UserDetailsAdmin -from flat_api.models.user_details_admin_license import UserDetailsAdminLicense -from flat_api.models.user_public import UserPublic -from flat_api.models.user_public_summary import UserPublicSummary -from flat_api.models.user_signin_link import UserSigninLink -from flat_api.models.user_signin_link_creation import UserSigninLinkCreation +from flat_api.models.add_group_user200_response import AddGroupUser200Response as AddGroupUser200Response +from flat_api.models.add_group_user_request import AddGroupUserRequest as AddGroupUserRequest +from flat_api.models.api_access_token import ApiAccessToken as ApiAccessToken +from flat_api.models.app_scopes import AppScopes as AppScopes +from flat_api.models.assignment import Assignment as Assignment +from flat_api.models.assignment_capabilities import AssignmentCapabilities as AssignmentCapabilities +from flat_api.models.assignment_capabilities_can_publish_in_class_error import AssignmentCapabilitiesCanPublishInClassError as AssignmentCapabilitiesCanPublishInClassError +from flat_api.models.assignment_copy import AssignmentCopy as AssignmentCopy +from flat_api.models.assignment_copy_response import AssignmentCopyResponse as AssignmentCopyResponse +from flat_api.models.assignment_copy_to_class import AssignmentCopyToClass as AssignmentCopyToClass +from flat_api.models.assignment_copy_to_resource_library import AssignmentCopyToResourceLibrary as AssignmentCopyToResourceLibrary +from flat_api.models.assignment_group import AssignmentGroup as AssignmentGroup +from flat_api.models.assignment_submission import AssignmentSubmission as AssignmentSubmission +from flat_api.models.assignment_submission_comment import AssignmentSubmissionComment as AssignmentSubmissionComment +from flat_api.models.assignment_submission_comment_creation import AssignmentSubmissionCommentCreation as AssignmentSubmissionCommentCreation +from flat_api.models.assignment_submission_comments import AssignmentSubmissionComments as AssignmentSubmissionComments +from flat_api.models.assignment_submission_history import AssignmentSubmissionHistory as AssignmentSubmissionHistory +from flat_api.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment as AssignmentSubmissionHistoryAttachment +from flat_api.models.assignment_submission_history_state import AssignmentSubmissionHistoryState as AssignmentSubmissionHistoryState +from flat_api.models.assignment_submission_lti import AssignmentSubmissionLti as AssignmentSubmissionLti +from flat_api.models.assignment_submission_playback import AssignmentSubmissionPlayback as AssignmentSubmissionPlayback +from flat_api.models.assignment_submission_state import AssignmentSubmissionState as AssignmentSubmissionState +from flat_api.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode as AssignmentSubmissionStudentsMode +from flat_api.models.assignment_submission_update import AssignmentSubmissionUpdate as AssignmentSubmissionUpdate +from flat_api.models.assignment_type import AssignmentType as AssignmentType +from flat_api.models.assignment_update import AssignmentUpdate as AssignmentUpdate +from flat_api.models.class_assignment import ClassAssignment as ClassAssignment +from flat_api.models.class_assignment_all_of_canvas import ClassAssignmentAllOfCanvas as ClassAssignmentAllOfCanvas +from flat_api.models.class_assignment_all_of_lti import ClassAssignmentAllOfLti as ClassAssignmentAllOfLti +from flat_api.models.class_assignment_all_of_mfc import ClassAssignmentAllOfMfc as ClassAssignmentAllOfMfc +from flat_api.models.class_assignment_update import ClassAssignmentUpdate as ClassAssignmentUpdate +from flat_api.models.class_assignment_update_all_of_google_classroom import ClassAssignmentUpdateAllOfGoogleClassroom as ClassAssignmentUpdateAllOfGoogleClassroom +from flat_api.models.class_assignment_update_all_of_microsoft_graph import ClassAssignmentUpdateAllOfMicrosoftGraph as ClassAssignmentUpdateAllOfMicrosoftGraph +from flat_api.models.class_attachment_creation import ClassAttachmentCreation as ClassAttachmentCreation +from flat_api.models.class_creation import ClassCreation as ClassCreation +from flat_api.models.class_details import ClassDetails as ClassDetails +from flat_api.models.class_details_canvas import ClassDetailsCanvas as ClassDetailsCanvas +from flat_api.models.class_details_clever import ClassDetailsClever as ClassDetailsClever +from flat_api.models.class_details_google_classroom import ClassDetailsGoogleClassroom as ClassDetailsGoogleClassroom +from flat_api.models.class_details_google_drive import ClassDetailsGoogleDrive as ClassDetailsGoogleDrive +from flat_api.models.class_details_issues import ClassDetailsIssues as ClassDetailsIssues +from flat_api.models.class_details_issues_sync_inner import ClassDetailsIssuesSyncInner as ClassDetailsIssuesSyncInner +from flat_api.models.class_details_lti import ClassDetailsLti as ClassDetailsLti +from flat_api.models.class_details_mfc import ClassDetailsMfc as ClassDetailsMfc +from flat_api.models.class_details_microsoft_graph import ClassDetailsMicrosoftGraph as ClassDetailsMicrosoftGraph +from flat_api.models.class_grade_level import ClassGradeLevel as ClassGradeLevel +from flat_api.models.class_roles import ClassRoles as ClassRoles +from flat_api.models.class_state import ClassState as ClassState +from flat_api.models.class_update import ClassUpdate as ClassUpdate +from flat_api.models.collection import Collection as Collection +from flat_api.models.collection_app import CollectionApp as CollectionApp +from flat_api.models.collection_capabilities import CollectionCapabilities as CollectionCapabilities +from flat_api.models.collection_contents import CollectionContents as CollectionContents +from flat_api.models.collection_creation import CollectionCreation as CollectionCreation +from flat_api.models.collection_modification import CollectionModification as CollectionModification +from flat_api.models.collection_privacy import CollectionPrivacy as CollectionPrivacy +from flat_api.models.collection_type import CollectionType as CollectionType +from flat_api.models.create_lti_configuration200_response import CreateLtiConfiguration200Response as CreateLtiConfiguration200Response +from flat_api.models.credit_transaction import CreditTransaction as CreditTransaction +from flat_api.models.edu_library import EduLibrary as EduLibrary +from flat_api.models.edu_resource import EduResource as EduResource +from flat_api.models.edu_resource_assignment_creation import EduResourceAssignmentCreation as EduResourceAssignmentCreation +from flat_api.models.edu_resource_capabilities import EduResourceCapabilities as EduResourceCapabilities +from flat_api.models.edu_resource_copy import EduResourceCopy as EduResourceCopy +from flat_api.models.edu_resource_creation import EduResourceCreation as EduResourceCreation +from flat_api.models.edu_resource_folder import EduResourceFolder as EduResourceFolder +from flat_api.models.edu_resource_lti_link import EduResourceLtiLink as EduResourceLtiLink +from flat_api.models.edu_resource_move import EduResourceMove as EduResourceMove +from flat_api.models.edu_resource_privacy import EduResourcePrivacy as EduResourcePrivacy +from flat_api.models.edu_resource_resource import EduResourceResource as EduResourceResource +from flat_api.models.edu_resource_type import EduResourceType as EduResourceType +from flat_api.models.edu_resource_update import EduResourceUpdate as EduResourceUpdate +from flat_api.models.edu_resource_use_in_class import EduResourceUseInClass as EduResourceUseInClass +from flat_api.models.flat_error_response import FlatErrorResponse as FlatErrorResponse +from flat_api.models.google_classroom_coursework import GoogleClassroomCoursework as GoogleClassroomCoursework +from flat_api.models.google_classroom_submission import GoogleClassroomSubmission as GoogleClassroomSubmission +from flat_api.models.grade import Grade as Grade +from flat_api.models.group import Group as Group +from flat_api.models.group_creation import GroupCreation as GroupCreation +from flat_api.models.group_details import GroupDetails as GroupDetails +from flat_api.models.group_type import GroupType as GroupType +from flat_api.models.license_mode import LicenseMode as LicenseMode +from flat_api.models.license_sources import LicenseSources as LicenseSources +from flat_api.models.lms_name import LmsName as LmsName +from flat_api.models.lti_configuration import LtiConfiguration as LtiConfiguration +from flat_api.models.lti_configuration1p1 import LtiConfiguration1p1 as LtiConfiguration1p1 +from flat_api.models.lti_configuration1p1_all_of_tool import LtiConfiguration1p1AllOfTool as LtiConfiguration1p1AllOfTool +from flat_api.models.lti_configuration1p3 import LtiConfiguration1p3 as LtiConfiguration1p3 +from flat_api.models.lti_configuration1p3_base import LtiConfiguration1p3Base as LtiConfiguration1p3Base +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices as LtiConfiguration1p3BaseSupportedServices +from flat_api.models.lti_configuration1p3_base_supported_services_ags import LtiConfiguration1p3BaseSupportedServicesAgs as LtiConfiguration1p3BaseSupportedServicesAgs +from flat_api.models.lti_configuration1p3_base_supported_services_deep_linking import LtiConfiguration1p3BaseSupportedServicesDeepLinking as LtiConfiguration1p3BaseSupportedServicesDeepLinking +from flat_api.models.lti_configuration1p3_base_supported_services_nrps import LtiConfiguration1p3BaseSupportedServicesNrps as LtiConfiguration1p3BaseSupportedServicesNrps +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool as LtiConfiguration1p3BaseTool +from flat_api.models.lti_configuration1p3_deployment import LtiConfiguration1p3Deployment as LtiConfiguration1p3Deployment +from flat_api.models.lti_configuration1p3_dynamic import LtiConfiguration1p3Dynamic as LtiConfiguration1p3Dynamic +from flat_api.models.lti_configuration1p3_manual import LtiConfiguration1p3Manual as LtiConfiguration1p3Manual +from flat_api.models.lti_configuration_base import LtiConfigurationBase as LtiConfigurationBase +from flat_api.models.lti_configuration_create import LtiConfigurationCreate as LtiConfigurationCreate +from flat_api.models.lti_configuration_create1p1 import LtiConfigurationCreate1p1 as LtiConfigurationCreate1p1 +from flat_api.models.lti_configuration_create1p3_deployment import LtiConfigurationCreate1p3Deployment as LtiConfigurationCreate1p3Deployment +from flat_api.models.lti_configuration_create1p3_dynamic import LtiConfigurationCreate1p3Dynamic as LtiConfigurationCreate1p3Dynamic +from flat_api.models.lti_configuration_create1p3_dynamic_platform_info import LtiConfigurationCreate1p3DynamicPlatformInfo as LtiConfigurationCreate1p3DynamicPlatformInfo +from flat_api.models.lti_configuration_create1p3_manual import LtiConfigurationCreate1p3Manual as LtiConfigurationCreate1p3Manual +from flat_api.models.lti_configuration_update import LtiConfigurationUpdate as LtiConfigurationUpdate +from flat_api.models.lti_configuration_update_deployment import LtiConfigurationUpdateDeployment as LtiConfigurationUpdateDeployment +from flat_api.models.lti_configuration_update_standalone import LtiConfigurationUpdateStandalone as LtiConfigurationUpdateStandalone +from flat_api.models.lti_credentials import LtiCredentials as LtiCredentials +from flat_api.models.lti_credentials_creation import LtiCredentialsCreation as LtiCredentialsCreation +from flat_api.models.media_attachment import MediaAttachment as MediaAttachment +from flat_api.models.media_score_sharing_mode import MediaScoreSharingMode as MediaScoreSharingMode +from flat_api.models.microsoft_graph_assignment import MicrosoftGraphAssignment as MicrosoftGraphAssignment +from flat_api.models.microsoft_graph_submission import MicrosoftGraphSubmission as MicrosoftGraphSubmission +from flat_api.models.omr_capabilities import OmrCapabilities as OmrCapabilities +from flat_api.models.omr_details_step_data import OmrDetailsStepData as OmrDetailsStepData +from flat_api.models.omr_details_submission import OmrDetailsSubmission as OmrDetailsSubmission +from flat_api.models.omr_detected_instrument import OmrDetectedInstrument as OmrDetectedInstrument +from flat_api.models.omr_imported_metadata import OmrImportedMetadata as OmrImportedMetadata +from flat_api.models.omr_instrument_override import OmrInstrumentOverride as OmrInstrumentOverride +from flat_api.models.omr_job import OmrJob as OmrJob +from flat_api.models.omr_job_creation import OmrJobCreation as OmrJobCreation +from flat_api.models.omr_job_file_metadata import OmrJobFileMetadata as OmrJobFileMetadata +from flat_api.models.omr_job_file_upload import OmrJobFileUpload as OmrJobFileUpload +from flat_api.models.omr_job_file_upload_result import OmrJobFileUploadResult as OmrJobFileUploadResult +from flat_api.models.omr_job_input_file import OmrJobInputFile as OmrJobInputFile +from flat_api.models.omr_job_output import OmrJobOutput as OmrJobOutput +from flat_api.models.omr_job_progress import OmrJobProgress as OmrJobProgress +from flat_api.models.omr_job_result import OmrJobResult as OmrJobResult +from flat_api.models.omr_job_retention import OmrJobRetention as OmrJobRetention +from flat_api.models.omr_job_status import OmrJobStatus as OmrJobStatus +from flat_api.models.omr_locale_details import OmrLocaleDetails as OmrLocaleDetails +from flat_api.models.omr_pending_step import OmrPendingStep as OmrPendingStep +from flat_api.models.omr_step_name import OmrStepName as OmrStepName +from flat_api.models.organization_invitation import OrganizationInvitation as OrganizationInvitation +from flat_api.models.organization_invitation_creation import OrganizationInvitationCreation as OrganizationInvitationCreation +from flat_api.models.organization_roles import OrganizationRoles as OrganizationRoles +from flat_api.models.organization_user_access_token_creation import OrganizationUserAccessTokenCreation as OrganizationUserAccessTokenCreation +from flat_api.models.rename_group_request import RenameGroupRequest as RenameGroupRequest +from flat_api.models.resource_collaborator import ResourceCollaborator as ResourceCollaborator +from flat_api.models.resource_collaborator_creation import ResourceCollaboratorCreation as ResourceCollaboratorCreation +from flat_api.models.resource_rights import ResourceRights as ResourceRights +from flat_api.models.score_comment import ScoreComment as ScoreComment +from flat_api.models.score_comment_context import ScoreCommentContext as ScoreCommentContext +from flat_api.models.score_comment_creation import ScoreCommentCreation as ScoreCommentCreation +from flat_api.models.score_comment_moderation import ScoreCommentModeration as ScoreCommentModeration +from flat_api.models.score_comment_update import ScoreCommentUpdate as ScoreCommentUpdate +from flat_api.models.score_comments_counts import ScoreCommentsCounts as ScoreCommentsCounts +from flat_api.models.score_creation import ScoreCreation as ScoreCreation +from flat_api.models.score_creation_builder_data import ScoreCreationBuilderData as ScoreCreationBuilderData +from flat_api.models.score_creation_builder_data_all_of_builder_data import ScoreCreationBuilderDataAllOfBuilderData as ScoreCreationBuilderDataAllOfBuilderData +from flat_api.models.score_creation_builder_data_all_of_builder_data_layout_data import ScoreCreationBuilderDataAllOfBuilderDataLayoutData as ScoreCreationBuilderDataAllOfBuilderDataLayoutData +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data import ScoreCreationBuilderDataAllOfBuilderDataScoreData as ScoreCreationBuilderDataAllOfBuilderDataScoreData +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data_instruments import ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments as ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments +from flat_api.models.score_creation_common import ScoreCreationCommon as ScoreCreationCommon +from flat_api.models.score_creation_file_import import ScoreCreationFileImport as ScoreCreationFileImport +from flat_api.models.score_creation_google_drive_import import ScoreCreationGoogleDriveImport as ScoreCreationGoogleDriveImport +from flat_api.models.score_creation_type import ScoreCreationType as ScoreCreationType +from flat_api.models.score_details import ScoreDetails as ScoreDetails +from flat_api.models.score_details_all_of_me import ScoreDetailsAllOfMe as ScoreDetailsAllOfMe +from flat_api.models.score_fork import ScoreFork as ScoreFork +from flat_api.models.score_license import ScoreLicense as ScoreLicense +from flat_api.models.score_likes_counts import ScoreLikesCounts as ScoreLikesCounts +from flat_api.models.score_modification import ScoreModification as ScoreModification +from flat_api.models.score_plays_counts import ScorePlaysCounts as ScorePlaysCounts +from flat_api.models.score_privacy import ScorePrivacy as ScorePrivacy +from flat_api.models.score_revision import ScoreRevision as ScoreRevision +from flat_api.models.score_revision_creation import ScoreRevisionCreation as ScoreRevisionCreation +from flat_api.models.score_revision_statistics import ScoreRevisionStatistics as ScoreRevisionStatistics +from flat_api.models.score_source import ScoreSource as ScoreSource +from flat_api.models.score_summary import ScoreSummary as ScoreSummary +from flat_api.models.score_track import ScoreTrack as ScoreTrack +from flat_api.models.score_track_creation import ScoreTrackCreation as ScoreTrackCreation +from flat_api.models.score_track_creation_response import ScoreTrackCreationResponse as ScoreTrackCreationResponse +from flat_api.models.score_track_point import ScoreTrackPoint as ScoreTrackPoint +from flat_api.models.score_track_purpose import ScoreTrackPurpose as ScoreTrackPurpose +from flat_api.models.score_track_state import ScoreTrackState as ScoreTrackState +from flat_api.models.score_track_type import ScoreTrackType as ScoreTrackType +from flat_api.models.score_track_update import ScoreTrackUpdate as ScoreTrackUpdate +from flat_api.models.score_views_counts import ScoreViewsCounts as ScoreViewsCounts +from flat_api.models.task import Task as Task +from flat_api.models.task_export_options import TaskExportOptions as TaskExportOptions +from flat_api.models.task_progress import TaskProgress as TaskProgress +from flat_api.models.task_result import TaskResult as TaskResult +from flat_api.models.teaching_theme import TeachingTheme as TeachingTheme +from flat_api.models.tutteo_product import TutteoProduct as TutteoProduct +from flat_api.models.user_admin_update import UserAdminUpdate as UserAdminUpdate +from flat_api.models.user_azure_details import UserAzureDetails as UserAzureDetails +from flat_api.models.user_basics import UserBasics as UserBasics +from flat_api.models.user_community_profile_links import UserCommunityProfileLinks as UserCommunityProfileLinks +from flat_api.models.user_creation import UserCreation as UserCreation +from flat_api.models.user_details import UserDetails as UserDetails +from flat_api.models.user_details_admin import UserDetailsAdmin as UserDetailsAdmin +from flat_api.models.user_details_admin_all_of_license import UserDetailsAdminAllOfLicense as UserDetailsAdminAllOfLicense +from flat_api.models.user_public import UserPublic as UserPublic +from flat_api.models.user_public_summary import UserPublicSummary as UserPublicSummary +from flat_api.models.user_signin_link import UserSigninLink as UserSigninLink +from flat_api.models.user_signin_link_creation import UserSigninLinkCreation as UserSigninLinkCreation + diff --git a/flat_api/_retry.py b/flat_api/_retry.py new file mode 100644 index 0000000..eb59cf5 --- /dev/null +++ b/flat_api/_retry.py @@ -0,0 +1,67 @@ +"""Retry policy for the Flat API. + +Flat does not follow the usual conventions, and getting this wrong is silent: + + * rate limiting returns **403**, not 429 + * there is **no Retry-After header**; the reset time is ``X-RateLimit-Reset``, UTC epoch seconds + * a plain 403 is a genuine authorization failure and must never be retried + +So the policy keys on the response body's ``code``, not on the status alone. +""" + +from __future__ import annotations + +import random +import time +from dataclasses import dataclass + +from flat_api.errors import FlatError, FlatRateLimitError, FlatServerError + +#: Methods safe to replay. A non-idempotent request that may already have been applied is not. +IDEMPOTENT_METHODS = frozenset({"GET", "HEAD", "OPTIONS", "PUT", "DELETE"}) + +MAX_RATE_LIMIT_WAIT = 300.0 + + +@dataclass(frozen=True) +class RetryPolicy: + """How the client retries. Pass ``RetryPolicy.disabled()`` to opt out entirely.""" + + attempts: int = 3 + backoff_base: float = 0.5 + backoff_max: float = 30.0 + jitter: float = 0.25 + respect_rate_limit_reset: bool = True + + @classmethod + def disabled(cls) -> "RetryPolicy": + """No retries. Errors still arrive typed, and a rate-limit error still carries its reset.""" + return cls(attempts=1) + + @property + def enabled(self) -> bool: + return self.attempts > 1 + + def should_retry(self, error: BaseException, method: str, attempt: int) -> bool: + if attempt >= self.attempts: + return False + if method.upper() not in IDEMPOTENT_METHODS: + return False + if isinstance(error, FlatRateLimitError): + return True + if isinstance(error, FlatServerError): + return True + # A transport failure before the request was sent is safe to replay. + return isinstance(error, OSError) and not isinstance(error, FlatError) + + def delay_for(self, error: BaseException, attempt: int) -> float: + if ( + self.respect_rate_limit_reset + and isinstance(error, FlatRateLimitError) + and error.reset is not None + ): + wait = error.reset - time.time() + if wait > 0: + return min(wait + random.uniform(0, self.jitter), MAX_RATE_LIMIT_WAIT) + exponential = min(self.backoff_base * (2 ** (attempt - 1)), self.backoff_max) + return exponential + random.uniform(0, self.jitter * exponential) diff --git a/flat_api/aio/__init__.py b/flat_api/aio/__init__.py new file mode 100644 index 0000000..4740288 --- /dev/null +++ b/flat_api/aio/__init__.py @@ -0,0 +1,461 @@ +# coding: utf-8 + +# flake8: noqa + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "2.0.0" + +# Define package exports +__all__ = [ + "AccountApi", + "ClassApi", + "CollectionApi", + "EduResourcesApi", + "GroupApi", + "OMRApi", + "OrganizationApi", + "ScoreApi", + "TaskApi", + "UserApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "AddGroupUser200Response", + "AddGroupUserRequest", + "ApiAccessToken", + "AppScopes", + "Assignment", + "AssignmentCapabilities", + "AssignmentCapabilitiesCanPublishInClassError", + "AssignmentCopy", + "AssignmentCopyResponse", + "AssignmentCopyToClass", + "AssignmentCopyToResourceLibrary", + "AssignmentGroup", + "AssignmentSubmission", + "AssignmentSubmissionComment", + "AssignmentSubmissionCommentCreation", + "AssignmentSubmissionComments", + "AssignmentSubmissionHistory", + "AssignmentSubmissionHistoryAttachment", + "AssignmentSubmissionHistoryState", + "AssignmentSubmissionLti", + "AssignmentSubmissionPlayback", + "AssignmentSubmissionState", + "AssignmentSubmissionStudentsMode", + "AssignmentSubmissionUpdate", + "AssignmentType", + "AssignmentUpdate", + "ClassAssignment", + "ClassAssignmentAllOfCanvas", + "ClassAssignmentAllOfLti", + "ClassAssignmentAllOfMfc", + "ClassAssignmentUpdate", + "ClassAssignmentUpdateAllOfGoogleClassroom", + "ClassAssignmentUpdateAllOfMicrosoftGraph", + "ClassAttachmentCreation", + "ClassCreation", + "ClassDetails", + "ClassDetailsCanvas", + "ClassDetailsClever", + "ClassDetailsGoogleClassroom", + "ClassDetailsGoogleDrive", + "ClassDetailsIssues", + "ClassDetailsIssuesSyncInner", + "ClassDetailsLti", + "ClassDetailsMfc", + "ClassDetailsMicrosoftGraph", + "ClassGradeLevel", + "ClassRoles", + "ClassState", + "ClassUpdate", + "Collection", + "CollectionApp", + "CollectionCapabilities", + "CollectionContents", + "CollectionCreation", + "CollectionModification", + "CollectionPrivacy", + "CollectionType", + "CreateLtiConfiguration200Response", + "CreditTransaction", + "EduLibrary", + "EduResource", + "EduResourceAssignmentCreation", + "EduResourceCapabilities", + "EduResourceCopy", + "EduResourceCreation", + "EduResourceFolder", + "EduResourceLtiLink", + "EduResourceMove", + "EduResourcePrivacy", + "EduResourceResource", + "EduResourceType", + "EduResourceUpdate", + "EduResourceUseInClass", + "FlatErrorResponse", + "GoogleClassroomCoursework", + "GoogleClassroomSubmission", + "Grade", + "Group", + "GroupCreation", + "GroupDetails", + "GroupType", + "LicenseMode", + "LicenseSources", + "LmsName", + "LtiConfiguration", + "LtiConfiguration1p1", + "LtiConfiguration1p1AllOfTool", + "LtiConfiguration1p3", + "LtiConfiguration1p3Base", + "LtiConfiguration1p3BaseSupportedServices", + "LtiConfiguration1p3BaseSupportedServicesAgs", + "LtiConfiguration1p3BaseSupportedServicesDeepLinking", + "LtiConfiguration1p3BaseSupportedServicesNrps", + "LtiConfiguration1p3BaseTool", + "LtiConfiguration1p3Deployment", + "LtiConfiguration1p3Dynamic", + "LtiConfiguration1p3Manual", + "LtiConfigurationBase", + "LtiConfigurationCreate", + "LtiConfigurationCreate1p1", + "LtiConfigurationCreate1p3Deployment", + "LtiConfigurationCreate1p3Dynamic", + "LtiConfigurationCreate1p3DynamicPlatformInfo", + "LtiConfigurationCreate1p3Manual", + "LtiConfigurationUpdate", + "LtiConfigurationUpdateDeployment", + "LtiConfigurationUpdateStandalone", + "LtiCredentials", + "LtiCredentialsCreation", + "MediaAttachment", + "MediaScoreSharingMode", + "MicrosoftGraphAssignment", + "MicrosoftGraphSubmission", + "OmrCapabilities", + "OmrDetailsStepData", + "OmrDetailsSubmission", + "OmrDetectedInstrument", + "OmrImportedMetadata", + "OmrInstrumentOverride", + "OmrJob", + "OmrJobCreation", + "OmrJobFileMetadata", + "OmrJobFileUpload", + "OmrJobFileUploadResult", + "OmrJobInputFile", + "OmrJobOutput", + "OmrJobProgress", + "OmrJobResult", + "OmrJobRetention", + "OmrJobStatus", + "OmrLocaleDetails", + "OmrPendingStep", + "OmrStepName", + "OrganizationInvitation", + "OrganizationInvitationCreation", + "OrganizationRoles", + "OrganizationUserAccessTokenCreation", + "RenameGroupRequest", + "ResourceCollaborator", + "ResourceCollaboratorCreation", + "ResourceRights", + "ScoreComment", + "ScoreCommentContext", + "ScoreCommentCreation", + "ScoreCommentModeration", + "ScoreCommentUpdate", + "ScoreCommentsCounts", + "ScoreCreation", + "ScoreCreationBuilderData", + "ScoreCreationBuilderDataAllOfBuilderData", + "ScoreCreationBuilderDataAllOfBuilderDataLayoutData", + "ScoreCreationBuilderDataAllOfBuilderDataScoreData", + "ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments", + "ScoreCreationCommon", + "ScoreCreationFileImport", + "ScoreCreationGoogleDriveImport", + "ScoreCreationType", + "ScoreDetails", + "ScoreDetailsAllOfMe", + "ScoreFork", + "ScoreLicense", + "ScoreLikesCounts", + "ScoreModification", + "ScorePlaysCounts", + "ScorePrivacy", + "ScoreRevision", + "ScoreRevisionCreation", + "ScoreRevisionStatistics", + "ScoreSource", + "ScoreSummary", + "ScoreTrack", + "ScoreTrackCreation", + "ScoreTrackCreationResponse", + "ScoreTrackPoint", + "ScoreTrackPurpose", + "ScoreTrackState", + "ScoreTrackType", + "ScoreTrackUpdate", + "ScoreViewsCounts", + "Task", + "TaskExportOptions", + "TaskProgress", + "TaskResult", + "TeachingTheme", + "TutteoProduct", + "UserAdminUpdate", + "UserAzureDetails", + "UserBasics", + "UserCommunityProfileLinks", + "UserCreation", + "UserDetails", + "UserDetailsAdmin", + "UserDetailsAdminAllOfLicense", + "UserPublic", + "UserPublicSummary", + "UserSigninLink", + "UserSigninLinkCreation", +] + +# import apis into sdk package +from flat_api.aio.api.account_api import AccountApi as AccountApi +from flat_api.aio.api.class_api import ClassApi as ClassApi +from flat_api.aio.api.collection_api import CollectionApi as CollectionApi +from flat_api.aio.api.edu_resources_api import EduResourcesApi as EduResourcesApi +from flat_api.aio.api.group_api import GroupApi as GroupApi +from flat_api.aio.api.omr_api import OMRApi as OMRApi +from flat_api.aio.api.organization_api import OrganizationApi as OrganizationApi +from flat_api.aio.api.score_api import ScoreApi as ScoreApi +from flat_api.aio.api.task_api import TaskApi as TaskApi +from flat_api.aio.api.user_api import UserApi as UserApi + +# import ApiClient +from flat_api.aio.api_response import ApiResponse as ApiResponse +from flat_api.aio.api_client import ApiClient as ApiClient +from flat_api.aio.configuration import Configuration as Configuration +from flat_api.aio.exceptions import OpenApiException as OpenApiException +from flat_api.aio.exceptions import ApiTypeError as ApiTypeError +from flat_api.aio.exceptions import ApiValueError as ApiValueError +from flat_api.aio.exceptions import ApiKeyError as ApiKeyError +from flat_api.aio.exceptions import ApiAttributeError as ApiAttributeError +from flat_api.aio.exceptions import ApiException as ApiException + +# import models into sdk package +from flat_api.aio.models.add_group_user200_response import AddGroupUser200Response as AddGroupUser200Response +from flat_api.aio.models.add_group_user_request import AddGroupUserRequest as AddGroupUserRequest +from flat_api.aio.models.api_access_token import ApiAccessToken as ApiAccessToken +from flat_api.aio.models.app_scopes import AppScopes as AppScopes +from flat_api.aio.models.assignment import Assignment as Assignment +from flat_api.aio.models.assignment_capabilities import AssignmentCapabilities as AssignmentCapabilities +from flat_api.aio.models.assignment_capabilities_can_publish_in_class_error import AssignmentCapabilitiesCanPublishInClassError as AssignmentCapabilitiesCanPublishInClassError +from flat_api.aio.models.assignment_copy import AssignmentCopy as AssignmentCopy +from flat_api.aio.models.assignment_copy_response import AssignmentCopyResponse as AssignmentCopyResponse +from flat_api.aio.models.assignment_copy_to_class import AssignmentCopyToClass as AssignmentCopyToClass +from flat_api.aio.models.assignment_copy_to_resource_library import AssignmentCopyToResourceLibrary as AssignmentCopyToResourceLibrary +from flat_api.aio.models.assignment_group import AssignmentGroup as AssignmentGroup +from flat_api.aio.models.assignment_submission import AssignmentSubmission as AssignmentSubmission +from flat_api.aio.models.assignment_submission_comment import AssignmentSubmissionComment as AssignmentSubmissionComment +from flat_api.aio.models.assignment_submission_comment_creation import AssignmentSubmissionCommentCreation as AssignmentSubmissionCommentCreation +from flat_api.aio.models.assignment_submission_comments import AssignmentSubmissionComments as AssignmentSubmissionComments +from flat_api.aio.models.assignment_submission_history import AssignmentSubmissionHistory as AssignmentSubmissionHistory +from flat_api.aio.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment as AssignmentSubmissionHistoryAttachment +from flat_api.aio.models.assignment_submission_history_state import AssignmentSubmissionHistoryState as AssignmentSubmissionHistoryState +from flat_api.aio.models.assignment_submission_lti import AssignmentSubmissionLti as AssignmentSubmissionLti +from flat_api.aio.models.assignment_submission_playback import AssignmentSubmissionPlayback as AssignmentSubmissionPlayback +from flat_api.aio.models.assignment_submission_state import AssignmentSubmissionState as AssignmentSubmissionState +from flat_api.aio.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode as AssignmentSubmissionStudentsMode +from flat_api.aio.models.assignment_submission_update import AssignmentSubmissionUpdate as AssignmentSubmissionUpdate +from flat_api.aio.models.assignment_type import AssignmentType as AssignmentType +from flat_api.aio.models.assignment_update import AssignmentUpdate as AssignmentUpdate +from flat_api.aio.models.class_assignment import ClassAssignment as ClassAssignment +from flat_api.aio.models.class_assignment_all_of_canvas import ClassAssignmentAllOfCanvas as ClassAssignmentAllOfCanvas +from flat_api.aio.models.class_assignment_all_of_lti import ClassAssignmentAllOfLti as ClassAssignmentAllOfLti +from flat_api.aio.models.class_assignment_all_of_mfc import ClassAssignmentAllOfMfc as ClassAssignmentAllOfMfc +from flat_api.aio.models.class_assignment_update import ClassAssignmentUpdate as ClassAssignmentUpdate +from flat_api.aio.models.class_assignment_update_all_of_google_classroom import ClassAssignmentUpdateAllOfGoogleClassroom as ClassAssignmentUpdateAllOfGoogleClassroom +from flat_api.aio.models.class_assignment_update_all_of_microsoft_graph import ClassAssignmentUpdateAllOfMicrosoftGraph as ClassAssignmentUpdateAllOfMicrosoftGraph +from flat_api.aio.models.class_attachment_creation import ClassAttachmentCreation as ClassAttachmentCreation +from flat_api.aio.models.class_creation import ClassCreation as ClassCreation +from flat_api.aio.models.class_details import ClassDetails as ClassDetails +from flat_api.aio.models.class_details_canvas import ClassDetailsCanvas as ClassDetailsCanvas +from flat_api.aio.models.class_details_clever import ClassDetailsClever as ClassDetailsClever +from flat_api.aio.models.class_details_google_classroom import ClassDetailsGoogleClassroom as ClassDetailsGoogleClassroom +from flat_api.aio.models.class_details_google_drive import ClassDetailsGoogleDrive as ClassDetailsGoogleDrive +from flat_api.aio.models.class_details_issues import ClassDetailsIssues as ClassDetailsIssues +from flat_api.aio.models.class_details_issues_sync_inner import ClassDetailsIssuesSyncInner as ClassDetailsIssuesSyncInner +from flat_api.aio.models.class_details_lti import ClassDetailsLti as ClassDetailsLti +from flat_api.aio.models.class_details_mfc import ClassDetailsMfc as ClassDetailsMfc +from flat_api.aio.models.class_details_microsoft_graph import ClassDetailsMicrosoftGraph as ClassDetailsMicrosoftGraph +from flat_api.aio.models.class_grade_level import ClassGradeLevel as ClassGradeLevel +from flat_api.aio.models.class_roles import ClassRoles as ClassRoles +from flat_api.aio.models.class_state import ClassState as ClassState +from flat_api.aio.models.class_update import ClassUpdate as ClassUpdate +from flat_api.aio.models.collection import Collection as Collection +from flat_api.aio.models.collection_app import CollectionApp as CollectionApp +from flat_api.aio.models.collection_capabilities import CollectionCapabilities as CollectionCapabilities +from flat_api.aio.models.collection_contents import CollectionContents as CollectionContents +from flat_api.aio.models.collection_creation import CollectionCreation as CollectionCreation +from flat_api.aio.models.collection_modification import CollectionModification as CollectionModification +from flat_api.aio.models.collection_privacy import CollectionPrivacy as CollectionPrivacy +from flat_api.aio.models.collection_type import CollectionType as CollectionType +from flat_api.aio.models.create_lti_configuration200_response import CreateLtiConfiguration200Response as CreateLtiConfiguration200Response +from flat_api.aio.models.credit_transaction import CreditTransaction as CreditTransaction +from flat_api.aio.models.edu_library import EduLibrary as EduLibrary +from flat_api.aio.models.edu_resource import EduResource as EduResource +from flat_api.aio.models.edu_resource_assignment_creation import EduResourceAssignmentCreation as EduResourceAssignmentCreation +from flat_api.aio.models.edu_resource_capabilities import EduResourceCapabilities as EduResourceCapabilities +from flat_api.aio.models.edu_resource_copy import EduResourceCopy as EduResourceCopy +from flat_api.aio.models.edu_resource_creation import EduResourceCreation as EduResourceCreation +from flat_api.aio.models.edu_resource_folder import EduResourceFolder as EduResourceFolder +from flat_api.aio.models.edu_resource_lti_link import EduResourceLtiLink as EduResourceLtiLink +from flat_api.aio.models.edu_resource_move import EduResourceMove as EduResourceMove +from flat_api.aio.models.edu_resource_privacy import EduResourcePrivacy as EduResourcePrivacy +from flat_api.aio.models.edu_resource_resource import EduResourceResource as EduResourceResource +from flat_api.aio.models.edu_resource_type import EduResourceType as EduResourceType +from flat_api.aio.models.edu_resource_update import EduResourceUpdate as EduResourceUpdate +from flat_api.aio.models.edu_resource_use_in_class import EduResourceUseInClass as EduResourceUseInClass +from flat_api.aio.models.flat_error_response import FlatErrorResponse as FlatErrorResponse +from flat_api.aio.models.google_classroom_coursework import GoogleClassroomCoursework as GoogleClassroomCoursework +from flat_api.aio.models.google_classroom_submission import GoogleClassroomSubmission as GoogleClassroomSubmission +from flat_api.aio.models.grade import Grade as Grade +from flat_api.aio.models.group import Group as Group +from flat_api.aio.models.group_creation import GroupCreation as GroupCreation +from flat_api.aio.models.group_details import GroupDetails as GroupDetails +from flat_api.aio.models.group_type import GroupType as GroupType +from flat_api.aio.models.license_mode import LicenseMode as LicenseMode +from flat_api.aio.models.license_sources import LicenseSources as LicenseSources +from flat_api.aio.models.lms_name import LmsName as LmsName +from flat_api.aio.models.lti_configuration import LtiConfiguration as LtiConfiguration +from flat_api.aio.models.lti_configuration1p1 import LtiConfiguration1p1 as LtiConfiguration1p1 +from flat_api.aio.models.lti_configuration1p1_all_of_tool import LtiConfiguration1p1AllOfTool as LtiConfiguration1p1AllOfTool +from flat_api.aio.models.lti_configuration1p3 import LtiConfiguration1p3 as LtiConfiguration1p3 +from flat_api.aio.models.lti_configuration1p3_base import LtiConfiguration1p3Base as LtiConfiguration1p3Base +from flat_api.aio.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices as LtiConfiguration1p3BaseSupportedServices +from flat_api.aio.models.lti_configuration1p3_base_supported_services_ags import LtiConfiguration1p3BaseSupportedServicesAgs as LtiConfiguration1p3BaseSupportedServicesAgs +from flat_api.aio.models.lti_configuration1p3_base_supported_services_deep_linking import LtiConfiguration1p3BaseSupportedServicesDeepLinking as LtiConfiguration1p3BaseSupportedServicesDeepLinking +from flat_api.aio.models.lti_configuration1p3_base_supported_services_nrps import LtiConfiguration1p3BaseSupportedServicesNrps as LtiConfiguration1p3BaseSupportedServicesNrps +from flat_api.aio.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool as LtiConfiguration1p3BaseTool +from flat_api.aio.models.lti_configuration1p3_deployment import LtiConfiguration1p3Deployment as LtiConfiguration1p3Deployment +from flat_api.aio.models.lti_configuration1p3_dynamic import LtiConfiguration1p3Dynamic as LtiConfiguration1p3Dynamic +from flat_api.aio.models.lti_configuration1p3_manual import LtiConfiguration1p3Manual as LtiConfiguration1p3Manual +from flat_api.aio.models.lti_configuration_base import LtiConfigurationBase as LtiConfigurationBase +from flat_api.aio.models.lti_configuration_create import LtiConfigurationCreate as LtiConfigurationCreate +from flat_api.aio.models.lti_configuration_create1p1 import LtiConfigurationCreate1p1 as LtiConfigurationCreate1p1 +from flat_api.aio.models.lti_configuration_create1p3_deployment import LtiConfigurationCreate1p3Deployment as LtiConfigurationCreate1p3Deployment +from flat_api.aio.models.lti_configuration_create1p3_dynamic import LtiConfigurationCreate1p3Dynamic as LtiConfigurationCreate1p3Dynamic +from flat_api.aio.models.lti_configuration_create1p3_dynamic_platform_info import LtiConfigurationCreate1p3DynamicPlatformInfo as LtiConfigurationCreate1p3DynamicPlatformInfo +from flat_api.aio.models.lti_configuration_create1p3_manual import LtiConfigurationCreate1p3Manual as LtiConfigurationCreate1p3Manual +from flat_api.aio.models.lti_configuration_update import LtiConfigurationUpdate as LtiConfigurationUpdate +from flat_api.aio.models.lti_configuration_update_deployment import LtiConfigurationUpdateDeployment as LtiConfigurationUpdateDeployment +from flat_api.aio.models.lti_configuration_update_standalone import LtiConfigurationUpdateStandalone as LtiConfigurationUpdateStandalone +from flat_api.aio.models.lti_credentials import LtiCredentials as LtiCredentials +from flat_api.aio.models.lti_credentials_creation import LtiCredentialsCreation as LtiCredentialsCreation +from flat_api.aio.models.media_attachment import MediaAttachment as MediaAttachment +from flat_api.aio.models.media_score_sharing_mode import MediaScoreSharingMode as MediaScoreSharingMode +from flat_api.aio.models.microsoft_graph_assignment import MicrosoftGraphAssignment as MicrosoftGraphAssignment +from flat_api.aio.models.microsoft_graph_submission import MicrosoftGraphSubmission as MicrosoftGraphSubmission +from flat_api.aio.models.omr_capabilities import OmrCapabilities as OmrCapabilities +from flat_api.aio.models.omr_details_step_data import OmrDetailsStepData as OmrDetailsStepData +from flat_api.aio.models.omr_details_submission import OmrDetailsSubmission as OmrDetailsSubmission +from flat_api.aio.models.omr_detected_instrument import OmrDetectedInstrument as OmrDetectedInstrument +from flat_api.aio.models.omr_imported_metadata import OmrImportedMetadata as OmrImportedMetadata +from flat_api.aio.models.omr_instrument_override import OmrInstrumentOverride as OmrInstrumentOverride +from flat_api.aio.models.omr_job import OmrJob as OmrJob +from flat_api.aio.models.omr_job_creation import OmrJobCreation as OmrJobCreation +from flat_api.aio.models.omr_job_file_metadata import OmrJobFileMetadata as OmrJobFileMetadata +from flat_api.aio.models.omr_job_file_upload import OmrJobFileUpload as OmrJobFileUpload +from flat_api.aio.models.omr_job_file_upload_result import OmrJobFileUploadResult as OmrJobFileUploadResult +from flat_api.aio.models.omr_job_input_file import OmrJobInputFile as OmrJobInputFile +from flat_api.aio.models.omr_job_output import OmrJobOutput as OmrJobOutput +from flat_api.aio.models.omr_job_progress import OmrJobProgress as OmrJobProgress +from flat_api.aio.models.omr_job_result import OmrJobResult as OmrJobResult +from flat_api.aio.models.omr_job_retention import OmrJobRetention as OmrJobRetention +from flat_api.aio.models.omr_job_status import OmrJobStatus as OmrJobStatus +from flat_api.aio.models.omr_locale_details import OmrLocaleDetails as OmrLocaleDetails +from flat_api.aio.models.omr_pending_step import OmrPendingStep as OmrPendingStep +from flat_api.aio.models.omr_step_name import OmrStepName as OmrStepName +from flat_api.aio.models.organization_invitation import OrganizationInvitation as OrganizationInvitation +from flat_api.aio.models.organization_invitation_creation import OrganizationInvitationCreation as OrganizationInvitationCreation +from flat_api.aio.models.organization_roles import OrganizationRoles as OrganizationRoles +from flat_api.aio.models.organization_user_access_token_creation import OrganizationUserAccessTokenCreation as OrganizationUserAccessTokenCreation +from flat_api.aio.models.rename_group_request import RenameGroupRequest as RenameGroupRequest +from flat_api.aio.models.resource_collaborator import ResourceCollaborator as ResourceCollaborator +from flat_api.aio.models.resource_collaborator_creation import ResourceCollaboratorCreation as ResourceCollaboratorCreation +from flat_api.aio.models.resource_rights import ResourceRights as ResourceRights +from flat_api.aio.models.score_comment import ScoreComment as ScoreComment +from flat_api.aio.models.score_comment_context import ScoreCommentContext as ScoreCommentContext +from flat_api.aio.models.score_comment_creation import ScoreCommentCreation as ScoreCommentCreation +from flat_api.aio.models.score_comment_moderation import ScoreCommentModeration as ScoreCommentModeration +from flat_api.aio.models.score_comment_update import ScoreCommentUpdate as ScoreCommentUpdate +from flat_api.aio.models.score_comments_counts import ScoreCommentsCounts as ScoreCommentsCounts +from flat_api.aio.models.score_creation import ScoreCreation as ScoreCreation +from flat_api.aio.models.score_creation_builder_data import ScoreCreationBuilderData as ScoreCreationBuilderData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data import ScoreCreationBuilderDataAllOfBuilderData as ScoreCreationBuilderDataAllOfBuilderData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_layout_data import ScoreCreationBuilderDataAllOfBuilderDataLayoutData as ScoreCreationBuilderDataAllOfBuilderDataLayoutData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_score_data import ScoreCreationBuilderDataAllOfBuilderDataScoreData as ScoreCreationBuilderDataAllOfBuilderDataScoreData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_score_data_instruments import ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments as ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments +from flat_api.aio.models.score_creation_common import ScoreCreationCommon as ScoreCreationCommon +from flat_api.aio.models.score_creation_file_import import ScoreCreationFileImport as ScoreCreationFileImport +from flat_api.aio.models.score_creation_google_drive_import import ScoreCreationGoogleDriveImport as ScoreCreationGoogleDriveImport +from flat_api.aio.models.score_creation_type import ScoreCreationType as ScoreCreationType +from flat_api.aio.models.score_details import ScoreDetails as ScoreDetails +from flat_api.aio.models.score_details_all_of_me import ScoreDetailsAllOfMe as ScoreDetailsAllOfMe +from flat_api.aio.models.score_fork import ScoreFork as ScoreFork +from flat_api.aio.models.score_license import ScoreLicense as ScoreLicense +from flat_api.aio.models.score_likes_counts import ScoreLikesCounts as ScoreLikesCounts +from flat_api.aio.models.score_modification import ScoreModification as ScoreModification +from flat_api.aio.models.score_plays_counts import ScorePlaysCounts as ScorePlaysCounts +from flat_api.aio.models.score_privacy import ScorePrivacy as ScorePrivacy +from flat_api.aio.models.score_revision import ScoreRevision as ScoreRevision +from flat_api.aio.models.score_revision_creation import ScoreRevisionCreation as ScoreRevisionCreation +from flat_api.aio.models.score_revision_statistics import ScoreRevisionStatistics as ScoreRevisionStatistics +from flat_api.aio.models.score_source import ScoreSource as ScoreSource +from flat_api.aio.models.score_summary import ScoreSummary as ScoreSummary +from flat_api.aio.models.score_track import ScoreTrack as ScoreTrack +from flat_api.aio.models.score_track_creation import ScoreTrackCreation as ScoreTrackCreation +from flat_api.aio.models.score_track_creation_response import ScoreTrackCreationResponse as ScoreTrackCreationResponse +from flat_api.aio.models.score_track_point import ScoreTrackPoint as ScoreTrackPoint +from flat_api.aio.models.score_track_purpose import ScoreTrackPurpose as ScoreTrackPurpose +from flat_api.aio.models.score_track_state import ScoreTrackState as ScoreTrackState +from flat_api.aio.models.score_track_type import ScoreTrackType as ScoreTrackType +from flat_api.aio.models.score_track_update import ScoreTrackUpdate as ScoreTrackUpdate +from flat_api.aio.models.score_views_counts import ScoreViewsCounts as ScoreViewsCounts +from flat_api.aio.models.task import Task as Task +from flat_api.aio.models.task_export_options import TaskExportOptions as TaskExportOptions +from flat_api.aio.models.task_progress import TaskProgress as TaskProgress +from flat_api.aio.models.task_result import TaskResult as TaskResult +from flat_api.aio.models.teaching_theme import TeachingTheme as TeachingTheme +from flat_api.aio.models.tutteo_product import TutteoProduct as TutteoProduct +from flat_api.aio.models.user_admin_update import UserAdminUpdate as UserAdminUpdate +from flat_api.aio.models.user_azure_details import UserAzureDetails as UserAzureDetails +from flat_api.aio.models.user_basics import UserBasics as UserBasics +from flat_api.aio.models.user_community_profile_links import UserCommunityProfileLinks as UserCommunityProfileLinks +from flat_api.aio.models.user_creation import UserCreation as UserCreation +from flat_api.aio.models.user_details import UserDetails as UserDetails +from flat_api.aio.models.user_details_admin import UserDetailsAdmin as UserDetailsAdmin +from flat_api.aio.models.user_details_admin_all_of_license import UserDetailsAdminAllOfLicense as UserDetailsAdminAllOfLicense +from flat_api.aio.models.user_public import UserPublic as UserPublic +from flat_api.aio.models.user_public_summary import UserPublicSummary as UserPublicSummary +from flat_api.aio.models.user_signin_link import UserSigninLink as UserSigninLink +from flat_api.aio.models.user_signin_link_creation import UserSigninLinkCreation as UserSigninLinkCreation + diff --git a/flat_api/aio/api/__init__.py b/flat_api/aio/api/__init__.py new file mode 100644 index 0000000..de44471 --- /dev/null +++ b/flat_api/aio/api/__init__.py @@ -0,0 +1,14 @@ +# flake8: noqa + +# import apis into api package +from flat_api.aio.api.account_api import AccountApi +from flat_api.aio.api.class_api import ClassApi +from flat_api.aio.api.collection_api import CollectionApi +from flat_api.aio.api.edu_resources_api import EduResourcesApi +from flat_api.aio.api.group_api import GroupApi +from flat_api.aio.api.omr_api import OMRApi +from flat_api.aio.api.organization_api import OrganizationApi +from flat_api.aio.api.score_api import ScoreApi +from flat_api.aio.api.task_api import TaskApi +from flat_api.aio.api.user_api import UserApi + diff --git a/flat_api/aio/api/account_api.py b/flat_api/aio/api/account_api.py new file mode 100644 index 0000000..0383108 --- /dev/null +++ b/flat_api/aio/api/account_api.py @@ -0,0 +1,305 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool +from typing import Optional +from typing_extensions import Annotated +from flat_api.aio.models.user_details import UserDetails + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class AccountApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def get_authenticated_user( + self, + only_id: Annotated[Optional[StrictBool], Field(description="Only return the user id")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserDetails: + """Get current user account + + Get details about the current authenticated User. + + :param only_id: Only return the user id + :type only_id: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_authenticated_user_serialize( + only_id=only_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_authenticated_user_with_http_info( + self, + only_id: Annotated[Optional[StrictBool], Field(description="Only return the user id")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserDetails]: + """Get current user account + + Get details about the current authenticated User. + + :param only_id: Only return the user id + :type only_id: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_authenticated_user_serialize( + only_id=only_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_authenticated_user_without_preload_content( + self, + only_id: Annotated[Optional[StrictBool], Field(description="Only return the user id")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get current user account + + Get details about the current authenticated User. + + :param only_id: Only return the user id + :type only_id: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_authenticated_user_serialize( + only_id=only_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_authenticated_user_serialize( + self, + only_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if only_id is not None: + + _query_params.append(('onlyId', only_id)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/me', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/class_api.py b/flat_api/aio/api/class_api.py new file mode 100644 index 0000000..c7771c8 --- /dev/null +++ b/flat_api/aio/api/class_api.py @@ -0,0 +1,9485 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator +from typing import List, Optional, Tuple, Union +from typing_extensions import Annotated +from flat_api.aio.models.assignment import Assignment +from flat_api.aio.models.assignment_copy import AssignmentCopy +from flat_api.aio.models.assignment_copy_response import AssignmentCopyResponse +from flat_api.aio.models.assignment_submission import AssignmentSubmission +from flat_api.aio.models.assignment_submission_comment import AssignmentSubmissionComment +from flat_api.aio.models.assignment_submission_comment_creation import AssignmentSubmissionCommentCreation +from flat_api.aio.models.assignment_submission_history import AssignmentSubmissionHistory +from flat_api.aio.models.assignment_submission_update import AssignmentSubmissionUpdate +from flat_api.aio.models.class_assignment import ClassAssignment +from flat_api.aio.models.class_assignment_update import ClassAssignmentUpdate +from flat_api.aio.models.class_creation import ClassCreation +from flat_api.aio.models.class_details import ClassDetails +from flat_api.aio.models.class_update import ClassUpdate +from flat_api.aio.models.user_details import UserDetails + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class ClassApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def activate_class( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Activate the class + + Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._activate_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def activate_class_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Activate the class + + Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._activate_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def activate_class_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Activate the class + + Mark the class as `active`. This is mainly used for classes synchronized from Clever that are initially with an `inactive` state and hidden in the UI. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._activate_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _activate_class_serialize( + self, + var_class, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/{class}/activate', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def add_class_user( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Add a user to the class + + This method can be used by a teacher of the class to enroll another Flat user into the class. Only users that are part of your Organization can be enrolled in a class of this same Organization. When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_class_user_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def add_class_user_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Add a user to the class + + This method can be used by a teacher of the class to enroll another Flat user into the class. Only users that are part of your Organization can be enrolled in a class of this same Organization. When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_class_user_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def add_class_user_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a user to the class + + This method can be used by a teacher of the class to enroll another Flat user into the class. Only users that are part of your Organization can be enrolled in a class of this same Organization. When enrolling a user in the class, Flat will automatically add this user to the corresponding Class group, based on this role in the Organization. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_class_user_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_class_user_serialize( + self, + var_class, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/classes/{class}/users/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def archive_assignment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Assignment: + """Archive the assignment + + Archive the assignment + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def archive_assignment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Assignment]: + """Archive the assignment + + Archive the assignment + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def archive_assignment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Archive the assignment + + Archive the assignment + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _archive_assignment_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/{class}/assignments/{assignment}/archive', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def archive_class( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Archive the class + + Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def archive_class_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Archive the class + + Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def archive_class_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Archive the class + + Mark the class as `archived`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _archive_class_serialize( + self, + var_class, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/{class}/archive', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def copy_assignment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: AssignmentCopy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignmentCopyResponse: + """Copy an assignment + + Copy an assignment to a specified class or the resource library For class assignments: - If the original assignment has a due date in the past, this new assignment will be created without a due date. - If the class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: AssignmentCopy + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_assignment_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentCopyResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def copy_assignment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: AssignmentCopy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentCopyResponse]: + """Copy an assignment + + Copy an assignment to a specified class or the resource library For class assignments: - If the original assignment has a due date in the past, this new assignment will be created without a due date. - If the class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: AssignmentCopy + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_assignment_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentCopyResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def copy_assignment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: AssignmentCopy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Copy an assignment + + Copy an assignment to a specified class or the resource library For class assignments: - If the original assignment has a due date in the past, this new assignment will be created without a due date. - If the class is synchronized with an external app (e.g. Google Classroom), the copied assignment will also be posted on the external app. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: AssignmentCopy + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_assignment_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentCopyResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _copy_assignment_serialize( + self, + var_class, + assignment, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/{class}/assignments/{assignment}/copy', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_class( + self, + body: ClassCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Create a new class + + Classrooms on Flat allow you to create activities with assignments and post content to a specific group. When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group. If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated. You can add users to this class using `PUT /classes/{class}/users/{user}`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/{enrollmentCode}` and the `enrollmentCode` returned in the `ClassDetails` response. + + :param body: (required) + :type body: ClassCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_class_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_class_with_http_info( + self, + body: ClassCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Create a new class + + Classrooms on Flat allow you to create activities with assignments and post content to a specific group. When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group. If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated. You can add users to this class using `PUT /classes/{class}/users/{user}`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/{enrollmentCode}` and the `enrollmentCode` returned in the `ClassDetails` response. + + :param body: (required) + :type body: ClassCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_class_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_class_without_preload_content( + self, + body: ClassCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new class + + Classrooms on Flat allow you to create activities with assignments and post content to a specific group. When creating a class, Flat automatically creates two groups: one for the teachers of the course, one for the students. The creator of this class is automatically added to the teachers group. If the classsroom is synchronized with another application like Google Classroom, some of the meta information will automatically be updated. You can add users to this class using `PUT /classes/{class}/users/{user}`, they will automatically added to the group based on their role on Flat. Users can also enroll themselves to this class using `POST /classes/enroll/{enrollmentCode}` and the `enrollmentCode` returned in the `ClassDetails` response. + + :param body: (required) + :type body: ClassCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_class_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_class_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_class_assignment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: ClassAssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Assignment: + """Assignment creation + + Use this method as a teacher to create and post a new assignment to a class. If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param body: (required) + :type body: ClassAssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_class_assignment_serialize( + var_class=var_class, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_class_assignment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: ClassAssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Assignment]: + """Assignment creation + + Use this method as a teacher to create and post a new assignment to a class. If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param body: (required) + :type body: ClassAssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_class_assignment_serialize( + var_class=var_class, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_class_assignment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: ClassAssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Assignment creation + + Use this method as a teacher to create and post a new assignment to a class. If the class is synchronized with Google Classroom, the assignment will be automatically posted to your Classroom course. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param body: (required) + :type body: ClassAssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_class_assignment_serialize( + var_class=var_class, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_class_assignment_serialize( + self, + var_class, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/{class}/assignments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_submission( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignmentSubmission: + """Create or edit a submission + + Use this method as a student to create, update and submit a submission related to an assignment. Students can only set `attachments` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_submission_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_submission_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentSubmission]: + """Create or edit a submission + + Use this method as a student to create, update and submit a submission related to an assignment. Students can only set `attachments` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_submission_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_submission_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create or edit a submission + + Use this method as a student to create, update and submit a submission related to an assignment. Students can only set `attachments` and `submit`. Teachers can use `PUT /classes/{class}/assignments/{assignment}/submissions/{submission}` to update a submission by id. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_submission_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_submission_serialize( + self, + var_class, + assignment, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/classes/{class}/assignments/{assignment}/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_test_student_account( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + reset: Annotated[Optional[StrictBool], Field(description="If true, the testing account will be re-created. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserDetails: + """Create a test student account + + Test students account can be created by teachers an admin and be used to experiment the assignments. - They are automatically added to the class. - They can be reset using this API endpoint (a new account will be created and the previous one scheduled for deletion). - These accounts don't use a user license. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param reset: If true, the testing account will be re-created. + :type reset: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_test_student_account_serialize( + var_class=var_class, + reset=reset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_test_student_account_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + reset: Annotated[Optional[StrictBool], Field(description="If true, the testing account will be re-created. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserDetails]: + """Create a test student account + + Test students account can be created by teachers an admin and be used to experiment the assignments. - They are automatically added to the class. - They can be reset using this API endpoint (a new account will be created and the previous one scheduled for deletion). - These accounts don't use a user license. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param reset: If true, the testing account will be re-created. + :type reset: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_test_student_account_serialize( + var_class=var_class, + reset=reset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_test_student_account_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + reset: Annotated[Optional[StrictBool], Field(description="If true, the testing account will be re-created. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a test student account + + Test students account can be created by teachers an admin and be used to experiment the assignments. - They are automatically added to the class. - They can be reset using this API endpoint (a new account will be created and the previous one scheduled for deletion). - These accounts don't use a user license. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param reset: If true, the testing account will be re-created. + :type reset: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_test_student_account_serialize( + var_class=var_class, + reset=reset, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_test_student_account_serialize( + self, + var_class, + reset, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + if reset is not None: + + _query_params.append(('reset', reset)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/{class}/testStudent', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_assignment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an assignment + + Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. `archiveAssignment` is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_assignment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an assignment + + Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. `archiveAssignment` is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_assignment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an assignment + + Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. `archiveAssignment` is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_assignment_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/classes/{class}/assignments/{assignment}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_class_user( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a user from the class + + This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_class_user_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_class_user_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a user from the class + + This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_class_user_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_class_user_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a user from the class + + This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_class_user_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_class_user_serialize( + self, + var_class, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/classes/{class}/users/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_submission( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignmentSubmission: + """Reset a submission + + Use this method as a teacher to reset a submission and allow student to start over the assignment + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_submission_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentSubmission]: + """Reset a submission + + Use this method as a teacher to reset a submission and allow student to start over the assignment + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_submission_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Reset a submission + + Use this method as a teacher to reset a submission and allow student to start over the assignment + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_submission_serialize( + self, + var_class, + assignment, + submission, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_submission_comment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param comment: Unique identifier of the comment (required) + :type comment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + comment=comment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_submission_comment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param comment: Unique identifier of the comment (required) + :type comment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + comment=comment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_submission_comment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param comment: Unique identifier of the comment (required) + :type comment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + comment=comment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_submission_comment_serialize( + self, + var_class, + assignment, + submission, + comment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + if comment is not None: + _path_params['comment'] = comment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def edit_submission( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignmentSubmission: + """Edit a submission + + Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def edit_submission_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentSubmission]: + """Edit a submission + + Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def edit_submission_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit a submission + + Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _edit_submission_serialize( + self, + var_class, + assignment, + submission, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def enroll_class( + self, + enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Join a class + + Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + + :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) + :type enrollment_code: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enroll_class_serialize( + enrollment_code=enrollment_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def enroll_class_with_http_info( + self, + enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Join a class + + Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + + :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) + :type enrollment_code: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enroll_class_serialize( + enrollment_code=enrollment_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def enroll_class_without_preload_content( + self, + enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Join a class + + Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + + :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) + :type enrollment_code: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enroll_class_serialize( + enrollment_code=enrollment_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _enroll_class_serialize( + self, + enrollment_code, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if enrollment_code is not None: + _path_params['enrollmentCode'] = enrollment_code + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/enroll/{enrollmentCode}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def export_submissions_reviews_as_csv( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """CSV Grades exports + + Export list of submissions grades to a CSV file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_csv_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def export_submissions_reviews_as_csv_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """CSV Grades exports + + Export list of submissions grades to a CSV file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_csv_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def export_submissions_reviews_as_csv_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CSV Grades exports + + Export list of submissions grades to a CSV file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_csv_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _export_submissions_reviews_as_csv_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/csv' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions/csv', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def export_submissions_reviews_as_excel( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Excel Grades exports + + Export list of submissions grades to an Excel file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_excel_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def export_submissions_reviews_as_excel_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Excel Grades exports + + Export list of submissions grades to an Excel file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_excel_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def export_submissions_reviews_as_excel_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Excel Grades exports + + Export list of submissions grades to an Excel file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_excel_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _export_submissions_reviews_as_excel_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions/excel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_assignment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Assignment: + """Get an assignment + + Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use `listAssignments` to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, `teacherInstructions` among them. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_assignment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Assignment]: + """Get an assignment + + Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use `listAssignments` to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, `teacherInstructions` among them. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_assignment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an assignment + + Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use `listAssignments` to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, `teacherInstructions` among them. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_assignment_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_class( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Get the details of a single class + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_class_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Get the details of a single class + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_class_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the details of a single class + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_class_serialize( + self, + var_class, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_submissions( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[AssignmentSubmission]: + """List submissions related to the score + + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_submissions_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_submissions_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[AssignmentSubmission]]: + """List submissions related to the score + + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_submissions_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_submissions_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List submissions related to the score + + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_submissions_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_submissions_serialize( + self, + score, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_submission( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignmentSubmission: + """Get a student submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_submission_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentSubmission]: + """Get a student submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_submission_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a student submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_submission_serialize( + self, + var_class, + assignment, + submission, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_submission_comments( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[AssignmentSubmissionComment]: + """List the feedback comments of a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_comments_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmissionComment]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_submission_comments_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[AssignmentSubmissionComment]]: + """List the feedback comments of a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_comments_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmissionComment]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_submission_comments_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the feedback comments of a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_comments_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmissionComment]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_submission_comments_serialize( + self, + var_class, + assignment, + submission, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_submission_history( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[AssignmentSubmissionHistory]: + """Get the history of the submission + + For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_history_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmissionHistory]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_submission_history_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[AssignmentSubmissionHistory]]: + """Get the history of the submission + + For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_history_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmissionHistory]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_submission_history_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get the history of the submission + + For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submission_history_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmissionHistory]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_submission_history_serialize( + self, + var_class, + assignment, + submission, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/history', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_submissions( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[AssignmentSubmission]: + """List the students' submissions + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submissions_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_submissions_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[AssignmentSubmission]]: + """List the students' submissions + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submissions_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_submissions_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the students' submissions + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_submissions_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_submissions_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_assignments( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ClassAssignment]: + """Assignments listing + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_assignments_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ClassAssignment]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_assignments_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ClassAssignment]]: + """Assignments listing + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_assignments_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ClassAssignment]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_assignments_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Assignments listing + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_assignments_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ClassAssignment]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_assignments_serialize( + self, + var_class, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_class_student_submissions( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[AssignmentSubmission]: + """List the submissions for a student + + Use this method as a teacher to list all the assignment submissions sent by a student of the class + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_class_student_submissions_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_class_student_submissions_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[AssignmentSubmission]]: + """List the submissions for a student + + Use this method as a teacher to list all the assignment submissions sent by a student of the class + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_class_student_submissions_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_class_student_submissions_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the submissions for a student + + Use this method as a teacher to list all the assignment submissions sent by a student of the class + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_class_student_submissions_serialize( + var_class=var_class, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_class_student_submissions_serialize( + self, + var_class, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/students/{user}/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_classes( + self, + state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ClassDetails]: + """List the classes available for the current user + + + :param state: Filter the classes by state + :type state: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_classes_serialize( + state=state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ClassDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_classes_with_http_info( + self, + state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ClassDetails]]: + """List the classes available for the current user + + + :param state: Filter the classes by state + :type state: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_classes_serialize( + state=state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ClassDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_classes_without_preload_content( + self, + state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the classes available for the current user + + + :param state: Filter the classes by state + :type state: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_classes_serialize( + state=state, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ClassDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_classes_serialize( + self, + state, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if state is not None: + + _query_params.append(('state', state)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def post_submission_comment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignmentSubmissionComment: + """Add a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + assignment_submission_comment_creation=assignment_submission_comment_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_submission_comment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentSubmissionComment]: + """Add a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + assignment_submission_comment_creation=assignment_submission_comment_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_submission_comment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + assignment_submission_comment_creation=assignment_submission_comment_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_submission_comment_serialize( + self, + var_class, + assignment, + submission, + assignment_submission_comment_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if assignment_submission_comment_creation is not None: + _body_params = assignment_submission_comment_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def unarchive_assignment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Assignment: + """Unarchive the assignment. + + Mark the assignment as `active`. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def unarchive_assignment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Assignment]: + """Unarchive the assignment. + + Mark the assignment as `active`. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def unarchive_assignment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unarchive the assignment. + + Mark the assignment as `active`. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_assignment_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unarchive_assignment_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/classes/{class}/assignments/{assignment}/archive', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def unarchive_class( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Unarchive the class + + Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def unarchive_class_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Unarchive the class + + Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def unarchive_class_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unarchive the class + + Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_class_serialize( + var_class=var_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _unarchive_class_serialize( + self, + var_class, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/classes/{class}/archive', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_class( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: Annotated[ClassUpdate, Field(description="Details of the Class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Update the class + + Update the meta information of the class + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param body: Details of the Class (required) + :type body: ClassUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_class_serialize( + var_class=var_class, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_class_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: Annotated[ClassUpdate, Field(description="Details of the Class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Update the class + + Update the meta information of the class + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param body: Details of the Class (required) + :type body: ClassUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_class_serialize( + var_class=var_class, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_class_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: Annotated[ClassUpdate, Field(description="Details of the Class")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update the class + + Update the meta information of the class + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param body: Details of the Class (required) + :type body: ClassUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_class_serialize( + var_class=var_class, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_class_serialize( + self, + var_class, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/classes/{class}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_class_assignment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: ClassAssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Assignment: + """Update an assignment + + Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. `attachments` is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already `active` cannot be moved back to `draft`. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use `archiveAssignment`. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: ClassAssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_class_assignment_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_class_assignment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: ClassAssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Assignment]: + """Update an assignment + + Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. `attachments` is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already `active` cannot be moved back to `draft`. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use `archiveAssignment`. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: ClassAssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_class_assignment_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_class_assignment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: ClassAssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an assignment + + Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. `attachments` is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already `active` cannot be moved back to `draft`. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use `archiveAssignment`. + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: ClassAssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_class_assignment_serialize( + var_class=var_class, + assignment=assignment, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_class_assignment_serialize( + self, + var_class, + assignment, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/classes/{class}/assignments/{assignment}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_submission_comment( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AssignmentSubmissionComment: + """Update a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param comment: Unique identifier of the comment (required) + :type comment: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + comment=comment, + assignment_submission_comment_creation=assignment_submission_comment_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_submission_comment_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentSubmissionComment]: + """Update a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param comment: Unique identifier of the comment (required) + :type comment: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + comment=comment, + assignment_submission_comment_creation=assignment_submission_comment_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_submission_comment_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a feedback comment to a submission + + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param comment: Unique identifier of the comment (required) + :type comment: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + comment=comment, + assignment_submission_comment_creation=assignment_submission_comment_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_submission_comment_serialize( + self, + var_class, + assignment, + submission, + comment, + assignment_submission_comment_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + if comment is not None: + _path_params['comment'] = comment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if assignment_submission_comment_creation is not None: + _body_params = assignment_submission_comment_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/collection_api.py b/flat_api/aio/api/collection_api.py new file mode 100644 index 0000000..fc23944 --- /dev/null +++ b/flat_api/aio/api/collection_api.py @@ -0,0 +1,2803 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.collection import Collection +from flat_api.aio.models.collection_creation import CollectionCreation +from flat_api.aio.models.collection_modification import CollectionModification +from flat_api.aio.models.flat_error_response import FlatErrorResponse +from flat_api.aio.models.score_details import ScoreDetails + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class CollectionApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def add_score_to_collection( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreDetails: + """Add a score to the collection + + This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) + :type collection: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_to_collection_serialize( + collection=collection, + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def add_score_to_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreDetails]: + """Add a score to the collection + + This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) + :type collection: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_to_collection_serialize( + collection=collection, + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def add_score_to_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a score to the collection + + This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) + :type collection: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_to_collection_serialize( + collection=collection, + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_score_to_collection_serialize( + self, + collection, + score, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + if score is not None: + _path_params['score'] = score + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/collections/{collection}/scores/{score}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_collection( + self, + body: CollectionCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Collection: + """Create a new collection + + This method will create a new collection in your account. + + :param body: (required) + :type body: CollectionCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_collection_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_collection_with_http_info( + self, + body: CollectionCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Collection]: + """Create a new collection + + This method will create a new collection in your account. + + :param body: (required) + :type body: CollectionCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_collection_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_collection_without_preload_content( + self, + body: CollectionCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new collection + + This method will create a new collection in your account. + + :param body: (required) + :type body: CollectionCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_collection_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_collection_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/collections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_collection( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete the collection + + This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete the collection + + This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete the collection + + This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_collection_serialize( + self, + collection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/collections/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_score_from_collection( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a score from the collection + + This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) + :type collection: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_from_collection_serialize( + collection=collection, + score=score, + event_properties=event_properties, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_score_from_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a score from the collection + + This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) + :type collection: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_from_collection_serialize( + collection=collection, + score=score, + event_properties=event_properties, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_score_from_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a score from the collection + + This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) + :type collection: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_from_collection_serialize( + collection=collection, + score=score, + event_properties=event_properties, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_score_from_collection_serialize( + self, + collection, + score, + event_properties, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + if score is not None: + _path_params['score'] = score + # process the query parameters + if event_properties is not None: + + _query_params.append(('eventProperties', event_properties)) + + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/collections/{collection}/scores/{score}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def edit_collection( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + body: CollectionModification, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Collection: + """Update a collection's metadata + + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param body: (required) + :type body: CollectionModification + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_collection_serialize( + collection=collection, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def edit_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + body: CollectionModification, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Collection]: + """Update a collection's metadata + + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param body: (required) + :type body: CollectionModification + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_collection_serialize( + collection=collection, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def edit_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + body: CollectionModification, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a collection's metadata + + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param body: (required) + :type body: CollectionModification + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_collection_serialize( + collection=collection, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _edit_collection_serialize( + self, + collection, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/collections/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_collection( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Collection: + """Get collection details + + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_collection_serialize( + collection=collection, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Collection]: + """Get collection details + + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_collection_serialize( + collection=collection, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get collection details + + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_collection_serialize( + collection=collection, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Collection", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_collection_serialize( + self, + collection, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/collections/{collection}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_collection_scores( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List the scores contained in a collection + + Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`. For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_collection_scores_serialize( + collection=collection, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_collection_scores_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List the scores contained in a collection + + Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`. For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_collection_scores_serialize( + collection=collection, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_collection_scores_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the scores contained in a collection + + Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`. For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. + + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) + :type collection: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_collection_scores_serialize( + collection=collection, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_collection_scores_serialize( + self, + collection, + sort, + direction, + limit, + next, + previous, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/collections/{collection}/scores', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_collections( + self, + parent: Annotated[Optional[StrictStr], Field(description="List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[Collection]: + """List the collections + + Use this method to list the user's collections. If no sort option is provided, the collections are sorted by `creationDate` `desc`. By default (`parent=user`), this returns all user account collections with virtual collections on the first page. To fetch your app collection details, you can use `GET /v2/collections/app`. + + :param parent: List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. + :type parent: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_collections_serialize( + parent=parent, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Collection]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_collections_with_http_info( + self, + parent: Annotated[Optional[StrictStr], Field(description="List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[Collection]]: + """List the collections + + Use this method to list the user's collections. If no sort option is provided, the collections are sorted by `creationDate` `desc`. By default (`parent=user`), this returns all user account collections with virtual collections on the first page. To fetch your app collection details, you can use `GET /v2/collections/app`. + + :param parent: List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. + :type parent: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_collections_serialize( + parent=parent, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Collection]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_collections_without_preload_content( + self, + parent: Annotated[Optional[StrictStr], Field(description="List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the collections + + Use this method to list the user's collections. If no sort option is provided, the collections are sorted by `creationDate` `desc`. By default (`parent=user`), this returns all user account collections with virtual collections on the first page. To fetch your app collection details, you can use `GET /v2/collections/app`. + + :param parent: List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. + :type parent: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_collections_serialize( + parent=parent, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[Collection]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_collections_serialize( + self, + parent, + sort, + direction, + limit, + next, + previous, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if parent is not None: + + _query_params.append(('parent', parent)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/collections', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def untrash_collection( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> FlatErrorResponse: + """(Deprecated) Untrash a collection + + **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + + :param collection: Unique identifier of the collection. (required) + :type collection: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /collections/{collection}/untrash is deprecated.", DeprecationWarning) + + _param = self._untrash_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def untrash_collection_with_http_info( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[FlatErrorResponse]: + """(Deprecated) Untrash a collection + + **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + + :param collection: Unique identifier of the collection. (required) + :type collection: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /collections/{collection}/untrash is deprecated.", DeprecationWarning) + + _param = self._untrash_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def untrash_collection_without_preload_content( + self, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Untrash a collection + + **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + + :param collection: Unique identifier of the collection. (required) + :type collection: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /collections/{collection}/untrash is deprecated.", DeprecationWarning) + + _param = self._untrash_collection_serialize( + collection=collection, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _untrash_collection_serialize( + self, + collection, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if collection is not None: + _path_params['collection'] = collection + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/collections/{collection}/untrash', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/edu_resources_api.py b/flat_api/aio/api/edu_resources_api.py new file mode 100644 index 0000000..9aa3c3c --- /dev/null +++ b/flat_api/aio/api/edu_resources_api.py @@ -0,0 +1,3509 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.assignment import Assignment +from flat_api.aio.models.assignment_type import AssignmentType +from flat_api.aio.models.assignment_update import AssignmentUpdate +from flat_api.aio.models.class_assignment import ClassAssignment +from flat_api.aio.models.edu_library import EduLibrary +from flat_api.aio.models.edu_resource import EduResource +from flat_api.aio.models.edu_resource_copy import EduResourceCopy +from flat_api.aio.models.edu_resource_creation import EduResourceCreation +from flat_api.aio.models.edu_resource_lti_link import EduResourceLtiLink +from flat_api.aio.models.edu_resource_move import EduResourceMove +from flat_api.aio.models.edu_resource_update import EduResourceUpdate +from flat_api.aio.models.edu_resource_use_in_class import EduResourceUseInClass +from flat_api.aio.models.grade import Grade +from flat_api.aio.models.teaching_theme import TeachingTheme + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class EduResourcesApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def copy_edu_resource( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_copy: EduResourceCopy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EduResource: + """Copy an education resource to a Resource Library + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_copy: (required) + :type edu_resource_copy: EduResourceCopy + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_edu_resource_serialize( + resource=resource, + edu_resource_copy=edu_resource_copy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def copy_edu_resource_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_copy: EduResourceCopy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EduResource]: + """Copy an education resource to a Resource Library + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_copy: (required) + :type edu_resource_copy: EduResourceCopy + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_edu_resource_serialize( + resource=resource, + edu_resource_copy=edu_resource_copy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def copy_edu_resource_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_copy: EduResourceCopy, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Copy an education resource to a Resource Library + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_copy: (required) + :type edu_resource_copy: EduResourceCopy + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_edu_resource_serialize( + resource=resource, + edu_resource_copy=edu_resource_copy, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _copy_edu_resource_serialize( + self, + resource, + edu_resource_copy, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if edu_resource_copy is not None: + _body_params = edu_resource_copy + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/eduResources/{resource}/copy', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def copy_edu_resource_to_demo_class( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassAssignment: + """Copy an education assignment to a teacher demo class + + Once a resource library can be published to a class (`Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature \"View as student\". It will ensure the teacher has a demo class, then copy the assignment to the demo class. You can then use `POST /classes/{class}/testStudent` to create a testing student account in the demo class. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_edu_resource_to_demo_class_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassAssignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def copy_edu_resource_to_demo_class_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassAssignment]: + """Copy an education assignment to a teacher demo class + + Once a resource library can be published to a class (`Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature \"View as student\". It will ensure the teacher has a demo class, then copy the assignment to the demo class. You can then use `POST /classes/{class}/testStudent` to create a testing student account in the demo class. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_edu_resource_to_demo_class_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassAssignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def copy_edu_resource_to_demo_class_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Copy an education assignment to a teacher demo class + + Once a resource library can be published to a class (`Assignment.capabilities.canPublishInClass = true`), this endpoint can be used for the feature \"View as student\". It will ensure the teacher has a demo class, then copy the assignment to the demo class. You can then use `POST /classes/{class}/testStudent` to create a testing student account in the demo class. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._copy_edu_resource_to_demo_class_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassAssignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _copy_edu_resource_to_demo_class_serialize( + self, + resource, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/eduResources/{resource}/copyToDemoClass', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_edu_resource( + self, + edu_resource_creation: EduResourceCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EduResource: + """Create a new education resource + + + :param edu_resource_creation: (required) + :type edu_resource_creation: EduResourceCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_edu_resource_serialize( + edu_resource_creation=edu_resource_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_edu_resource_with_http_info( + self, + edu_resource_creation: EduResourceCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EduResource]: + """Create a new education resource + + + :param edu_resource_creation: (required) + :type edu_resource_creation: EduResourceCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_edu_resource_serialize( + edu_resource_creation=edu_resource_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_edu_resource_without_preload_content( + self, + edu_resource_creation: EduResourceCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new education resource + + + :param edu_resource_creation: (required) + :type edu_resource_creation: EduResourceCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_edu_resource_serialize( + edu_resource_creation=edu_resource_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_edu_resource_serialize( + self, + edu_resource_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if edu_resource_creation is not None: + _body_params = edu_resource_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/eduResources', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_edu_resource_lti_link( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EduResourceLtiLink: + """Create an LTI link for an education resource + + This endpoint will return an LTI link that can be used to launch Flat for Education. The link, in a context from a class, will ensure the assignment has been copied in the class. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_edu_resource_lti_link_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResourceLtiLink", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_edu_resource_lti_link_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EduResourceLtiLink]: + """Create an LTI link for an education resource + + This endpoint will return an LTI link that can be used to launch Flat for Education. The link, in a context from a class, will ensure the assignment has been copied in the class. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_edu_resource_lti_link_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResourceLtiLink", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_edu_resource_lti_link_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an LTI link for an education resource + + This endpoint will return an LTI link that can be used to launch Flat for Education. The link, in a context from a class, will ensure the assignment has been copied in the class. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_edu_resource_lti_link_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResourceLtiLink", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_edu_resource_lti_link_serialize( + self, + resource, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/eduResources/{resource}/createLtiLink', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_edu_resource( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_edu_resource_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_edu_resource_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_edu_resource_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_edu_resource_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_edu_resource_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_edu_resource_serialize( + self, + resource, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/eduResources/{resource}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_edu_resource( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EduResource: + """Get an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_edu_resource_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_edu_resource_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EduResource]: + """Get an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_edu_resource_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_edu_resource_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_edu_resource_serialize( + resource=resource, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_edu_resource_serialize( + self, + resource, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/eduResources/{resource}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_edu_libraries( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[EduLibrary]: + """List the education libraries + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_edu_libraries_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[EduLibrary]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_edu_libraries_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[EduLibrary]]: + """List the education libraries + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_edu_libraries_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[EduLibrary]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_edu_libraries_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the education libraries + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_edu_libraries_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[EduLibrary]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_edu_libraries_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/eduResources/libraries', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_edu_resources( + self, + parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization ")] = None, + without_subfolders_resources: Annotated[Optional[StrictBool], Field(description="For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. ")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter the returned resources by type ")] = None, + subjects: Annotated[Optional[List[TeachingTheme]], Field(description="Filter the returned resources by subjects ")] = None, + assignment_types: Annotated[Optional[List[AssignmentType]], Field(description="Filter the returned resources by assignment types ")] = None, + grades: Annotated[Optional[List[Grade]], Field(description="Filter the returned resources by grades ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of resources that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[EduResource]: + """List education resources in a library or folder + + + :param parent: List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization + :type parent: str + :param without_subfolders_resources: For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. + :type without_subfolders_resources: bool + :param type: Filter the returned resources by type + :type type: str + :param subjects: Filter the returned resources by subjects + :type subjects: List[TeachingTheme] + :param assignment_types: Filter the returned resources by assignment types + :type assignment_types: List[AssignmentType] + :param grades: Filter the returned resources by grades + :type grades: List[Grade] + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of resources that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_edu_resources_serialize( + parent=parent, + without_subfolders_resources=without_subfolders_resources, + type=type, + subjects=subjects, + assignment_types=assignment_types, + grades=grades, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[EduResource]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_edu_resources_with_http_info( + self, + parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization ")] = None, + without_subfolders_resources: Annotated[Optional[StrictBool], Field(description="For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. ")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter the returned resources by type ")] = None, + subjects: Annotated[Optional[List[TeachingTheme]], Field(description="Filter the returned resources by subjects ")] = None, + assignment_types: Annotated[Optional[List[AssignmentType]], Field(description="Filter the returned resources by assignment types ")] = None, + grades: Annotated[Optional[List[Grade]], Field(description="Filter the returned resources by grades ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of resources that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[EduResource]]: + """List education resources in a library or folder + + + :param parent: List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization + :type parent: str + :param without_subfolders_resources: For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. + :type without_subfolders_resources: bool + :param type: Filter the returned resources by type + :type type: str + :param subjects: Filter the returned resources by subjects + :type subjects: List[TeachingTheme] + :param assignment_types: Filter the returned resources by assignment types + :type assignment_types: List[AssignmentType] + :param grades: Filter the returned resources by grades + :type grades: List[Grade] + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of resources that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_edu_resources_serialize( + parent=parent, + without_subfolders_resources=without_subfolders_resources, + type=type, + subjects=subjects, + assignment_types=assignment_types, + grades=grades, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[EduResource]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_edu_resources_without_preload_content( + self, + parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization ")] = None, + without_subfolders_resources: Annotated[Optional[StrictBool], Field(description="For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. ")] = None, + type: Annotated[Optional[StrictStr], Field(description="Filter the returned resources by type ")] = None, + subjects: Annotated[Optional[List[TeachingTheme]], Field(description="Filter the returned resources by subjects ")] = None, + assignment_types: Annotated[Optional[List[AssignmentType]], Field(description="Filter the returned resources by assignment types ")] = None, + grades: Annotated[Optional[List[Grade]], Field(description="Filter the returned resources by grades ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of resources that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List education resources in a library or folder + + + :param parent: List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization + :type parent: str + :param without_subfolders_resources: For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. + :type without_subfolders_resources: bool + :param type: Filter the returned resources by type + :type type: str + :param subjects: Filter the returned resources by subjects + :type subjects: List[TeachingTheme] + :param assignment_types: Filter the returned resources by assignment types + :type assignment_types: List[AssignmentType] + :param grades: Filter the returned resources by grades + :type grades: List[Grade] + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of resources that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_edu_resources_serialize( + parent=parent, + without_subfolders_resources=without_subfolders_resources, + type=type, + subjects=subjects, + assignment_types=assignment_types, + grades=grades, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[EduResource]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_edu_resources_serialize( + self, + parent, + without_subfolders_resources, + type, + subjects, + assignment_types, + grades, + sort, + direction, + limit, + next, + previous, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'subjects': 'multi', + 'assignmentTypes': 'multi', + 'grades': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if parent is not None: + + _query_params.append(('parent', parent)) + + if without_subfolders_resources is not None: + + _query_params.append(('withoutSubfoldersResources', without_subfolders_resources)) + + if type is not None: + + _query_params.append(('type', type)) + + if subjects is not None: + + _query_params.append(('subjects', subjects)) + + if assignment_types is not None: + + _query_params.append(('assignmentTypes', assignment_types)) + + if grades is not None: + + _query_params.append(('grades', grades)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/eduResources', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def move_edu_resource( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_move: EduResourceMove, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EduResource: + """Move an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_move: (required) + :type edu_resource_move: EduResourceMove + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_edu_resource_serialize( + resource=resource, + edu_resource_move=edu_resource_move, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def move_edu_resource_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_move: EduResourceMove, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EduResource]: + """Move an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_move: (required) + :type edu_resource_move: EduResourceMove + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_edu_resource_serialize( + resource=resource, + edu_resource_move=edu_resource_move, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def move_edu_resource_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_move: EduResourceMove, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Move an education resource + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_move: (required) + :type edu_resource_move: EduResourceMove + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._move_edu_resource_serialize( + resource=resource, + edu_resource_move=edu_resource_move, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _move_edu_resource_serialize( + self, + resource, + edu_resource_move, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if edu_resource_move is not None: + _body_params = edu_resource_move + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/eduResources/{resource}/move', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_edu_resource( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_update: EduResourceUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EduResource: + """Update an education resource metadata + + Update any resources metadata (e.g. title). Use this method to rename education resources folders or assignments. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_update: (required) + :type edu_resource_update: EduResourceUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_edu_resource_serialize( + resource=resource, + edu_resource_update=edu_resource_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_edu_resource_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_update: EduResourceUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EduResource]: + """Update an education resource metadata + + Update any resources metadata (e.g. title). Use this method to rename education resources folders or assignments. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_update: (required) + :type edu_resource_update: EduResourceUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_edu_resource_serialize( + resource=resource, + edu_resource_update=edu_resource_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_edu_resource_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_update: EduResourceUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an education resource metadata + + Update any resources metadata (e.g. title). Use this method to rename education resources folders or assignments. + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_update: (required) + :type edu_resource_update: EduResourceUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_edu_resource_serialize( + resource=resource, + edu_resource_update=edu_resource_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EduResource", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_edu_resource_serialize( + self, + resource, + edu_resource_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if edu_resource_update is not None: + _body_params = edu_resource_update + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/eduResources/{resource}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_edu_resource_assignment( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + assignment_update: AssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Assignment: + """Update an education resource assignment + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param assignment_update: (required) + :type assignment_update: AssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_edu_resource_assignment_serialize( + resource=resource, + assignment_update=assignment_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_edu_resource_assignment_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + assignment_update: AssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Assignment]: + """Update an education resource assignment + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param assignment_update: (required) + :type assignment_update: AssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_edu_resource_assignment_serialize( + resource=resource, + assignment_update=assignment_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_edu_resource_assignment_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + assignment_update: AssignmentUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an education resource assignment + + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param assignment_update: (required) + :type assignment_update: AssignmentUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_edu_resource_assignment_serialize( + resource=resource, + assignment_update=assignment_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Assignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_edu_resource_assignment_serialize( + self, + resource, + assignment_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if assignment_update is not None: + _body_params = assignment_update + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/eduResources/{resource}/assignment', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def use_edu_resource_in_class( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_use_in_class: EduResourceUseInClass, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassAssignment: + """Use an education resource in a class + + This endpoint will copy a resource and the underlying resources. The assignment will be created as a draft that can be completed with other options before publishing (e.g. due date, publication date for scheduling, etc.). + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_use_in_class: (required) + :type edu_resource_use_in_class: EduResourceUseInClass + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._use_edu_resource_in_class_serialize( + resource=resource, + edu_resource_use_in_class=edu_resource_use_in_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassAssignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def use_edu_resource_in_class_with_http_info( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_use_in_class: EduResourceUseInClass, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassAssignment]: + """Use an education resource in a class + + This endpoint will copy a resource and the underlying resources. The assignment will be created as a draft that can be completed with other options before publishing (e.g. due date, publication date for scheduling, etc.). + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_use_in_class: (required) + :type edu_resource_use_in_class: EduResourceUseInClass + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._use_edu_resource_in_class_serialize( + resource=resource, + edu_resource_use_in_class=edu_resource_use_in_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassAssignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def use_edu_resource_in_class_without_preload_content( + self, + resource: Annotated[StrictStr, Field(description="Unique identifier of the resource")], + edu_resource_use_in_class: EduResourceUseInClass, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Use an education resource in a class + + This endpoint will copy a resource and the underlying resources. The assignment will be created as a draft that can be completed with other options before publishing (e.g. due date, publication date for scheduling, etc.). + + :param resource: Unique identifier of the resource (required) + :type resource: str + :param edu_resource_use_in_class: (required) + :type edu_resource_use_in_class: EduResourceUseInClass + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._use_edu_resource_in_class_serialize( + resource=resource, + edu_resource_use_in_class=edu_resource_use_in_class, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassAssignment", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _use_edu_resource_in_class_serialize( + self, + resource, + edu_resource_use_in_class, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if resource is not None: + _path_params['resource'] = resource + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if edu_resource_use_in_class is not None: + _body_params = edu_resource_use_in_class + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/eduResources/{resource}/useInClass', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/group_api.py b/flat_api/aio/api/group_api.py new file mode 100644 index 0000000..706d233 --- /dev/null +++ b/flat_api/aio/api/group_api.py @@ -0,0 +1,2629 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.add_group_user200_response import AddGroupUser200Response +from flat_api.aio.models.add_group_user_request import AddGroupUserRequest +from flat_api.aio.models.group_creation import GroupCreation +from flat_api.aio.models.group_details import GroupDetails +from flat_api.aio.models.rename_group_request import RenameGroupRequest +from flat_api.aio.models.score_details import ScoreDetails +from flat_api.aio.models.user_public import UserPublic + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class GroupApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def add_group_user( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + add_group_user_request: AddGroupUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> AddGroupUser200Response: + """Add a student to a group + + Add a student to the specified group (must be in the same class) + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param add_group_user_request: (required) + :type add_group_user_request: AddGroupUserRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_group_user_serialize( + group=group, + add_group_user_request=add_group_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddGroupUser200Response", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def add_group_user_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + add_group_user_request: AddGroupUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AddGroupUser200Response]: + """Add a student to a group + + Add a student to the specified group (must be in the same class) + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param add_group_user_request: (required) + :type add_group_user_request: AddGroupUserRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_group_user_serialize( + group=group, + add_group_user_request=add_group_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddGroupUser200Response", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def add_group_user_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + add_group_user_request: AddGroupUserRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a student to a group + + Add a student to the specified group (must be in the same class) + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param add_group_user_request: (required) + :type add_group_user_request: AddGroupUserRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_group_user_serialize( + group=group, + add_group_user_request=add_group_user_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AddGroupUser200Response", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_group_user_serialize( + self, + group, + add_group_user_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if add_group_user_request is not None: + _body_params = add_group_user_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/groups/{group}/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_group( + self, + group_creation: GroupCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupDetails: + """Create a new group + + Create a group of the given type, tied to a classroom, optionally with initial members. + + :param group_creation: (required) + :type group_creation: GroupCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_group_serialize( + group_creation=group_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_group_with_http_info( + self, + group_creation: GroupCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupDetails]: + """Create a new group + + Create a group of the given type, tied to a classroom, optionally with initial members. + + :param group_creation: (required) + :type group_creation: GroupCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_group_serialize( + group_creation=group_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_group_without_preload_content( + self, + group_creation: GroupCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new group + + Create a group of the given type, tied to a classroom, optionally with initial members. + + :param group_creation: (required) + :type group_creation: GroupCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_group_serialize( + group_creation=group_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_group_serialize( + self, + group_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if group_creation is not None: + _body_params = group_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_group( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a group + + Delete a group. Only available to teachers of the classroom. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_group_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_group_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a group + + Delete a group. Only available to teachers of the classroom. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_group_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_group_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a group + + Delete a group. Only available to teachers of the classroom. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_group_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_group_serialize( + self, + group, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/groups/{group}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_group_details( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupDetails: + """Get group information + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_details_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_group_details_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupDetails]: + """Get group information + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_details_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_group_details_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get group information + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_details_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_details_serialize( + self, + group, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_group_scores( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_group_scores_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_group_scores_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_scores_serialize( + self, + group, + parent, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + if parent is not None: + + _query_params.append(('parent', parent)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group}/scores', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_group_users( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[UserPublic]: + """List group's users + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param source: Filter the users by their source + :type source: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_users_serialize( + group=group, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserPublic]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_group_users_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[UserPublic]]: + """List group's users + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param source: Filter the users by their source + :type source: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_users_serialize( + group=group, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserPublic]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_group_users_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List group's users + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param source: Filter the users by their source + :type source: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_users_serialize( + group=group, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserPublic]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_group_users_serialize( + self, + group, + source, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + if source is not None: + + _query_params.append(('source', source)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group}/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_groups( + self, + type: StrictStr, + classroom: Annotated[Optional[StrictStr], Field(description="Classroom ID to filter by")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="Assignment ID to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GroupDetails]: + """List groups + + List all groups of a given type, filtered by either a classroom or an assignment. + + :param type: (required) + :type type: str + :param classroom: Classroom ID to filter by + :type classroom: str + :param assignment: Assignment ID to filter by + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + type=type, + classroom=classroom, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GroupDetails]", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_groups_with_http_info( + self, + type: StrictStr, + classroom: Annotated[Optional[StrictStr], Field(description="Classroom ID to filter by")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="Assignment ID to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GroupDetails]]: + """List groups + + List all groups of a given type, filtered by either a classroom or an assignment. + + :param type: (required) + :type type: str + :param classroom: Classroom ID to filter by + :type classroom: str + :param assignment: Assignment ID to filter by + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + type=type, + classroom=classroom, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GroupDetails]", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_groups_without_preload_content( + self, + type: StrictStr, + classroom: Annotated[Optional[StrictStr], Field(description="Classroom ID to filter by")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="Assignment ID to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List groups + + List all groups of a given type, filtered by either a classroom or an assignment. + + :param type: (required) + :type type: str + :param classroom: Classroom ID to filter by + :type classroom: str + :param assignment: Assignment ID to filter by + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + type=type, + classroom=classroom, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GroupDetails]", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_groups_serialize( + self, + type, + classroom, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + if classroom is not None: + + _query_params.append(('classroom', classroom)) + + if assignment is not None: + + _query_params.append(('assignment', assignment)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def remove_group_user( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + user: Annotated[StrictStr, Field(description="User ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a student from a class group + + Remove a student from a class group + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param user: User ID (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_user_serialize( + group=group, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def remove_group_user_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + user: Annotated[StrictStr, Field(description="User ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a student from a class group + + Remove a student from a class group + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param user: User ID (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_user_serialize( + group=group, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def remove_group_user_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + user: Annotated[StrictStr, Field(description="User ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a student from a class group + + Remove a student from a class group + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param user: User ID (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_user_serialize( + group=group, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_group_user_serialize( + self, + group, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/groups/{group}/users/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def rename_group( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + rename_group_request: RenameGroupRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupDetails: + """Rename a group + + Rename a sub-group. Only available for class student groups. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param rename_group_request: (required) + :type rename_group_request: RenameGroupRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_group_serialize( + group=group, + rename_group_request=rename_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def rename_group_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + rename_group_request: RenameGroupRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupDetails]: + """Rename a group + + Rename a sub-group. Only available for class student groups. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param rename_group_request: (required) + :type rename_group_request: RenameGroupRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_group_serialize( + group=group, + rename_group_request=rename_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def rename_group_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + rename_group_request: RenameGroupRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Rename a group + + Rename a sub-group. Only available for class student groups. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param rename_group_request: (required) + :type rename_group_request: RenameGroupRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_group_serialize( + group=group, + rename_group_request=rename_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rename_group_serialize( + self, + group, + rename_group_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if rename_group_request is not None: + _body_params = rename_group_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/groups/{group}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/omr_api.py b/flat_api/aio/api/omr_api.py new file mode 100644 index 0000000..8274555 --- /dev/null +++ b/flat_api/aio/api/omr_api.py @@ -0,0 +1,3646 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import List, Optional, Tuple, Union +from typing_extensions import Annotated +from flat_api.aio.models.credit_transaction import CreditTransaction +from flat_api.aio.models.omr_capabilities import OmrCapabilities +from flat_api.aio.models.omr_details_submission import OmrDetailsSubmission +from flat_api.aio.models.omr_job import OmrJob +from flat_api.aio.models.omr_job_creation import OmrJobCreation +from flat_api.aio.models.omr_job_file_upload import OmrJobFileUpload +from flat_api.aio.models.omr_job_file_upload_result import OmrJobFileUploadResult +from flat_api.aio.models.omr_job_status import OmrJobStatus +from flat_api.aio.models.omr_step_name import OmrStepName + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class OMRApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def add_omr_job_file( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + omr_job_file_upload: OmrJobFileUpload, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJobFileUploadResult: + """Add a file to an OMR job + + Add one image or PDF to a draft job. Call once per file; files keep their upload order. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param omr_job_file_upload: (required) + :type omr_job_file_upload: OmrJobFileUpload + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_omr_job_file_serialize( + job=job, + omr_job_file_upload=omr_job_file_upload, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJobFileUploadResult", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def add_omr_job_file_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + omr_job_file_upload: OmrJobFileUpload, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJobFileUploadResult]: + """Add a file to an OMR job + + Add one image or PDF to a draft job. Call once per file; files keep their upload order. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param omr_job_file_upload: (required) + :type omr_job_file_upload: OmrJobFileUpload + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_omr_job_file_serialize( + job=job, + omr_job_file_upload=omr_job_file_upload, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJobFileUploadResult", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def add_omr_job_file_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + omr_job_file_upload: OmrJobFileUpload, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a file to an OMR job + + Add one image or PDF to a draft job. Call once per file; files keep their upload order. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param omr_job_file_upload: (required) + :type omr_job_file_upload: OmrJobFileUpload + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_omr_job_file_serialize( + job=job, + omr_job_file_upload=omr_job_file_upload, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJobFileUploadResult", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_omr_job_file_serialize( + self, + job, + omr_job_file_upload, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + if omr_job_file_upload is not None: + _body_params = omr_job_file_upload + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/files', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def cancel_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Cancel an OMR job + + Cancel a draft or in-flight job. Any charged credits are reversed. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def cancel_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Cancel an OMR job + + Cancel a draft or in-flight job. Any charged credits are reversed. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def cancel_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel an OMR job + + Cancel a draft or in-flight job. Any charged credits are reversed. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _cancel_omr_job_serialize( + self, + job, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/cancel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_omr_job( + self, + omr_job_creation: OmrJobCreation, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Create an OMR job + + Create an Optical Music Recognition job. There are two ways to call this endpoint: * **Draft:** send the parameters without `files` to create an empty job, then add files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple images or incremental mobile capture. * **One-shot:** include `files` and `autoStart: true` to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in `interactiveSteps`: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break. + + :param omr_job_creation: (required) + :type omr_job_creation: OmrJobCreation + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_omr_job_serialize( + omr_job_creation=omr_job_creation, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OmrJob", + '202': "OmrJob", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_omr_job_with_http_info( + self, + omr_job_creation: OmrJobCreation, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Create an OMR job + + Create an Optical Music Recognition job. There are two ways to call this endpoint: * **Draft:** send the parameters without `files` to create an empty job, then add files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple images or incremental mobile capture. * **One-shot:** include `files` and `autoStart: true` to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in `interactiveSteps`: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break. + + :param omr_job_creation: (required) + :type omr_job_creation: OmrJobCreation + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_omr_job_serialize( + omr_job_creation=omr_job_creation, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OmrJob", + '202': "OmrJob", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_omr_job_without_preload_content( + self, + omr_job_creation: OmrJobCreation, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an OMR job + + Create an Optical Music Recognition job. There are two ways to call this endpoint: * **Draft:** send the parameters without `files` to create an empty job, then add files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple images or incremental mobile capture. * **One-shot:** include `files` and `autoStart: true` to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in `interactiveSteps`: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break. + + :param omr_job_creation: (required) + :type omr_job_creation: OmrJobCreation + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_omr_job_serialize( + omr_job_creation=omr_job_creation, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OmrJob", + '202': "OmrJob", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_omr_job_serialize( + self, + omr_job_creation, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + if omr_job_creation is not None: + _body_params = omr_job_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Delete an OMR job's data + + Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the `status` it finished with, stays listable, and reports `retention.expiredDate`. Downloads then fail with `OMR_JOB_EXPIRED`. Only available for jobs whose `output` is `musicxml`. Library imports are not covered by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the resulting score instead. The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Delete an OMR job's data + + Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the `status` it finished with, stays listable, and reports `retention.expiredDate`. Downloads then fail with `OMR_JOB_EXPIRED`. Only available for jobs whose `output` is `musicxml`. Library imports are not covered by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the resulting score instead. The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an OMR job's data + + Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the `status` it finished with, stays listable, and reports `retention.expiredDate`. Downloads then fail with `OMR_JOB_EXPIRED`. Only available for jobs whose `output` is `musicxml`. Library imports are not covered by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the resulting score instead. The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_omr_job_serialize( + self, + job, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/omr/jobs/{job}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_omr_capabilities( + self, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrCapabilities: + """OMR capabilities and limits + + Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and `remainingCredits` is omitted. + + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_capabilities_serialize( + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrCapabilities", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_omr_capabilities_with_http_info( + self, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrCapabilities]: + """OMR capabilities and limits + + Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and `remainingCredits` is omitted. + + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_capabilities_serialize( + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrCapabilities", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_omr_capabilities_without_preload_content( + self, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """OMR capabilities and limits + + Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and `remainingCredits` is omitted. + + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_capabilities_serialize( + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrCapabilities", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_capabilities_serialize( + self, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/capabilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + wait: Annotated[Optional[Annotated[int, Field(le=25, strict=True, ge=0)]], Field(description="Long-poll up to this many seconds for a state change before returning.")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Get an OMR job + + Get the current state of an OMR job. This is the primary polling endpoint. Pass `wait` to long-poll until the state changes. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param wait: Long-poll up to this many seconds for a state change before returning. + :type wait: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_serialize( + job=job, + wait=wait, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + wait: Annotated[Optional[Annotated[int, Field(le=25, strict=True, ge=0)]], Field(description="Long-poll up to this many seconds for a state change before returning.")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Get an OMR job + + Get the current state of an OMR job. This is the primary polling endpoint. Pass `wait` to long-poll until the state changes. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param wait: Long-poll up to this many seconds for a state change before returning. + :type wait: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_serialize( + job=job, + wait=wait, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + wait: Annotated[Optional[Annotated[int, Field(le=25, strict=True, ge=0)]], Field(description="Long-poll up to this many seconds for a state change before returning.")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an OMR job + + Get the current state of an OMR job. This is the primary polling endpoint. Pass `wait` to long-poll until the state changes. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param wait: Long-poll up to this many seconds for a state change before returning. + :type wait: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_serialize( + job=job, + wait=wait, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_job_serialize( + self, + job, + wait, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs/{job}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_omr_job_export( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + format: Annotated[StrictStr, Field(description="Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). ")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Download the finalized result + + Stream the finalized result in the requested format. Available once the job is `done`. For `output: musicxml` jobs this is the primary way to retrieve the result; no library score is created. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param format: Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). (required) + :type format: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_export_serialize( + job=job, + format=format, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_omr_job_export_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + format: Annotated[StrictStr, Field(description="Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). ")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Download the finalized result + + Stream the finalized result in the requested format. Available once the job is `done`. For `output: musicxml` jobs this is the primary way to retrieve the result; no library score is created. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param format: Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). (required) + :type format: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_export_serialize( + job=job, + format=format, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_omr_job_export_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + format: Annotated[StrictStr, Field(description="Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). ")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download the finalized result + + Stream the finalized result in the requested format. Available once the job is `done`. For `output: musicxml` jobs this is the primary way to retrieve the result; no library score is created. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param format: Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). (required) + :type format: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_export_serialize( + job=job, + format=format, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_job_export_serialize( + self, + job, + format, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + if format is not None: + _path_params['format'] = format + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/octet-stream', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs/{job}/exports/{format}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_omr_job_file( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + index: Annotated[StrictInt, Field(description="0-based index of the input file (page) to fetch.")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Get an input page image + + Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read `retention.expiredDate` on the job to tell that case apart before requesting a file. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param index: 0-based index of the input file (page) to fetch. (required) + :type index: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_file_serialize( + job=job, + index=index, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_omr_job_file_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + index: Annotated[StrictInt, Field(description="0-based index of the input file (page) to fetch.")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Get an input page image + + Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read `retention.expiredDate` on the job to tell that case apart before requesting a file. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param index: 0-based index of the input file (page) to fetch. (required) + :type index: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_file_serialize( + job=job, + index=index, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_omr_job_file_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + index: Annotated[StrictInt, Field(description="0-based index of the input file (page) to fetch.")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an input page image + + Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read `retention.expiredDate` on the job to tell that case apart before requesting a file. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param index: 0-based index of the input file (page) to fetch. (required) + :type index: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_file_serialize( + job=job, + index=index, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_job_file_serialize( + self, + job, + index, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + if index is not None: + _path_params['index'] = index + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/jpeg', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs/{job}/files/{index}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_billing_credits_history( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[CreditTransaction]: + """List credit history + + The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's `state` to `canceled`. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read `state` to tell the two apart, and sum only `active` entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from `getOmrCapabilities`. + + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_billing_credits_history_serialize( + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CreditTransaction]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_billing_credits_history_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[CreditTransaction]]: + """List credit history + + The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's `state` to `canceled`. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read `state` to tell the two apart, and sum only `active` entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from `getOmrCapabilities`. + + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_billing_credits_history_serialize( + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CreditTransaction]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_billing_credits_history_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List credit history + + The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's `state` to `canceled`. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read `state` to tell the two apart, and sum only `active` entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from `getOmrCapabilities`. + + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_billing_credits_history_serialize( + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CreditTransaction]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_billing_credits_history_serialize( + self, + limit, + next, + previous, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/billing/credits/history', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_omr_jobs( + self, + status: Annotated[Optional[OmrJobStatus], Field(description="Filter jobs by status")] = None, + expired: Annotated[Optional[StrictBool], Field(description="Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[OmrJob]: + """List OMR jobs + + List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + + :param status: Filter jobs by status + :type status: OmrJobStatus + :param expired: Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. + :type expired: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_omr_jobs_serialize( + status=status, + expired=expired, + limit=limit, + next=next, + previous=previous, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OmrJob]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_omr_jobs_with_http_info( + self, + status: Annotated[Optional[OmrJobStatus], Field(description="Filter jobs by status")] = None, + expired: Annotated[Optional[StrictBool], Field(description="Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[OmrJob]]: + """List OMR jobs + + List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + + :param status: Filter jobs by status + :type status: OmrJobStatus + :param expired: Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. + :type expired: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_omr_jobs_serialize( + status=status, + expired=expired, + limit=limit, + next=next, + previous=previous, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OmrJob]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_omr_jobs_without_preload_content( + self, + status: Annotated[Optional[OmrJobStatus], Field(description="Filter jobs by status")] = None, + expired: Annotated[Optional[StrictBool], Field(description="Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List OMR jobs + + List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + + :param status: Filter jobs by status + :type status: OmrJobStatus + :param expired: Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. + :type expired: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_omr_jobs_serialize( + status=status, + expired=expired, + limit=limit, + next=next, + previous=previous, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OmrJob]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_omr_jobs_serialize( + self, + status, + expired, + limit, + next, + previous, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if status is not None: + + _query_params.append(('status', status.value)) + + if expired is not None: + + _query_params.append(('expired', expired)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def start_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Start an OMR job + + Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def start_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Start an OMR job + + Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def start_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start an OMR job + + Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _start_omr_job_serialize( + self, + job, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/start', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def submit_omr_job_step( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + step: Annotated[OmrStepName, Field(description="The pending step being submitted")], + body: OmrDetailsSubmission, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Submit an interactive step + + Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on `step` (a `oneOf` discriminated by the step name). + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param step: The pending step being submitted (required) + :type step: OmrStepName + :param body: (required) + :type body: OmrDetailsSubmission + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_omr_job_step_serialize( + job=job, + step=step, + body=body, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def submit_omr_job_step_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + step: Annotated[OmrStepName, Field(description="The pending step being submitted")], + body: OmrDetailsSubmission, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Submit an interactive step + + Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on `step` (a `oneOf` discriminated by the step name). + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param step: The pending step being submitted (required) + :type step: OmrStepName + :param body: (required) + :type body: OmrDetailsSubmission + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_omr_job_step_serialize( + job=job, + step=step, + body=body, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def submit_omr_job_step_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + step: Annotated[OmrStepName, Field(description="The pending step being submitted")], + body: OmrDetailsSubmission, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Submit an interactive step + + Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on `step` (a `oneOf` discriminated by the step name). + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param step: The pending step being submitted (required) + :type step: OmrStepName + :param body: (required) + :type body: OmrDetailsSubmission + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_omr_job_step_serialize( + job=job, + step=step, + body=body, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _submit_omr_job_step_serialize( + self, + job, + step, + body, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + if step is not None: + _path_params['step'] = step.value + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/steps/{step}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/organization_api.py b/flat_api/aio/api/organization_api.py new file mode 100644 index 0000000..3ef50b2 --- /dev/null +++ b/flat_api/aio/api/organization_api.py @@ -0,0 +1,4997 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.api_access_token import ApiAccessToken +from flat_api.aio.models.create_lti_configuration200_response import CreateLtiConfiguration200Response +from flat_api.aio.models.lti_configuration import LtiConfiguration +from flat_api.aio.models.lti_configuration_create import LtiConfigurationCreate +from flat_api.aio.models.lti_configuration_update import LtiConfigurationUpdate +from flat_api.aio.models.lti_credentials import LtiCredentials +from flat_api.aio.models.lti_credentials_creation import LtiCredentialsCreation +from flat_api.aio.models.organization_invitation import OrganizationInvitation +from flat_api.aio.models.organization_invitation_creation import OrganizationInvitationCreation +from flat_api.aio.models.organization_user_access_token_creation import OrganizationUserAccessTokenCreation +from flat_api.aio.models.user_admin_update import UserAdminUpdate +from flat_api.aio.models.user_creation import UserCreation +from flat_api.aio.models.user_details_admin import UserDetailsAdmin +from flat_api.aio.models.user_signin_link import UserSigninLink +from flat_api.aio.models.user_signin_link_creation import UserSigninLinkCreation + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class OrganizationApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def count_orga_users( + self, + role: Annotated[Optional[List[StrictStr]], Field(description="Filter users by role")] = None, + q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, + group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, + no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> int: + """Count the organization users using the provided filters + + + :param role: Filter users by role + :type role: List[str] + :param q: The query to search + :type q: str + :param group: Filter users by group + :type group: List[str] + :param no_active_license: Filter users who don't have an active license + :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._count_orga_users_serialize( + role=role, + q=q, + group=group, + no_active_license=no_active_license, + test_accounts=test_accounts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def count_orga_users_with_http_info( + self, + role: Annotated[Optional[List[StrictStr]], Field(description="Filter users by role")] = None, + q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, + group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, + no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[int]: + """Count the organization users using the provided filters + + + :param role: Filter users by role + :type role: List[str] + :param q: The query to search + :type q: str + :param group: Filter users by group + :type group: List[str] + :param no_active_license: Filter users who don't have an active license + :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._count_orga_users_serialize( + role=role, + q=q, + group=group, + no_active_license=no_active_license, + test_accounts=test_accounts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def count_orga_users_without_preload_content( + self, + role: Annotated[Optional[List[StrictStr]], Field(description="Filter users by role")] = None, + q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, + group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, + no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Count the organization users using the provided filters + + + :param role: Filter users by role + :type role: List[str] + :param q: The query to search + :type q: str + :param group: Filter users by group + :type group: List[str] + :param no_active_license: Filter users who don't have an active license + :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._count_orga_users_serialize( + role=role, + q=q, + group=group, + no_active_license=no_active_license, + test_accounts=test_accounts, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "int", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _count_orga_users_serialize( + self, + role, + q, + group, + no_active_license, + test_accounts, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'role': 'multi', + 'group': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if role is not None: + + _query_params.append(('role', role)) + + if q is not None: + + _query_params.append(('q', q)) + + if group is not None: + + _query_params.append(('group', group)) + + if no_active_license is not None: + + _query_params.append(('noActiveLicense', no_active_license)) + + if test_accounts is not None: + + _query_params.append(('testAccounts', test_accounts)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/users/count', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_lti_configuration( + self, + lti_configuration_create: LtiConfigurationCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateLtiConfiguration200Response: + """Create a new LTI configuration (1.1 or 1.3) + + + :param lti_configuration_create: (required) + :type lti_configuration_create: LtiConfigurationCreate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_lti_configuration_serialize( + lti_configuration_create=lti_configuration_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateLtiConfiguration200Response", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_lti_configuration_with_http_info( + self, + lti_configuration_create: LtiConfigurationCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateLtiConfiguration200Response]: + """Create a new LTI configuration (1.1 or 1.3) + + + :param lti_configuration_create: (required) + :type lti_configuration_create: LtiConfigurationCreate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_lti_configuration_serialize( + lti_configuration_create=lti_configuration_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateLtiConfiguration200Response", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_lti_configuration_without_preload_content( + self, + lti_configuration_create: LtiConfigurationCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new LTI configuration (1.1 or 1.3) + + + :param lti_configuration_create: (required) + :type lti_configuration_create: LtiConfigurationCreate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_lti_configuration_serialize( + lti_configuration_create=lti_configuration_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateLtiConfiguration200Response", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_lti_configuration_serialize( + self, + lti_configuration_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if lti_configuration_create is not None: + _body_params = lti_configuration_create + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/lti/configurations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_lti_credentials( + self, + body: LtiCredentialsCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LtiCredentials: + """(Deprecated) Create a new couple of LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). + + :param body: (required) + :type body: LtiCredentialsCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /organizations/lti/credentials is deprecated.", DeprecationWarning) + + _param = self._create_lti_credentials_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiCredentials", + '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_lti_credentials_with_http_info( + self, + body: LtiCredentialsCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LtiCredentials]: + """(Deprecated) Create a new couple of LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). + + :param body: (required) + :type body: LtiCredentialsCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /organizations/lti/credentials is deprecated.", DeprecationWarning) + + _param = self._create_lti_credentials_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiCredentials", + '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_lti_credentials_without_preload_content( + self, + body: LtiCredentialsCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Create a new couple of LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). + + :param body: (required) + :type body: LtiCredentialsCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("POST /organizations/lti/credentials is deprecated.", DeprecationWarning) + + _param = self._create_lti_credentials_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiCredentials", + '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_lti_credentials_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/lti/credentials', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_organization_invitation( + self, + body: OrganizationInvitationCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OrganizationInvitation: + """Create a new invitation to join the organization + + This method creates and sends invitation for teachers and admins. Invitations can only be used by new Flat users or users who are not part of the organization yet. If the email of the user is already associated to a user of your organization, the API will simply update the role of the existing user and won't send an invitation. In this case, the property `usedBy` will be directly filled with the uniquer identifier of the corresponding user. + + :param body: (required) + :type body: OrganizationInvitationCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_invitation_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationInvitation", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_organization_invitation_with_http_info( + self, + body: OrganizationInvitationCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OrganizationInvitation]: + """Create a new invitation to join the organization + + This method creates and sends invitation for teachers and admins. Invitations can only be used by new Flat users or users who are not part of the organization yet. If the email of the user is already associated to a user of your organization, the API will simply update the role of the existing user and won't send an invitation. In this case, the property `usedBy` will be directly filled with the uniquer identifier of the corresponding user. + + :param body: (required) + :type body: OrganizationInvitationCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_invitation_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationInvitation", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_organization_invitation_without_preload_content( + self, + body: OrganizationInvitationCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new invitation to join the organization + + This method creates and sends invitation for teachers and admins. Invitations can only be used by new Flat users or users who are not part of the organization yet. If the email of the user is already associated to a user of your organization, the API will simply update the role of the existing user and won't send an invitation. In this case, the property `usedBy` will be directly filled with the uniquer identifier of the corresponding user. + + :param body: (required) + :type body: OrganizationInvitationCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_invitation_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OrganizationInvitation", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_invitation_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/invitations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_organization_user( + self, + body: UserCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserDetailsAdmin: + """Create a new user account + + + :param body: (required) + :type body: UserCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_organization_user_with_http_info( + self, + body: UserCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserDetailsAdmin]: + """Create a new user account + + + :param body: (required) + :type body: UserCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_organization_user_without_preload_content( + self, + body: UserCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new user account + + + :param body: (required) + :type body: UserCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_user_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_organization_user_access_token( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + organization_user_access_token_creation: OrganizationUserAccessTokenCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiAccessToken: + """Create a delegated API access token for an organization user + + This operation will create an API access token for a chosen organization user. This token will be valid for a limited time and can be used to access the API as the organization user. + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param organization_user_access_token_creation: (required) + :type organization_user_access_token_creation: OrganizationUserAccessTokenCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_access_token_serialize( + user=user, + organization_user_access_token_creation=organization_user_access_token_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAccessToken", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_organization_user_access_token_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + organization_user_access_token_creation: OrganizationUserAccessTokenCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ApiAccessToken]: + """Create a delegated API access token for an organization user + + This operation will create an API access token for a chosen organization user. This token will be valid for a limited time and can be used to access the API as the organization user. + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param organization_user_access_token_creation: (required) + :type organization_user_access_token_creation: OrganizationUserAccessTokenCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_access_token_serialize( + user=user, + organization_user_access_token_creation=organization_user_access_token_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAccessToken", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_organization_user_access_token_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + organization_user_access_token_creation: OrganizationUserAccessTokenCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a delegated API access token for an organization user + + This operation will create an API access token for a chosen organization user. This token will be valid for a limited time and can be used to access the API as the organization user. + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param organization_user_access_token_creation: (required) + :type organization_user_access_token_creation: OrganizationUserAccessTokenCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_access_token_serialize( + user=user, + organization_user_access_token_creation=organization_user_access_token_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ApiAccessToken", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_user_access_token_serialize( + self, + user, + organization_user_access_token_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if organization_user_access_token_creation is not None: + _body_params = organization_user_access_token_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/users/{user}/accessToken', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_organization_user_signin_link( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + user_signin_link_creation: UserSigninLinkCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserSigninLink: + """Create a sign in link for an organization user + + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param user_signin_link_creation: (required) + :type user_signin_link_creation: UserSigninLinkCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_signin_link_serialize( + user=user, + user_signin_link_creation=user_signin_link_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSigninLink", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_organization_user_signin_link_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + user_signin_link_creation: UserSigninLinkCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserSigninLink]: + """Create a sign in link for an organization user + + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param user_signin_link_creation: (required) + :type user_signin_link_creation: UserSigninLinkCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_signin_link_serialize( + user=user, + user_signin_link_creation=user_signin_link_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSigninLink", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_organization_user_signin_link_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + user_signin_link_creation: UserSigninLinkCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a sign in link for an organization user + + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param user_signin_link_creation: (required) + :type user_signin_link_creation: UserSigninLinkCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_organization_user_signin_link_serialize( + user=user, + user_signin_link_creation=user_signin_link_creation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserSigninLink", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_organization_user_signin_link_serialize( + self, + user, + user_signin_link_creation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if user_signin_link_creation is not None: + _body_params = user_signin_link_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/users/{user}/signinLink', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_lti_configuration( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an LTI configuration + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_lti_configuration_serialize( + configuration=configuration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_lti_configuration_with_http_info( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an LTI configuration + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_lti_configuration_serialize( + configuration=configuration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_lti_configuration_without_preload_content( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an LTI configuration + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_lti_configuration_serialize( + configuration=configuration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_lti_configuration_serialize( + self, + configuration, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if configuration is not None: + _path_params['configuration'] = configuration + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/organizations/lti/configurations/{configuration}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_lti_configurations( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[LtiConfiguration]: + """List LTI configurations (1.1 and 1.3) + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_lti_configurations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiConfiguration]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_lti_configurations_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[LtiConfiguration]]: + """List LTI configurations (1.1 and 1.3) + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_lti_configurations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiConfiguration]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_lti_configurations_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List LTI configurations (1.1 and 1.3) + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_lti_configurations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiConfiguration]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_lti_configurations_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/lti/configurations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_lti_credentials( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[LtiCredentials]: + """(Deprecated) List LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /organizations/lti/credentials is deprecated.", DeprecationWarning) + + _param = self._list_lti_credentials_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiCredentials]", + '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_lti_credentials_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[LtiCredentials]]: + """(Deprecated) List LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /organizations/lti/credentials is deprecated.", DeprecationWarning) + + _param = self._list_lti_credentials_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiCredentials]", + '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_lti_credentials_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) List LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("GET /organizations/lti/credentials is deprecated.", DeprecationWarning) + + _param = self._list_lti_credentials_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiCredentials]", + '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_lti_credentials_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/lti/credentials', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_organization_invitations( + self, + role: Annotated[Optional[StrictStr], Field(description="Filter users by role")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[OrganizationInvitation]: + """List the organization invitations + + + :param role: Filter users by role + :type role: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_organization_invitations_serialize( + role=role, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OrganizationInvitation]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_organization_invitations_with_http_info( + self, + role: Annotated[Optional[StrictStr], Field(description="Filter users by role")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[OrganizationInvitation]]: + """List the organization invitations + + + :param role: Filter users by role + :type role: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_organization_invitations_serialize( + role=role, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OrganizationInvitation]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_organization_invitations_without_preload_content( + self, + role: Annotated[Optional[StrictStr], Field(description="Filter users by role")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the organization invitations + + + :param role: Filter users by role + :type role: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_organization_invitations_serialize( + role=role, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OrganizationInvitation]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_organization_invitations_serialize( + self, + role, + limit, + next, + previous, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if role is not None: + + _query_params.append(('role', role)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/invitations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_organization_users( + self, + sort: Annotated[Optional[StrictStr], Field(description="The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. ")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + role: Annotated[Optional[List[StrictStr]], Field(description="Filter users by role")] = None, + q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, + group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, + no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, + license_expiration_date: Annotated[Optional[List[StrictStr]], Field(description="Filter users by license expiration date or `active` / `notActive`")] = None, + only_ids: Annotated[Optional[StrictBool], Field(description="Return only user ids")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[UserDetailsAdmin]: + """List the organization users + + + :param sort: The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. + :type sort: str + :param direction: Sort direction + :type direction: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param role: Filter users by role + :type role: List[str] + :param q: The query to search + :type q: str + :param group: Filter users by group + :type group: List[str] + :param no_active_license: Filter users who don't have an active license + :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str + :param license_expiration_date: Filter users by license expiration date or `active` / `notActive` + :type license_expiration_date: List[str] + :param only_ids: Return only user ids + :type only_ids: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_organization_users_serialize( + sort=sort, + direction=direction, + next=next, + previous=previous, + role=role, + q=q, + group=group, + no_active_license=no_active_license, + test_accounts=test_accounts, + license_expiration_date=license_expiration_date, + only_ids=only_ids, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserDetailsAdmin]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_organization_users_with_http_info( + self, + sort: Annotated[Optional[StrictStr], Field(description="The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. ")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + role: Annotated[Optional[List[StrictStr]], Field(description="Filter users by role")] = None, + q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, + group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, + no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, + license_expiration_date: Annotated[Optional[List[StrictStr]], Field(description="Filter users by license expiration date or `active` / `notActive`")] = None, + only_ids: Annotated[Optional[StrictBool], Field(description="Return only user ids")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[UserDetailsAdmin]]: + """List the organization users + + + :param sort: The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. + :type sort: str + :param direction: Sort direction + :type direction: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param role: Filter users by role + :type role: List[str] + :param q: The query to search + :type q: str + :param group: Filter users by group + :type group: List[str] + :param no_active_license: Filter users who don't have an active license + :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str + :param license_expiration_date: Filter users by license expiration date or `active` / `notActive` + :type license_expiration_date: List[str] + :param only_ids: Return only user ids + :type only_ids: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_organization_users_serialize( + sort=sort, + direction=direction, + next=next, + previous=previous, + role=role, + q=q, + group=group, + no_active_license=no_active_license, + test_accounts=test_accounts, + license_expiration_date=license_expiration_date, + only_ids=only_ids, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserDetailsAdmin]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_organization_users_without_preload_content( + self, + sort: Annotated[Optional[StrictStr], Field(description="The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. ")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + role: Annotated[Optional[List[StrictStr]], Field(description="Filter users by role")] = None, + q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, + group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, + no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, + license_expiration_date: Annotated[Optional[List[StrictStr]], Field(description="Filter users by license expiration date or `active` / `notActive`")] = None, + only_ids: Annotated[Optional[StrictBool], Field(description="Return only user ids")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the organization users + + + :param sort: The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. + :type sort: str + :param direction: Sort direction + :type direction: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param role: Filter users by role + :type role: List[str] + :param q: The query to search + :type q: str + :param group: Filter users by group + :type group: List[str] + :param no_active_license: Filter users who don't have an active license + :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str + :param license_expiration_date: Filter users by license expiration date or `active` / `notActive` + :type license_expiration_date: List[str] + :param only_ids: Return only user ids + :type only_ids: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_organization_users_serialize( + sort=sort, + direction=direction, + next=next, + previous=previous, + role=role, + q=q, + group=group, + no_active_license=no_active_license, + test_accounts=test_accounts, + license_expiration_date=license_expiration_date, + only_ids=only_ids, + limit=limit, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserDetailsAdmin]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_organization_users_serialize( + self, + sort, + direction, + next, + previous, + role, + q, + group, + no_active_license, + test_accounts, + license_expiration_date, + only_ids, + limit, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'role': 'multi', + 'group': 'multi', + 'licenseExpirationDate': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + if role is not None: + + _query_params.append(('role', role)) + + if q is not None: + + _query_params.append(('q', q)) + + if group is not None: + + _query_params.append(('group', group)) + + if no_active_license is not None: + + _query_params.append(('noActiveLicense', no_active_license)) + + if test_accounts is not None: + + _query_params.append(('testAccounts', test_accounts)) + + if license_expiration_date is not None: + + _query_params.append(('licenseExpirationDate', license_expiration_date)) + + if only_ids is not None: + + _query_params.append(('onlyIds', only_ids)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def remove_organization_invitation( + self, + invitation: Annotated[StrictStr, Field(description="Unique identifier of the invitation")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove an organization invitation + + + :param invitation: Unique identifier of the invitation (required) + :type invitation: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_organization_invitation_serialize( + invitation=invitation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def remove_organization_invitation_with_http_info( + self, + invitation: Annotated[StrictStr, Field(description="Unique identifier of the invitation")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove an organization invitation + + + :param invitation: Unique identifier of the invitation (required) + :type invitation: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_organization_invitation_serialize( + invitation=invitation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def remove_organization_invitation_without_preload_content( + self, + invitation: Annotated[StrictStr, Field(description="Unique identifier of the invitation")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove an organization invitation + + + :param invitation: Unique identifier of the invitation (required) + :type invitation: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_organization_invitation_serialize( + invitation=invitation, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_organization_invitation_serialize( + self, + invitation, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if invitation is not None: + _path_params['invitation'] = invitation + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/organizations/invitations/{invitation}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def remove_organization_user( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + convert_to_individual: Annotated[Optional[StrictBool], Field(description="If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove an account from Flat + + This operation removes an account from Flat and its data, including: * The music scores created by this user (documents, history, comments, collaboration information) * Education related data (assignments and classroom information) + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param convert_to_individual: If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal. + :type convert_to_individual: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_organization_user_serialize( + user=user, + convert_to_individual=convert_to_individual, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def remove_organization_user_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + convert_to_individual: Annotated[Optional[StrictBool], Field(description="If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove an account from Flat + + This operation removes an account from Flat and its data, including: * The music scores created by this user (documents, history, comments, collaboration information) * Education related data (assignments and classroom information) + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param convert_to_individual: If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal. + :type convert_to_individual: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_organization_user_serialize( + user=user, + convert_to_individual=convert_to_individual, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def remove_organization_user_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + convert_to_individual: Annotated[Optional[StrictBool], Field(description="If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove an account from Flat + + This operation removes an account from Flat and its data, including: * The music scores created by this user (documents, history, comments, collaboration information) * Education related data (assignments and classroom information) + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param convert_to_individual: If `true`, the account will be only removed from the organization and converted into an individual account on our public website, https://flat.io. This operation will remove the education-related data from the account. Before realizing this operation, you need to be sure that the user is at least 13 years old and that this one has read and agreed to the Individual Terms of Services of Flat available on https://flat.io/legal. + :type convert_to_individual: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_organization_user_serialize( + user=user, + convert_to_individual=convert_to_individual, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_organization_user_serialize( + self, + user, + convert_to_individual, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + if convert_to_individual is not None: + + _query_params.append(('convertToIndividual', convert_to_individual)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/organizations/users/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def revoke_lti_credentials( + self, + credentials: Annotated[StrictStr, Field(description="Credentials unique identifier ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """(Deprecated) Revoke LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + :param credentials: Credentials unique identifier (required) + :type credentials: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("DELETE /organizations/lti/credentials/{credentials} is deprecated.", DeprecationWarning) + + _param = self._revoke_lti_credentials_serialize( + credentials=credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def revoke_lti_credentials_with_http_info( + self, + credentials: Annotated[StrictStr, Field(description="Credentials unique identifier ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """(Deprecated) Revoke LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + :param credentials: Credentials unique identifier (required) + :type credentials: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("DELETE /organizations/lti/credentials/{credentials} is deprecated.", DeprecationWarning) + + _param = self._revoke_lti_credentials_serialize( + credentials=credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def revoke_lti_credentials_without_preload_content( + self, + credentials: Annotated[StrictStr, Field(description="Credentials unique identifier ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """(Deprecated) Revoke LTI 1.x credentials + + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. + + :param credentials: Credentials unique identifier (required) + :type credentials: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + warnings.warn("DELETE /organizations/lti/credentials/{credentials} is deprecated.", DeprecationWarning) + + _param = self._revoke_lti_credentials_serialize( + credentials=credentials, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _revoke_lti_credentials_serialize( + self, + credentials, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if credentials is not None: + _path_params['credentials'] = credentials + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/organizations/lti/credentials/{credentials}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_lti_configuration( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + lti_configuration_update: LtiConfigurationUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LtiConfiguration: + """Update an existing LTI configuration (edit 1.3; 1.1 not editable) + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :param lti_configuration_update: (required) + :type lti_configuration_update: LtiConfigurationUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_lti_configuration_serialize( + configuration=configuration, + lti_configuration_update=lti_configuration_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiConfiguration", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_lti_configuration_with_http_info( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + lti_configuration_update: LtiConfigurationUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LtiConfiguration]: + """Update an existing LTI configuration (edit 1.3; 1.1 not editable) + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :param lti_configuration_update: (required) + :type lti_configuration_update: LtiConfigurationUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_lti_configuration_serialize( + configuration=configuration, + lti_configuration_update=lti_configuration_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiConfiguration", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_lti_configuration_without_preload_content( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + lti_configuration_update: LtiConfigurationUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an existing LTI configuration (edit 1.3; 1.1 not editable) + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :param lti_configuration_update: (required) + :type lti_configuration_update: LtiConfigurationUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_lti_configuration_serialize( + configuration=configuration, + lti_configuration_update=lti_configuration_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiConfiguration", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_lti_configuration_serialize( + self, + configuration, + lti_configuration_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if configuration is not None: + _path_params['configuration'] = configuration + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if lti_configuration_update is not None: + _body_params = lti_configuration_update + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/organizations/lti/configurations/{configuration}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_organization_user( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + body: UserAdminUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserDetailsAdmin: + """Update account information + + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param body: (required) + :type body: UserAdminUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_user_serialize( + user=user, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_organization_user_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + body: UserAdminUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserDetailsAdmin]: + """Update account information + + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param body: (required) + :type body: UserAdminUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_user_serialize( + user=user, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_organization_user_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of the Flat account ")], + body: UserAdminUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update account information + + + :param user: Unique identifier of the Flat account (required) + :type user: str + :param body: (required) + :type body: UserAdminUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_organization_user_serialize( + user=user, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_organization_user_serialize( + self, + user, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/organizations/users/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/score_api.py b/flat_api/aio/api/score_api.py new file mode 100644 index 0000000..879baab --- /dev/null +++ b/flat_api/aio/api/score_api.py @@ -0,0 +1,9310 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator +from typing import List, Optional, Tuple, Union +from typing_extensions import Annotated +from flat_api.aio.models.assignment_submission import AssignmentSubmission +from flat_api.aio.models.resource_collaborator import ResourceCollaborator +from flat_api.aio.models.resource_collaborator_creation import ResourceCollaboratorCreation +from flat_api.aio.models.score_comment import ScoreComment +from flat_api.aio.models.score_comment_creation import ScoreCommentCreation +from flat_api.aio.models.score_comment_update import ScoreCommentUpdate +from flat_api.aio.models.score_creation import ScoreCreation +from flat_api.aio.models.score_details import ScoreDetails +from flat_api.aio.models.score_fork import ScoreFork +from flat_api.aio.models.score_modification import ScoreModification +from flat_api.aio.models.score_revision import ScoreRevision +from flat_api.aio.models.score_revision_creation import ScoreRevisionCreation +from flat_api.aio.models.score_track import ScoreTrack +from flat_api.aio.models.score_track_creation import ScoreTrackCreation +from flat_api.aio.models.score_track_creation_response import ScoreTrackCreationResponse +from flat_api.aio.models.score_track_update import ScoreTrackUpdate +from flat_api.aio.models.task import Task +from flat_api.aio.models.task_export_options import TaskExportOptions + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class ScoreApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def add_score_collaborator( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ResourceCollaboratorCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ResourceCollaborator: + """Add a new collaborator + + Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the `user` property. - To invite an external user to the resource, specify its email in the `userEmail` property. - To add a Flat group to the resource, specify its unique identifier in the `group` property. - To update an existing collaborator, process the same request with different rights. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ResourceCollaboratorCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_collaborator_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceCollaborator", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def add_score_collaborator_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ResourceCollaboratorCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ResourceCollaborator]: + """Add a new collaborator + + Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the `user` property. - To invite an external user to the resource, specify its email in the `userEmail` property. - To add a Flat group to the resource, specify its unique identifier in the `group` property. - To update an existing collaborator, process the same request with different rights. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ResourceCollaboratorCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_collaborator_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceCollaborator", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def add_score_collaborator_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ResourceCollaboratorCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a new collaborator + + Share a score with a single user or a group. This API call allows to add, invite and update the collaborators of a resource. - To add an existing Flat user to the resource, specify its unique identifier in the `user` property. - To invite an external user to the resource, specify its email in the `userEmail` property. - To add a Flat group to the resource, specify its unique identifier in the `group` property. - To update an existing collaborator, process the same request with different rights. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ResourceCollaboratorCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_collaborator_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceCollaborator", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_score_collaborator_serialize( + self, + score, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores/{score}/collaborators', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def add_score_track( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreTrackCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreTrackCreationResponse: + """Add a new video or audio track to the score + + Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreTrackCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_track_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrackCreationResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def add_score_track_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreTrackCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreTrackCreationResponse]: + """Add a new video or audio track to the score + + Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreTrackCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_track_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrackCreationResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def add_score_track_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreTrackCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a new video or audio track to the score + + Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreTrackCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_score_track_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrackCreationResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_score_track_serialize( + self, + score, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores/{score}/tracks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_export_task( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + format: Annotated[StrictStr, Field(description="The format of the file that will be generated or the target service name where the file will be exported")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + body: Optional[TaskExportOptions] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Create a new score export task + + Some of the exports of a score takes are longer to process than a simple API requests. Use this endpoint to launch a new export of one score hosted on Flat. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param format: The format of the file that will be generated or the target service name where the file will be exported (required) + :type format: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param body: + :type body: TaskExportOptions + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_export_task_serialize( + score=score, + revision=revision, + format=format, + sharing_key=sharing_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_export_task_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + format: Annotated[StrictStr, Field(description="The format of the file that will be generated or the target service name where the file will be exported")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + body: Optional[TaskExportOptions] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Create a new score export task + + Some of the exports of a score takes are longer to process than a simple API requests. Use this endpoint to launch a new export of one score hosted on Flat. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param format: The format of the file that will be generated or the target service name where the file will be exported (required) + :type format: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param body: + :type body: TaskExportOptions + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_export_task_serialize( + score=score, + revision=revision, + format=format, + sharing_key=sharing_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_export_task_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + format: Annotated[StrictStr, Field(description="The format of the file that will be generated or the target service name where the file will be exported")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + body: Optional[TaskExportOptions] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new score export task + + Some of the exports of a score takes are longer to process than a simple API requests. Use this endpoint to launch a new export of one score hosted on Flat. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param format: The format of the file that will be generated or the target service name where the file will be exported (required) + :type format: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param body: + :type body: TaskExportOptions + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_export_task_serialize( + score=score, + revision=revision, + format=format, + sharing_key=sharing_key, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_export_task_serialize( + self, + score, + revision, + format, + sharing_key, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if revision is not None: + _path_params['revision'] = revision + if format is not None: + _path_params['format'] = format + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores/{score}/revisions/{revision}/{format}/task', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_score( + self, + body: ScoreCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreDetails: + """Create a new score + + Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import a file to create the new Flat document. **Preferred formats**: * **MusicXML**: `.xml`, `.musicxml`, `.mxl` (compressed) — MIME: `vnd.recordare.musicxml+xml`, `vnd.recordare.musicxml`. This is the only format that preserves all notation data (articulations, dynamics, layout, etc.) with full round-trip support. * **MIDI**: `.mid`, `.midi` — MIME: `audio/midi`. Only preserves pitch, timing, and instrument data; notation details are lost. **Also supported** (converted to MusicXML on import, some notation details may be lost): * **Guitar Pro**: `.gp`, `.gp3`, `.gp4`, `.gp5`, `.gpx`, `.gtp` * **MuseScore**: `.mscz`, `.mscx` * **Finale**: `.musx` * **ABC notation**: `.abc` — MIME: `text/vnd.abc` * **PowerTab**: `.ptb` * **Capella**: `.cap`, `.capx` * **MEI**: `.mei` * **Overture**: `.ove` * **TablEdit**: `.tef` * **Band-in-a-Box**: `.mgu`, `.sgu` * **Karaoke MIDI**: `.kar` * **MuseData**: `.md` * **Score Writer**: `.scw` * **Bagpipe Music Writer**: `.bmw`, `.bww` * **Encore**: `.enc` **Scanned music** (requires `supportsTasks`, runs our music recognition and spends credits): * **PDF**: `.pdf` * **Images**: `.jpg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`, `.heic`, `.heif` The file is identified by its own content, so its extension and any declared type do not have to match. **One file per request**: a multi-page PDF or a multi-frame TIFF is fine, but several separate images of the same score (a page photographed at a time) need `createOmrJob`, which takes many inputs in one job and bills them as a single document. Its live limits are served by `getOmrCapabilities`. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. + + :param body: (required) + :type body: ScoreCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_score_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '202': "Task", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_score_with_http_info( + self, + body: ScoreCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreDetails]: + """Create a new score + + Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import a file to create the new Flat document. **Preferred formats**: * **MusicXML**: `.xml`, `.musicxml`, `.mxl` (compressed) — MIME: `vnd.recordare.musicxml+xml`, `vnd.recordare.musicxml`. This is the only format that preserves all notation data (articulations, dynamics, layout, etc.) with full round-trip support. * **MIDI**: `.mid`, `.midi` — MIME: `audio/midi`. Only preserves pitch, timing, and instrument data; notation details are lost. **Also supported** (converted to MusicXML on import, some notation details may be lost): * **Guitar Pro**: `.gp`, `.gp3`, `.gp4`, `.gp5`, `.gpx`, `.gtp` * **MuseScore**: `.mscz`, `.mscx` * **Finale**: `.musx` * **ABC notation**: `.abc` — MIME: `text/vnd.abc` * **PowerTab**: `.ptb` * **Capella**: `.cap`, `.capx` * **MEI**: `.mei` * **Overture**: `.ove` * **TablEdit**: `.tef` * **Band-in-a-Box**: `.mgu`, `.sgu` * **Karaoke MIDI**: `.kar` * **MuseData**: `.md` * **Score Writer**: `.scw` * **Bagpipe Music Writer**: `.bmw`, `.bww` * **Encore**: `.enc` **Scanned music** (requires `supportsTasks`, runs our music recognition and spends credits): * **PDF**: `.pdf` * **Images**: `.jpg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`, `.heic`, `.heif` The file is identified by its own content, so its extension and any declared type do not have to match. **One file per request**: a multi-page PDF or a multi-frame TIFF is fine, but several separate images of the same score (a page photographed at a time) need `createOmrJob`, which takes many inputs in one job and bills them as a single document. Its live limits are served by `getOmrCapabilities`. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. + + :param body: (required) + :type body: ScoreCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_score_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '202': "Task", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_score_without_preload_content( + self, + body: ScoreCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new score + + Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import a file to create the new Flat document. **Preferred formats**: * **MusicXML**: `.xml`, `.musicxml`, `.mxl` (compressed) — MIME: `vnd.recordare.musicxml+xml`, `vnd.recordare.musicxml`. This is the only format that preserves all notation data (articulations, dynamics, layout, etc.) with full round-trip support. * **MIDI**: `.mid`, `.midi` — MIME: `audio/midi`. Only preserves pitch, timing, and instrument data; notation details are lost. **Also supported** (converted to MusicXML on import, some notation details may be lost): * **Guitar Pro**: `.gp`, `.gp3`, `.gp4`, `.gp5`, `.gpx`, `.gtp` * **MuseScore**: `.mscz`, `.mscx` * **Finale**: `.musx` * **ABC notation**: `.abc` — MIME: `text/vnd.abc` * **PowerTab**: `.ptb` * **Capella**: `.cap`, `.capx` * **MEI**: `.mei` * **Overture**: `.ove` * **TablEdit**: `.tef` * **Band-in-a-Box**: `.mgu`, `.sgu` * **Karaoke MIDI**: `.kar` * **MuseData**: `.md` * **Score Writer**: `.scw` * **Bagpipe Music Writer**: `.bmw`, `.bww` * **Encore**: `.enc` **Scanned music** (requires `supportsTasks`, runs our music recognition and spends credits): * **PDF**: `.pdf` * **Images**: `.jpg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`, `.heic`, `.heif` The file is identified by its own content, so its extension and any declared type do not have to match. **One file per request**: a multi-page PDF or a multi-frame TIFF is fine, but several separate images of the same score (a page photographed at a time) need `createOmrJob`, which takes many inputs in one job and bills them as a single document. Its live limits are served by `getOmrCapabilities`. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. + + :param body: (required) + :type body: ScoreCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_score_serialize( + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '202': "Task", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_score_serialize( + self, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def create_score_revision( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreRevisionCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreRevision: + """Create a new revision + + Update a score by uploading a new revision for this one. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreRevisionCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_score_revision_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreRevision", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def create_score_revision_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreRevisionCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreRevision]: + """Create a new revision + + Update a score by uploading a new revision for this one. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreRevisionCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_score_revision_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreRevision", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def create_score_revision_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreRevisionCreation, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new revision + + Update a score by uploading a new revision for this one. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreRevisionCreation + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_score_revision_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreRevision", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_score_revision_serialize( + self, + score, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores/{score}/revisions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_score( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + now: Annotated[Optional[StrictBool], Field(description="If `true`, the score deletion will be scheduled to be done ASAP")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a score + + This method can be used by anyone that has at least read access to the document: - When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. - When called by a collaborator, the score will be unshared (i.e. removed from the account & own collections). - When called by another user that has the score in its collections, the score will be removed from all the user collections. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param now: If `true`, the score deletion will be scheduled to be done ASAP + :type now: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_serialize( + score=score, + now=now, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_score_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + now: Annotated[Optional[StrictBool], Field(description="If `true`, the score deletion will be scheduled to be done ASAP")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a score + + This method can be used by anyone that has at least read access to the document: - When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. - When called by a collaborator, the score will be unshared (i.e. removed from the account & own collections). - When called by another user that has the score in its collections, the score will be removed from all the user collections. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param now: If `true`, the score deletion will be scheduled to be done ASAP + :type now: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_serialize( + score=score, + now=now, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_score_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + now: Annotated[Optional[StrictBool], Field(description="If `true`, the score deletion will be scheduled to be done ASAP")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a score + + This method can be used by anyone that has at least read access to the document: - When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. - When called by a collaborator, the score will be unshared (i.e. removed from the account & own collections). - When called by another user that has the score in its collections, the score will be removed from all the user collections. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param now: If `true`, the score deletion will be scheduled to be done ASAP + :type now: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_serialize( + score=score, + now=now, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_score_serialize( + self, + score, + now, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if now is not None: + + _query_params.append(('now', now)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/scores/{score}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_score_comment( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a comment + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_comment_serialize( + score=score, + comment=comment, + event_properties=event_properties, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_score_comment_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a comment + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_comment_serialize( + score=score, + comment=comment, + event_properties=event_properties, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_score_comment_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a comment + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_comment_serialize( + score=score, + comment=comment, + event_properties=event_properties, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_score_comment_serialize( + self, + score, + comment, + event_properties, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if comment is not None: + _path_params['comment'] = comment + # process the query parameters + if event_properties is not None: + + _query_params.append(('eventProperties', event_properties)) + + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/scores/{score}/comments/{comment}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def delete_score_track( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove an audio or video track linked to the score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_track_serialize( + score=score, + track=track, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def delete_score_track_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove an audio or video track linked to the score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_track_serialize( + score=score, + track=track, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def delete_score_track_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove an audio or video track linked to the score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_score_track_serialize( + score=score, + track=track, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_score_track_serialize( + self, + score, + track, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if track is not None: + _path_params['track'] = track + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/scores/{score}/tracks/{track}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def edit_score( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreModification, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreDetails: + """Edit a score's metadata + + This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`). When editing the `title`, `subtitle`, `composer`, `lyricist`, `arranger` or `licenseText`, the metadatas will be instantly be updated, and a real-time action will be pushed to update the document lazily. This pending document modification will be automatically be saved as a new version by either a connected client or our internal versioning service. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreModification + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_score_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def edit_score_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreModification, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreDetails]: + """Edit a score's metadata + + This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`). When editing the `title`, `subtitle`, `composer`, `lyricist`, `arranger` or `licenseText`, the metadatas will be instantly be updated, and a real-time action will be pushed to update the document lazily. This pending document modification will be automatically be saved as a new version by either a connected client or our internal versioning service. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreModification + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_score_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def edit_score_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreModification, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit a score's metadata + + This API method allows you to change the metadata of a score document (e.g. its `title` or `privacy`), all the properties are optional. To edit the file itself, create a new revision using the appropriate method (`POST /v2/scores/{score}/revisions/{revision}`). When editing the `title`, `subtitle`, `composer`, `lyricist`, `arranger` or `licenseText`, the metadatas will be instantly be updated, and a real-time action will be pushed to update the document lazily. This pending document modification will be automatically be saved as a new version by either a connected client or our internal versioning service. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreModification + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_score_serialize( + score=score, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _edit_score_serialize( + self, + score, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/scores/{score}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def fork_score( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreFork, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreDetails: + """Fork a score + + This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to `private`. When using a [Flat for Education](https://flat.io/edu) account, the inline and contextualized comments will be accessible in the child document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreFork + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fork_score_serialize( + score=score, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def fork_score_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreFork, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreDetails]: + """Fork a score + + This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to `private`. When using a [Flat for Education](https://flat.io/edu) account, the inline and contextualized comments will be accessible in the child document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreFork + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fork_score_serialize( + score=score, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def fork_score_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreFork, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Fork a score + + This API call will make a copy of the last revision of the specified score and create a new score. The copy of the score will have a privacy set to `private`. When using a [Flat for Education](https://flat.io/edu) account, the inline and contextualized comments will be accessible in the child document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreFork + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._fork_score_serialize( + score=score, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _fork_score_serialize( + self, + score, + body, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores/{score}/fork', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_group_scores( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_group_scores_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_group_scores_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_scores_serialize( + self, + group, + parent, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + if parent is not None: + + _query_params.append(('parent', parent)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group}/scores', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreDetails: + """Get a score's metadata + + Get the details of a score identified by the `score` parameter in the URL. The currently authenticated user must have at least a read access to the document to use this API call. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreDetails]: + """Get a score's metadata + + Get the details of a score identified by the `score` parameter in the URL. The currently authenticated user must have at least a read access to the document to use this API call. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a score's metadata + + Get the details of a score identified by the `score` parameter in the URL. The currently authenticated user must have at least a read access to the document to use this API call. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreDetails", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_serialize( + self, + score, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_collaborator( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ResourceCollaborator: + """Get a collaborator + + Get the information about a collaborator (User or Group). + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) + :type collaborator: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_collaborator_serialize( + score=score, + collaborator=collaborator, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceCollaborator", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_collaborator_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ResourceCollaborator]: + """Get a collaborator + + Get the information about a collaborator (User or Group). + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) + :type collaborator: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_collaborator_serialize( + score=score, + collaborator=collaborator, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceCollaborator", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_collaborator_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a collaborator + + Get the information about a collaborator (User or Group). + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) + :type collaborator: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_collaborator_serialize( + score=score, + collaborator=collaborator, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ResourceCollaborator", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_collaborator_serialize( + self, + score, + collaborator, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if collaborator is not None: + _path_params['collaborator'] = collaborator + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/collaborators/{collaborator}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_collaborators( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ResourceCollaborator]: + """List the collaborators + + This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document. Collaborators can be a single user (the object `user` will be populated) or a group (the object `group` will be populated). + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_collaborators_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ResourceCollaborator]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_collaborators_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ResourceCollaborator]]: + """List the collaborators + + This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document. Collaborators can be a single user (the object `user` will be populated) or a group (the object `group` will be populated). + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_collaborators_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ResourceCollaborator]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_collaborators_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the collaborators + + This API call will list the different collaborators of a score and their rights on the document. The returned list will at least contain the owner of the document. Collaborators can be a single user (the object `user` will be populated) or a group (the object `group` will be populated). + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_collaborators_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ResourceCollaborator]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_collaborators_serialize( + self, + score, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/collaborators', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_comments( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + type: Annotated[Optional[StrictStr], Field(description="Filter the comments by type")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreComment]: + """List comments + + This method lists the different comments added on a music score (documents and inline) sorted by their post dates. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param type: Filter the comments by type + :type type: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_comments_serialize( + score=score, + type=type, + sort=sort, + direction=direction, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreComment]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_comments_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + type: Annotated[Optional[StrictStr], Field(description="Filter the comments by type")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreComment]]: + """List comments + + This method lists the different comments added on a music score (documents and inline) sorted by their post dates. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param type: Filter the comments by type + :type type: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_comments_serialize( + score=score, + type=type, + sort=sort, + direction=direction, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreComment]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_comments_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + type: Annotated[Optional[StrictStr], Field(description="Filter the comments by type")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List comments + + This method lists the different comments added on a music score (documents and inline) sorted by their post dates. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param type: Filter the comments by type + :type type: str + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_comments_serialize( + score=score, + type=type, + sort=sort, + direction=direction, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreComment]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_comments_serialize( + self, + score, + type, + sort, + direction, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/comments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_revision( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreRevision: + """Get a score revision + + When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific revision metadata. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revision_serialize( + score=score, + revision=revision, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreRevision", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_revision_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreRevision]: + """Get a score revision + + When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific revision metadata. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revision_serialize( + score=score, + revision=revision, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreRevision", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_revision_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a score revision + + When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to get a specific revision metadata. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revision_serialize( + score=score, + revision=revision, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreRevision", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_revision_serialize( + self, + score, + revision, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if revision is not None: + _path_params['revision'] = revision + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/revisions/{revision}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_revision_data( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + format: Annotated[StrictStr, Field(description="The format of the file you will retrieve")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + parts: Annotated[Optional[StrictStr], Field(description="An optional a set of parts uuid to be exported. This parameter must be composed of parts uuids separated by commas. For example \"59df645f-bb1c-f1b4-b573-d2afc4491f94,34ef645f-1aef-f3bc-1564-34cca4492b87\". ")] = None, + default_track: Annotated[Optional[StrictBool], Field(description="When `format` is `mp3`, this property is set to true and the score has a default `ScoreTrack` (mp3), this one will be returned instead of the playback file. ")] = None, + url: Annotated[Optional[StrictBool], Field(description="Returns a json with the `url` in it instead of redirecting ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Get a score revision data + + Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, ABC notation `abc`, MP3 `mp3`, WAV `wav`, MIDI `midi`, Flat `flat`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. ABC notation is a text format that cannot express everything a score contains. Like MIDI, the export is lossy: notation ABC has no equivalent for is approximated or dropped rather than failing the request. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param format: The format of the file you will retrieve (required) + :type format: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param parts: An optional a set of parts uuid to be exported. This parameter must be composed of parts uuids separated by commas. For example \"59df645f-bb1c-f1b4-b573-d2afc4491f94,34ef645f-1aef-f3bc-1564-34cca4492b87\". + :type parts: str + :param default_track: When `format` is `mp3`, this property is set to true and the score has a default `ScoreTrack` (mp3), this one will be returned instead of the playback file. + :type default_track: bool + :param url: Returns a json with the `url` in it instead of redirecting + :type url: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revision_data_serialize( + score=score, + revision=revision, + format=format, + sharing_key=sharing_key, + parts=parts, + default_track=default_track, + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_revision_data_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + format: Annotated[StrictStr, Field(description="The format of the file you will retrieve")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + parts: Annotated[Optional[StrictStr], Field(description="An optional a set of parts uuid to be exported. This parameter must be composed of parts uuids separated by commas. For example \"59df645f-bb1c-f1b4-b573-d2afc4491f94,34ef645f-1aef-f3bc-1564-34cca4492b87\". ")] = None, + default_track: Annotated[Optional[StrictBool], Field(description="When `format` is `mp3`, this property is set to true and the score has a default `ScoreTrack` (mp3), this one will be returned instead of the playback file. ")] = None, + url: Annotated[Optional[StrictBool], Field(description="Returns a json with the `url` in it instead of redirecting ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Get a score revision data + + Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, ABC notation `abc`, MP3 `mp3`, WAV `wav`, MIDI `midi`, Flat `flat`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. ABC notation is a text format that cannot express everything a score contains. Like MIDI, the export is lossy: notation ABC has no equivalent for is approximated or dropped rather than failing the request. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param format: The format of the file you will retrieve (required) + :type format: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param parts: An optional a set of parts uuid to be exported. This parameter must be composed of parts uuids separated by commas. For example \"59df645f-bb1c-f1b4-b573-d2afc4491f94,34ef645f-1aef-f3bc-1564-34cca4492b87\". + :type parts: str + :param default_track: When `format` is `mp3`, this property is set to true and the score has a default `ScoreTrack` (mp3), this one will be returned instead of the playback file. + :type default_track: bool + :param url: Returns a json with the `url` in it instead of redirecting + :type url: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revision_data_serialize( + score=score, + revision=revision, + format=format, + sharing_key=sharing_key, + parts=parts, + default_track=default_track, + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_revision_data_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + revision: Annotated[StrictStr, Field(description="Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. ")], + format: Annotated[StrictStr, Field(description="The format of the file you will retrieve")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + parts: Annotated[Optional[StrictStr], Field(description="An optional a set of parts uuid to be exported. This parameter must be composed of parts uuids separated by commas. For example \"59df645f-bb1c-f1b4-b573-d2afc4491f94,34ef645f-1aef-f3bc-1564-34cca4492b87\". ")] = None, + default_track: Annotated[Optional[StrictBool], Field(description="When `format` is `mp3`, this property is set to true and the score has a default `ScoreTrack` (mp3), this one will be returned instead of the playback file. ")] = None, + url: Annotated[Optional[StrictBool], Field(description="Returns a json with the `url` in it instead of redirecting ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a score revision data + + Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, ABC notation `abc`, MP3 `mp3`, WAV `wav`, MIDI `midi`, Flat `flat`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. ABC notation is a text format that cannot express everything a score contains. Like MIDI, the export is lossy: notation ABC has no equivalent for is approximated or dropped rather than failing the request. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param revision: Unique identifier of a score revision. You can use `last` to fetch the information related to the last version created. (required) + :type revision: str + :param format: The format of the file you will retrieve (required) + :type format: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param parts: An optional a set of parts uuid to be exported. This parameter must be composed of parts uuids separated by commas. For example \"59df645f-bb1c-f1b4-b573-d2afc4491f94,34ef645f-1aef-f3bc-1564-34cca4492b87\". + :type parts: str + :param default_track: When `format` is `mp3`, this property is set to true and the score has a default `ScoreTrack` (mp3), this one will be returned instead of the playback file. + :type default_track: bool + :param url: Returns a json with the `url` in it instead of redirecting + :type url: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revision_data_serialize( + score=score, + revision=revision, + format=format, + sharing_key=sharing_key, + parts=parts, + default_track=default_track, + url=url, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_revision_data_serialize( + self, + score, + revision, + format, + sharing_key, + parts, + default_track, + url, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if revision is not None: + _path_params['revision'] = revision + if format is not None: + _path_params['format'] = format + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + if parts is not None: + + _query_params.append(('parts', parts)) + + if default_track is not None: + + _query_params.append(('defaultTrack', default_track)) + + if url is not None: + + _query_params.append(('url', url)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/vnd.recordare.musicxml+xml', + 'application/vnd.recordare.musicxml', + 'audio/mp3', + 'audio/wav', + 'audio/midi', + 'image/png', + 'application/octet-stream' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/revisions/{revision}/{format}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_revisions( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreRevision]: + """List the revisions + + When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification. Depending the plan of the account, this list can be trunked to the few last revisions. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revisions_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreRevision]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_revisions_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreRevision]]: + """List the revisions + + When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification. Depending the plan of the account, this list can be trunked to the few last revisions. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revisions_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreRevision]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_revisions_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the revisions + + When creating a score or saving a new version of a score, a revision is created in our storage. This method allows you to list all of them, sorted by last modification. Depending the plan of the account, this list can be trunked to the few last revisions. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_revisions_serialize( + score=score, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreRevision]", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_revisions_serialize( + self, + score, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/revisions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_submissions( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[AssignmentSubmission]: + """List submissions related to the score + + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_submissions_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_submissions_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[AssignmentSubmission]]: + """List submissions related to the score + + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_submissions_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_submissions_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List submissions related to the score + + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_submissions_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_submissions_serialize( + self, + score, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/submissions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_score_track( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreTrack: + """Retrieve the details of an audio or video track linked to a score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_track_serialize( + score=score, + track=track, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrack", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_score_track_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreTrack]: + """Retrieve the details of an audio or video track linked to a score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_track_serialize( + score=score, + track=track, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrack", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_score_track_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve the details of an audio or video track linked to a score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_score_track_serialize( + score=score, + track=track, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrack", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_score_track_serialize( + self, + score, + track, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if track is not None: + _path_params['track'] = track + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/tracks/{track}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_user_likes( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + ids: Annotated[Optional[StrictBool], Field(description="Return only the identifiers of the scores")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List liked scores + + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param ids: Return only the identifiers of the scores + :type ids: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_likes_serialize( + user=user, + next=next, + previous=previous, + limit=limit, + ids=ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_user_likes_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + ids: Annotated[Optional[StrictBool], Field(description="Return only the identifiers of the scores")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List liked scores + + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param ids: Return only the identifiers of the scores + :type ids: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_likes_serialize( + user=user, + next=next, + previous=previous, + limit=limit, + ids=ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_user_likes_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + ids: Annotated[Optional[StrictBool], Field(description="Return only the identifiers of the scores")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List liked scores + + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param ids: Return only the identifiers of the scores + :type ids: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_likes_serialize( + user=user, + next=next, + previous=previous, + limit=limit, + ids=ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_likes_serialize( + self, + user, + next, + previous, + limit, + ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if ids is not None: + + _query_params.append(('ids', ids)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{user}/likes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_user_scores( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List user's scores + + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_scores_serialize( + user=user, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_user_scores_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List user's scores + + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_scores_serialize( + user=user, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_user_scores_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List user's scores + + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_scores_serialize( + user=user, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_scores_serialize( + self, + user, + paginate, + sort, + direction, + limit, + next, + previous, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + if paginate is not None: + + _query_params.append(('paginate', paginate)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{user}/scores', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def list_score_tracks( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="An assignment id with which all the tracks returned will be related to ")] = None, + list_auto_track: Annotated[Optional[StrictBool], Field(description="If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreTrack]: + """List the audio or video tracks linked to a score + + List all audio or video tracks linked to a score. **Access Control for Performance Submission Tracks:** Tracks with `purpose: 'performanceSubmission'` are filtered based on user role: * **Students**: Can only see their own performance submission tracks, plus all non-performance tracks * **Teachers and score admins**: Can see all tracks from all students The `assignment` query parameter can be used to filter tracks for a specific assignment, but the access control rules above still apply. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param assignment: An assignment id with which all the tracks returned will be related to + :type assignment: str + :param list_auto_track: If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track + :type list_auto_track: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_score_tracks_serialize( + score=score, + sharing_key=sharing_key, + assignment=assignment, + list_auto_track=list_auto_track, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreTrack]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def list_score_tracks_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="An assignment id with which all the tracks returned will be related to ")] = None, + list_auto_track: Annotated[Optional[StrictBool], Field(description="If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreTrack]]: + """List the audio or video tracks linked to a score + + List all audio or video tracks linked to a score. **Access Control for Performance Submission Tracks:** Tracks with `purpose: 'performanceSubmission'` are filtered based on user role: * **Students**: Can only see their own performance submission tracks, plus all non-performance tracks * **Teachers and score admins**: Can see all tracks from all students The `assignment` query parameter can be used to filter tracks for a specific assignment, but the access control rules above still apply. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param assignment: An assignment id with which all the tracks returned will be related to + :type assignment: str + :param list_auto_track: If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track + :type list_auto_track: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_score_tracks_serialize( + score=score, + sharing_key=sharing_key, + assignment=assignment, + list_auto_track=list_auto_track, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreTrack]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def list_score_tracks_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="An assignment id with which all the tracks returned will be related to ")] = None, + list_auto_track: Annotated[Optional[StrictBool], Field(description="If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List the audio or video tracks linked to a score + + List all audio or video tracks linked to a score. **Access Control for Performance Submission Tracks:** Tracks with `purpose: 'performanceSubmission'` are filtered based on user role: * **Students**: Can only see their own performance submission tracks, plus all non-performance tracks * **Teachers and score admins**: Can see all tracks from all students The `assignment` query parameter can be used to filter tracks for a specific assignment, but the access control rules above still apply. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :param assignment: An assignment id with which all the tracks returned will be related to + :type assignment: str + :param list_auto_track: If true, and if available, return last automatically synchronized Flat's mp3 export as an additional track + :type list_auto_track: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_score_tracks_serialize( + score=score, + sharing_key=sharing_key, + assignment=assignment, + list_auto_track=list_auto_track, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreTrack]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_score_tracks_serialize( + self, + score, + sharing_key, + assignment, + list_auto_track, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + if assignment is not None: + + _query_params.append(('assignment', assignment)) + + if list_auto_track is not None: + + _query_params.append(('listAutoTrack', list_auto_track)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/scores/{score}/tracks', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def mark_score_comment_resolved( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Mark the comment as resolved + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mark_score_comment_resolved_serialize( + score=score, + comment=comment, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def mark_score_comment_resolved_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Mark the comment as resolved + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mark_score_comment_resolved_serialize( + score=score, + comment=comment, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def mark_score_comment_resolved_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Mark the comment as resolved + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mark_score_comment_resolved_serialize( + score=score, + comment=comment, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _mark_score_comment_resolved_serialize( + self, + score, + comment, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if comment is not None: + _path_params['comment'] = comment + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/scores/{score}/comments/{comment}/resolved', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def mark_score_comment_unresolved( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Mark the comment as unresolved + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mark_score_comment_unresolved_serialize( + score=score, + comment=comment, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def mark_score_comment_unresolved_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Mark the comment as unresolved + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mark_score_comment_unresolved_serialize( + score=score, + comment=comment, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def mark_score_comment_unresolved_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Mark the comment as unresolved + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._mark_score_comment_unresolved_serialize( + score=score, + comment=comment, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _mark_score_comment_unresolved_serialize( + self, + score, + comment, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if comment is not None: + _path_params['comment'] = comment + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/scores/{score}/comments/{comment}/resolved', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def post_score_comment( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreCommentCreation, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreComment: + """Post a new comment + + Post a document or a contextualized comment on a document. Please note that this method includes an anti-spam system for public scores. We don't guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a `403` HTTP error and hidden from other users when the `spam` property is `true`. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreCommentCreation + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_score_comment_serialize( + score=score, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreComment", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def post_score_comment_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreCommentCreation, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreComment]: + """Post a new comment + + Post a document or a contextualized comment on a document. Please note that this method includes an anti-spam system for public scores. We don't guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a `403` HTTP error and hidden from other users when the `spam` property is `true`. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreCommentCreation + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_score_comment_serialize( + score=score, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreComment", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def post_score_comment_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + body: ScoreCommentCreation, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Post a new comment + + Post a document or a contextualized comment on a document. Please note that this method includes an anti-spam system for public scores. We don't guarantee that your comments will be accepted and displayed to end-user. Comments are be blocked by returning a `403` HTTP error and hidden from other users when the `spam` property is `true`. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param body: (required) + :type body: ScoreCommentCreation + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._post_score_comment_serialize( + score=score, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreComment", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _post_score_comment_serialize( + self, + score, + body, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores/{score}/comments', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def remove_score_collaborator( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a collaborator + + Remove the specified collaborator from the score + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) + :type collaborator: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_score_collaborator_serialize( + score=score, + collaborator=collaborator, + event_properties=event_properties, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def remove_score_collaborator_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a collaborator + + Remove the specified collaborator from the score + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) + :type collaborator: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_score_collaborator_serialize( + score=score, + collaborator=collaborator, + event_properties=event_properties, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def remove_score_collaborator_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a collaborator + + Remove the specified collaborator from the score + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) + :type collaborator: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_score_collaborator_serialize( + score=score, + collaborator=collaborator, + event_properties=event_properties, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_score_collaborator_serialize( + self, + score, + collaborator, + event_properties, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if collaborator is not None: + _path_params['collaborator'] = collaborator + # process the query parameters + if event_properties is not None: + + _query_params.append(('eventProperties', event_properties)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/scores/{score}/collaborators/{collaborator}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def untrash_score( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Untrash a score + + This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._untrash_score_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def untrash_score_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Untrash a score + + This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._untrash_score_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def untrash_score_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Untrash a score + + This method will remove the score from the `trash` collection and from the deletion queue, and add it back to the original collections. + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._untrash_score_serialize( + score=score, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _untrash_score_serialize( + self, + score, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/scores/{score}/untrash', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_score_comment( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + body: ScoreCommentUpdate, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreComment: + """Update an existing comment + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param body: (required) + :type body: ScoreCommentUpdate + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_score_comment_serialize( + score=score, + comment=comment, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreComment", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_score_comment_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + body: ScoreCommentUpdate, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreComment]: + """Update an existing comment + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param body: (required) + :type body: ScoreCommentUpdate + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_score_comment_serialize( + score=score, + comment=comment, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreComment", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_score_comment_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + body: ScoreCommentUpdate, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an existing comment + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param comment: Unique identifier of a sheet music comment (required) + :type comment: str + :param body: (required) + :type body: ScoreCommentUpdate + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_score_comment_serialize( + score=score, + comment=comment, + body=body, + sharing_key=sharing_key, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreComment", + '402': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_score_comment_serialize( + self, + score, + comment, + body, + sharing_key, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if comment is not None: + _path_params['comment'] = comment + # process the query parameters + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/scores/{score}/comments/{comment}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def update_score_track( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + body: ScoreTrackUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ScoreTrack: + """Update an audio or video track linked to a score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :param body: (required) + :type body: ScoreTrackUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_score_track_serialize( + score=score, + track=track, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrack", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def update_score_track_with_http_info( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + body: ScoreTrackUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ScoreTrack]: + """Update an audio or video track linked to a score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :param body: (required) + :type body: ScoreTrackUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_score_track_serialize( + score=score, + track=track, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrack", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def update_score_track_without_preload_content( + self, + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + track: Annotated[StrictStr, Field(description="Unique identifier of a score audio track ")], + body: ScoreTrackUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an audio or video track linked to a score + + + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str + :param track: Unique identifier of a score audio track (required) + :type track: str + :param body: (required) + :type body: ScoreTrackUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_score_track_serialize( + score=score, + track=track, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ScoreTrack", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_score_track_serialize( + self, + score, + track, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if score is not None: + _path_params['score'] = score + if track is not None: + _path_params['track'] = track + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/scores/{score}/tracks/{track}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/task_api.py b/flat_api/aio/api/task_api.py new file mode 100644 index 0000000..640f7bb --- /dev/null +++ b/flat_api/aio/api/task_api.py @@ -0,0 +1,302 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictStr +from typing_extensions import Annotated +from flat_api.aio.models.task import Task + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class TaskApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def get_task( + self, + task: Annotated[StrictStr, Field(description="Unique identifier for the task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Task: + """Get a task details + + This method can be used to follow a task progression, for example while a score is being exported. + + :param task: Unique identifier for the task (required) + :type task: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_serialize( + task=task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_task_with_http_info( + self, + task: Annotated[StrictStr, Field(description="Unique identifier for the task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Task]: + """Get a task details + + This method can be used to follow a task progression, for example while a score is being exported. + + :param task: Unique identifier for the task (required) + :type task: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_serialize( + task=task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_task_without_preload_content( + self, + task: Annotated[StrictStr, Field(description="Unique identifier for the task")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a task details + + This method can be used to follow a task progression, for example while a score is being exported. + + :param task: Unique identifier for the task (required) + :type task: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_task_serialize( + task=task, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Task", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_task_serialize( + self, + task, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if task is not None: + _path_params['task'] = task + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/tasks/{task}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api/user_api.py b/flat_api/aio/api/user_api.py new file mode 100644 index 0000000..9113164 --- /dev/null +++ b/flat_api/aio/api/user_api.py @@ -0,0 +1,999 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.score_details import ScoreDetails +from flat_api.aio.models.user_public import UserPublic + +from flat_api.aio.api_client import ApiClient, RequestSerialized +from flat_api.aio.api_response import ApiResponse +from flat_api.aio.rest import RESTResponseType + + +class UserApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def get_user( + self, + user: Annotated[StrictStr, Field(description="This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user. ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserPublic: + """Get a public user profile + + Get a profile of a Flat or Flat for Education User. + + :param user: This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user. (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserPublic", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_user_with_http_info( + self, + user: Annotated[StrictStr, Field(description="This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user. ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserPublic]: + """Get a public user profile + + Get a profile of a Flat or Flat for Education User. + + :param user: This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user. (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserPublic", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_user_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user. ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get a public user profile + + Get a profile of a Flat or Flat for Education User. + + :param user: This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user. (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_serialize( + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "UserPublic", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_serialize( + self, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_user_likes( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + ids: Annotated[Optional[StrictBool], Field(description="Return only the identifiers of the scores")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List liked scores + + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param ids: Return only the identifiers of the scores + :type ids: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_likes_serialize( + user=user, + next=next, + previous=previous, + limit=limit, + ids=ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_user_likes_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + ids: Annotated[Optional[StrictBool], Field(description="Return only the identifiers of the scores")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List liked scores + + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param ids: Return only the identifiers of the scores + :type ids: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_likes_serialize( + user=user, + next=next, + previous=previous, + limit=limit, + ids=ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_user_likes_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + ids: Annotated[Optional[StrictBool], Field(description="Return only the identifiers of the scores")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List liked scores + + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param ids: Return only the identifiers of the scores + :type ids: bool + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_likes_serialize( + user=user, + next=next, + previous=previous, + limit=limit, + ids=ids, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_likes_serialize( + self, + user, + next, + previous, + limit, + ids, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if ids is not None: + + _query_params.append(('ids', ids)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{user}/likes', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + async def get_user_scores( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List user's scores + + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_scores_serialize( + user=user, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_user_scores_with_http_info( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List user's scores + + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_scores_serialize( + user=user, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_user_scores_without_preload_content( + self, + user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List user's scores + + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. + + :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) + :type user: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_user_scores_serialize( + user=user, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_scores_serialize( + self, + user, + paginate, + sort, + direction, + limit, + next, + previous, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if user is not None: + _path_params['user'] = user + # process the query parameters + if paginate is not None: + + _query_params.append(('paginate', paginate)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/users/{user}/scores', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/aio/api_client.py b/flat_api/aio/api_client.py new file mode 100644 index 0000000..f1bfeb1 --- /dev/null +++ b/flat_api/aio/api_client.py @@ -0,0 +1,823 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal +import json +import mimetypes +import os +import re +import tempfile +import uuid + +from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr + +from flat_api.aio.configuration import Configuration +from flat_api.aio.api_response import ApiResponse, T as ApiResponseT +import flat_api.aio.models +from flat_api.aio import rest +from flat_api.aio.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] + +class ApiClient: + """Generic API client for OpenAPI client library builds. + + OpenAPI generic API client. This client handles the client- + server communication, and is invariant across implementations. Specifics of + the methods and models for each application are generated from the OpenAPI + templates. + + :param configuration: .Configuration object for this client + :param header_name: a header to pass when making calls to the API. + :param header_value: a header value to pass when making calls to + the API. + :param cookie: a cookie to include in the header when making calls + to the API + """ + + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'UUID': uuid.UUID, + 'object': object, + } + _pool = None + + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: + # use default configuration if none is provided + if configuration is None: + configuration = Configuration.get_default() + self.configuration = configuration + + self.rest_client = rest.RESTClientObject(configuration) + self.default_headers = {} + if header_name is not None: + self.default_headers[header_name] = header_value + self.cookie = cookie + # Set default User-Agent. + self.user_agent = 'OpenAPI-Generator/2.0.0/python' + self.client_side_validation = configuration.client_side_validation + + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() + + async def close(self): + await self.rest_client.close() + + @property + def user_agent(self): + """User agent for this API client""" + return self.default_headers['User-Agent'] + + @user_agent.setter + def user_agent(self, value): + self.default_headers['User-Agent'] = value + + def set_default_header(self, header_name, header_value): + self.default_headers[header_name] = header_value + + + _default = None + + @classmethod + def get_default(cls): + """Return new instance of ApiClient. + + This method returns newly created, based on default constructor, + object of ApiClient class or returns a copy of default + ApiClient. + + :return: The ApiClient object. + """ + if cls._default is None: + cls._default = ApiClient() + return cls._default + + @classmethod + def set_default(cls, default): + """Set default instance of ApiClient. + + It stores default ApiClient. + + :param default: object of ApiClient. + """ + cls._default = default + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ + + config = self.configuration + + # header parameters + header_params = header_params or {} + header_params.update(self.default_headers) + if self.cookie: + header_params['Cookie'] = self.cookie + if header_params: + header_params = self.sanitize_for_serialization(header_params) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) + + # path parameters + if path_params: + path_params = self.sanitize_for_serialization(path_params) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) + for k, v in path_params: + # specified safe chars, encode everything + resource_path = resource_path.replace( + '{%s}' % k, + quote(str(v), safe=config.safe_chars_for_path_param) + ) + + # post parameters + if post_params or files: + post_params = post_params if post_params else [] + post_params = self.sanitize_for_serialization(post_params) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) + + # auth setting + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) + + # body + if body: + body = self.sanitize_for_serialization(body) + + # request url + if _host is None or self.configuration.ignore_operation_servers: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + async def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = await self.rest_client.request( + method, url, + headers=header_params, + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e + + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + 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 the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it. + if response_type is None and str(response_data.status) not in response_types_map \ + and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \ + and 'default' in response_types_map: + response_type = response_types_map['default'] + + # deserialize response data + response_text = None + return_data = None + try: + if response_type in ("bytearray", "bytes"): + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.headers.get('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.headers, + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): + """Builds a JSON POST object. + + If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() + If obj is str, int, long, float, bool, return directly. + If obj is datetime.datetime, datetime.date + convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. + If obj is list, sanitize each element in the list. + If obj is dict, return the dict. + If obj is OpenAPI model, return the properties dict. + + :param obj: The data to serialize. + :return: The serialized form of data. + """ + if obj is None: + return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): + return obj + elif isinstance(obj, uuid.UUID): + return str(obj) + elif isinstance(obj, list): + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] + elif isinstance(obj, tuple): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): + return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) + elif isinstance(obj, dict): + return { + key: self.sanitize_for_serialization(val) + for key, val in obj.items() + } + + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return self.sanitize_for_serialization(obj_dict) + + + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): + """Deserializes response into an object. + + :param response: RESTResponse object to be deserialized. + :param response_type: class literal for + deserialized object, or string of class name. + :param content_type: content type of response. + + :return: deserialized object. + """ + + # fetch data from response object + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) + + return self.__deserialize(data, response_type) + + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. + + :param data: dict, list or str. + :param klass: class literal, or string of class name. + + :return: object. + """ + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(flat_api.aio.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) + else: + return self.__deserialize_model(data, klass) + + def parameters_to_tuples(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: Parameters as list of tuples, collections formatted + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, value) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(str(value) for value in v))) + else: + new_params.append((k, v)) + return new_params + + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): + """Builds form parameters. + + :param files: File parameters. + :return: Form parameters with files. + """ + params = [] + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) + return params + + def select_header_accept(self, accepts: List[str]) -> Optional[str]: + """Returns `Accept` based on an array of accepts provided. + + :param accepts: List of headers. + :return: Accept (e.g. application/json). + """ + if not accepts: + return None + + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept + + return accepts[0] + + def select_header_content_type(self, content_types): + """Returns `Content-Type` based on an array of content_types provided. + + :param content_types: List of content-types. + :return: Content-Type (e.g. application/json). + """ + if not content_types: + return None + + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: + """Updates header and query params based on authentication setting. + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. + """ + if not auth_settings: + return + + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + if not 'Cookie' in headers: + headers['Cookie'] = "" + else: + headers['Cookie'] += "; " + # Account for cookie value containing spaces and special characters + cookie_value = str(auth_setting['value']) + if not re.match("^\".*\"$", cookie_value): + cookie_value = cookie_value.replace("\"", "\\\"") + cookie_value = f"\"{cookie_value}\"" + headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + + def __deserialize_file(self, response): + """Deserializes body to file + + Saves response body into a file in a temporary folder, + using the filename from the `Content-Disposition` header if provided. + + handle file downloading + save response body into a tmp file and return the instance + + :param response: RESTResponse. + :return: file path. + """ + fd, path = tempfile.mkstemp(dir=self.configuration.temp_folder_path) + os.close(fd) + os.remove(path) + + content_disposition = response.headers.get("Content-Disposition") + if content_disposition: + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) + path = os.path.join(os.path.dirname(path), filename) + + with open(path, "wb") as f: + f.write(response.data) + + return path + + def __deserialize_primitive(self, data, klass): + """Deserializes string to primitive type. + + :param data: str. + :param klass: class literal. + + :return: int, long, float, str, bool. + """ + try: + return klass(data) + except UnicodeEncodeError: + return str(data) + except TypeError: + return data + + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): + """Deserializes string to date. + + :param string: str. + :return: date. + """ + try: + return parse(string).date() + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason="Failed to parse `{0}` as date object".format(string) + ) + + def __deserialize_datetime(self, string): + """Deserializes string to datetime. + + The string should be in iso8601 datetime format. + + :param string: str. + :return: datetime. + """ + try: + return parse(string) + except ImportError: + return string + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as datetime object" + .format(string) + ) + ) + + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): + """Deserializes list or dict to model. + + :param data: dict, list. + :param klass: class literal. + :return: model object. + """ + + return klass.from_dict(data) diff --git a/flat_api/aio/api_response.py b/flat_api/aio/api_response.py new file mode 100644 index 0000000..9bc7c11 --- /dev/null +++ b/flat_api/aio/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/flat_api/aio/configuration.py b/flat_api/aio/configuration.py new file mode 100644 index 0000000..465523f --- /dev/null +++ b/flat_api/aio/configuration.py @@ -0,0 +1,627 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import aiohttp +import aiohttp_retry +import base64 +import copy +import http.client as httplib +import logging +from logging import FileHandler +import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self + + + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "OAuth2": OAuth2AuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Configuration: + """This class contains various settings of the API client. + + :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. + :param api_key: Dict to store API key(s). + Each entry in the dict specifies an API key. + The dict key is the name of the security scheme in the OAS specification. + The dict value is the API key secret. + :param api_key_prefix: Dict to store API prefix (e.g. Bearer). + The dict key is the name of the security scheme in the OAS specification. + The dict value is an API key prefix when generating the auth data. + :param username: Username for HTTP basic authentication. + :param password: Password for HTTP basic authentication. + :param access_token: Access token. + :param server_index: Index to servers configuration. + :param server_variables: Mapping with string values to replace variables in + templated server configuration. The validation of enums is performed for + variables with defined enum values before. + :param server_operation_index: Mapping from operation ID to an index to server + 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. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: int | aiohttp_retry.RetryOptionsBase - Retry configuration. + :param trace_configs: list of aiohttp.TraceConfig instances forwarded to + aiohttp.ClientSession for tracing/instrumentation (e.g. OpenTelemetry). + :param tcp_connector_limit_per_host: Per-host concurrency cap forwarded to + aiohttp.TCPConnector(limit_per_host=...). None leaves aiohttp's default (0 = unlimited). + :param client_session_kwargs: Extra keyword arguments merged into + aiohttp.ClientSession(**kwargs) (e.g. json_serialize=orjson.dumps, + cookie_jar=aiohttp.DummyCookieJar()). + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. + + :Example: + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, aiohttp_retry.RetryOptionsBase]] = None, + trace_configs: Optional[List[aiohttp.TraceConfig]] = None, + tcp_connector_limit_per_host: Optional[int] = None, + client_session_kwargs: Optional[Dict[str, Any]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + self._base_path = "https://api.flat.io/v2" if host is None else host + """Default Base url + """ + self.server_index = 0 if server_index is None and host is None else server_index + self.server_operation_index = server_operation_index or {} + """Default server index + """ + self.server_variables = server_variables or {} + self.server_operation_variables = server_operation_variables or {} + """Default server variables + """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ + self.temp_folder_path = None + """Temp file folder for downloading files + """ + # Authentication Settings + self.api_key = {} + if api_key: + self.api_key = api_key + """dict to store API key(s) + """ + self.api_key_prefix = {} + if api_key_prefix: + self.api_key_prefix = api_key_prefix + """dict to store API prefix (e.g. Bearer) + """ + self.refresh_api_key_hook = None + """function hook to refresh API key if expired + """ + self.username = username + """Username for HTTP basic authentication + """ + self.password = password + """Password for HTTP basic authentication + """ + self.access_token = access_token + """Access token + """ + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("flat_api_async") + self.logger_format = '%(asctime)s %(levelname)s %(message)s' + """Log format + """ + self.logger_stream_handler = None + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ + self.logger_file = None + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ + + self.verify_ssl = verify_ssl + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = cert_file + """client certificate file + """ + self.key_file = key_file + """client key file + """ + self.assert_hostname = assert_hostname + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = tls_server_name + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ + + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else 100 + """This value is passed to the aiohttp to limit simultaneous connections. + None in the constructor is coerced to default 100. + """ + + self.proxy = proxy + """Proxy URL + """ + self.proxy_headers = proxy_headers + """Proxy headers + """ + self.safe_chars_for_path_param = safe_chars_for_path_param + """Safe chars for path_param + """ + self.retries = retries + """Retry configuration + """ + self.trace_configs = trace_configs + """aiohttp.TraceConfig list forwarded to ClientSession for tracing. + """ + self.tcp_connector_limit_per_host = tcp_connector_limit_per_host + """Per-host concurrency cap forwarded to TCPConnector. + """ + self.client_session_kwargs = client_session_kwargs + """Extra kwargs merged into aiohttp.ClientSession(**kwargs). + + """ + # Enable client side validation + self.client_side_validation = client_side_validation + + self.socket_options = socket_options + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = datetime_format + """datetime format + """ + + self.date_format = date_format + """date format + """ + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setter to re-create the file handler (excluded from __dict__ copy) + result.logger_file = self.logger_file + + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + + @classmethod + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ + cls._default = default + + @classmethod + def get_default_copy(cls) -> Self: + """Deprecated. Please use `get_default` instead. + + Deprecated. Please use `get_default` instead. + + :return: The configuration object. + """ + return cls.get_default() + + @classmethod + def get_default(cls) -> Self: + """Return the default configuration. + + This method returns newly created, based on default constructor, + object of Configuration class or returns a copy of default + configuration. + + :return: The configuration object. + """ + if cls._default is None: + cls._default = cls() + return cls._default + + @property + def logger_file(self) -> Optional[str]: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + return self.__logger_file + + @logger_file.setter + def logger_file(self, value: Optional[str]) -> None: + """The logger file. + + If the logger_file is None, then add stream handler and remove file + handler. Otherwise, add file handler and remove stream handler. + + :param value: The logger_file path. + :type: str + """ + self.__logger_file = value + if self.__logger_file: + # If set logging file, + # then add file handler and remove stream handler. + self.logger_file_handler = logging.FileHandler(self.__logger_file) + self.logger_file_handler.setFormatter(self.logger_formatter) + for _, logger in self.logger.items(): + logger.addHandler(self.logger_file_handler) + + @property + def debug(self) -> bool: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + return self.__debug + + @debug.setter + def debug(self, value: bool) -> None: + """Debug status + + :param value: The debug status, True or False. + :type: bool + """ + self.__debug = value + if self.__debug: + # if debug status is True, turn on debug logging + for _, logger in self.logger.items(): + logger.setLevel(logging.DEBUG) + # turn on httplib debug + httplib.HTTPConnection.debuglevel = 1 + else: + # if debug status is False, turn off debug logging, + # setting log level to default `logging.WARNING` + for _, logger in self.logger.items(): + logger.setLevel(logging.WARNING) + # turn off httplib debug + httplib.HTTPConnection.debuglevel = 0 + + @property + def logger_format(self) -> str: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + return self.__logger_format + + @logger_format.setter + def logger_format(self, value: str) -> None: + """The logger format. + + The logger_formatter will be updated when sets logger_format. + + :param value: The format string. + :type: str + """ + self.__logger_format = value + self.logger_formatter = logging.Formatter(self.__logger_format) + + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: + """Gets API key (with prefix if set). + + :param identifier: The identifier of apiKey. + :param alias: The alternative identifier of apiKey. + :return: The token for api key authentication. + """ + if self.refresh_api_key_hook is not None: + self.refresh_api_key_hook(self) + key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) + if key: + prefix = self.api_key_prefix.get( + identifier, self.api_key_prefix.get(alias) if alias is not None else None) + if prefix: + return "%s %s" % (prefix, key) + else: + return key + + return None + + def get_basic_auth_token(self) -> Optional[str]: + """Gets HTTP basic authentication header (string). + + :return: The token for basic HTTP authentication. + """ + username = "" + if self.username is not None: + username = self.username + password = "" + if self.password is not None: + password = self.password + + return "Basic " + base64.b64encode( + (username + ":" + password).encode('utf-8') + ).decode('utf-8') + + def auth_settings(self)-> AuthSettings: + """Gets Auth Settings dict for api client. + + :return: The Auth Settings information dict. + """ + auth: AuthSettings = {} + if self.access_token is not None: + auth['OAuth2'] = { + 'type': 'oauth2', + 'in': 'header', + 'key': 'Authorization', + 'value': 'Bearer ' + self.access_token + } + return auth + + def to_debug_report(self) -> str: + """Gets the essential information for debugging. + + :return: The report for debugging. + """ + return "Python SDK Debug Report:\n"\ + "OS: {env}\n"\ + "Python Version: {pyversion}\n"\ + "Version of the API: 2.26.0\n"\ + "SDK Package Version: 2.0.0".\ + format(env=sys.platform, pyversion=sys.version) + + def get_host_settings(self) -> List[HostSetting]: + """Gets an array of host settings + + :return: An array of host settings + """ + return [ + { + 'url': "https://api.flat.io/v2", + 'description': "No description provided", + } + ] + + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: + """Gets host URL based on the index and variables + :param index: array index of the host settings + :param variables: hash of variable and the corresponding value + :param servers: an array of host settings or None + :return: URL based on host settings + """ + if index is None: + return self._base_path + + variables = {} if variables is None else variables + servers = self.get_host_settings() if servers is None else servers + + try: + server = servers[index] + except IndexError: + raise ValueError( + "Invalid index {0} when selecting the host settings. " + "Must be less than {1}".format(index, len(servers))) + + url = server['url'] + + # go through variables and replace placeholders + for variable_name, variable in server.get('variables', {}).items(): + used_value = variables.get( + variable_name, variable['default_value']) + + if 'enum_values' in variable \ + and variable['enum_values'] \ + and used_value not in variable['enum_values']: + raise ValueError( + "The variable `{0}` in the host URL has invalid value " + "{1}. Must be {2}.".format( + variable_name, variables[variable_name], + variable['enum_values'])) + + url = url.replace("{" + variable_name + "}", used_value) + + return url + + @property + def host(self) -> str: + """Return generated host.""" + return self.get_host_from_settings(self.server_index, variables=self.server_variables) + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value + self.server_index = None diff --git a/flat_api/aio/exceptions.py b/flat_api/aio/exceptions.py new file mode 100644 index 0000000..005a786 --- /dev/null +++ b/flat_api/aio/exceptions.py @@ -0,0 +1,219 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.headers + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result diff --git a/flat_api/aio/models/__init__.py b/flat_api/aio/models/__init__.py new file mode 100644 index 0000000..153edd0 --- /dev/null +++ b/flat_api/aio/models/__init__.py @@ -0,0 +1,214 @@ +# coding: utf-8 + +# flake8: noqa +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +# import models into model package +from flat_api.aio.models.add_group_user200_response import AddGroupUser200Response +from flat_api.aio.models.add_group_user_request import AddGroupUserRequest +from flat_api.aio.models.api_access_token import ApiAccessToken +from flat_api.aio.models.app_scopes import AppScopes +from flat_api.aio.models.assignment import Assignment +from flat_api.aio.models.assignment_capabilities import AssignmentCapabilities +from flat_api.aio.models.assignment_capabilities_can_publish_in_class_error import AssignmentCapabilitiesCanPublishInClassError +from flat_api.aio.models.assignment_copy import AssignmentCopy +from flat_api.aio.models.assignment_copy_response import AssignmentCopyResponse +from flat_api.aio.models.assignment_copy_to_class import AssignmentCopyToClass +from flat_api.aio.models.assignment_copy_to_resource_library import AssignmentCopyToResourceLibrary +from flat_api.aio.models.assignment_group import AssignmentGroup +from flat_api.aio.models.assignment_submission import AssignmentSubmission +from flat_api.aio.models.assignment_submission_comment import AssignmentSubmissionComment +from flat_api.aio.models.assignment_submission_comment_creation import AssignmentSubmissionCommentCreation +from flat_api.aio.models.assignment_submission_comments import AssignmentSubmissionComments +from flat_api.aio.models.assignment_submission_history import AssignmentSubmissionHistory +from flat_api.aio.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment +from flat_api.aio.models.assignment_submission_history_state import AssignmentSubmissionHistoryState +from flat_api.aio.models.assignment_submission_lti import AssignmentSubmissionLti +from flat_api.aio.models.assignment_submission_playback import AssignmentSubmissionPlayback +from flat_api.aio.models.assignment_submission_state import AssignmentSubmissionState +from flat_api.aio.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode +from flat_api.aio.models.assignment_submission_update import AssignmentSubmissionUpdate +from flat_api.aio.models.assignment_type import AssignmentType +from flat_api.aio.models.assignment_update import AssignmentUpdate +from flat_api.aio.models.class_assignment import ClassAssignment +from flat_api.aio.models.class_assignment_all_of_canvas import ClassAssignmentAllOfCanvas +from flat_api.aio.models.class_assignment_all_of_lti import ClassAssignmentAllOfLti +from flat_api.aio.models.class_assignment_all_of_mfc import ClassAssignmentAllOfMfc +from flat_api.aio.models.class_assignment_update import ClassAssignmentUpdate +from flat_api.aio.models.class_assignment_update_all_of_google_classroom import ClassAssignmentUpdateAllOfGoogleClassroom +from flat_api.aio.models.class_assignment_update_all_of_microsoft_graph import ClassAssignmentUpdateAllOfMicrosoftGraph +from flat_api.aio.models.class_attachment_creation import ClassAttachmentCreation +from flat_api.aio.models.class_creation import ClassCreation +from flat_api.aio.models.class_details import ClassDetails +from flat_api.aio.models.class_details_canvas import ClassDetailsCanvas +from flat_api.aio.models.class_details_clever import ClassDetailsClever +from flat_api.aio.models.class_details_google_classroom import ClassDetailsGoogleClassroom +from flat_api.aio.models.class_details_google_drive import ClassDetailsGoogleDrive +from flat_api.aio.models.class_details_issues import ClassDetailsIssues +from flat_api.aio.models.class_details_issues_sync_inner import ClassDetailsIssuesSyncInner +from flat_api.aio.models.class_details_lti import ClassDetailsLti +from flat_api.aio.models.class_details_mfc import ClassDetailsMfc +from flat_api.aio.models.class_details_microsoft_graph import ClassDetailsMicrosoftGraph +from flat_api.aio.models.class_grade_level import ClassGradeLevel +from flat_api.aio.models.class_roles import ClassRoles +from flat_api.aio.models.class_state import ClassState +from flat_api.aio.models.class_update import ClassUpdate +from flat_api.aio.models.collection import Collection +from flat_api.aio.models.collection_app import CollectionApp +from flat_api.aio.models.collection_capabilities import CollectionCapabilities +from flat_api.aio.models.collection_contents import CollectionContents +from flat_api.aio.models.collection_creation import CollectionCreation +from flat_api.aio.models.collection_modification import CollectionModification +from flat_api.aio.models.collection_privacy import CollectionPrivacy +from flat_api.aio.models.collection_type import CollectionType +from flat_api.aio.models.create_lti_configuration200_response import CreateLtiConfiguration200Response +from flat_api.aio.models.credit_transaction import CreditTransaction +from flat_api.aio.models.edu_library import EduLibrary +from flat_api.aio.models.edu_resource import EduResource +from flat_api.aio.models.edu_resource_assignment_creation import EduResourceAssignmentCreation +from flat_api.aio.models.edu_resource_capabilities import EduResourceCapabilities +from flat_api.aio.models.edu_resource_copy import EduResourceCopy +from flat_api.aio.models.edu_resource_creation import EduResourceCreation +from flat_api.aio.models.edu_resource_folder import EduResourceFolder +from flat_api.aio.models.edu_resource_lti_link import EduResourceLtiLink +from flat_api.aio.models.edu_resource_move import EduResourceMove +from flat_api.aio.models.edu_resource_privacy import EduResourcePrivacy +from flat_api.aio.models.edu_resource_resource import EduResourceResource +from flat_api.aio.models.edu_resource_type import EduResourceType +from flat_api.aio.models.edu_resource_update import EduResourceUpdate +from flat_api.aio.models.edu_resource_use_in_class import EduResourceUseInClass +from flat_api.aio.models.flat_error_response import FlatErrorResponse +from flat_api.aio.models.google_classroom_coursework import GoogleClassroomCoursework +from flat_api.aio.models.google_classroom_submission import GoogleClassroomSubmission +from flat_api.aio.models.grade import Grade +from flat_api.aio.models.group import Group +from flat_api.aio.models.group_creation import GroupCreation +from flat_api.aio.models.group_details import GroupDetails +from flat_api.aio.models.group_type import GroupType +from flat_api.aio.models.license_mode import LicenseMode +from flat_api.aio.models.license_sources import LicenseSources +from flat_api.aio.models.lms_name import LmsName +from flat_api.aio.models.lti_configuration import LtiConfiguration +from flat_api.aio.models.lti_configuration1p1 import LtiConfiguration1p1 +from flat_api.aio.models.lti_configuration1p1_all_of_tool import LtiConfiguration1p1AllOfTool +from flat_api.aio.models.lti_configuration1p3 import LtiConfiguration1p3 +from flat_api.aio.models.lti_configuration1p3_base import LtiConfiguration1p3Base +from flat_api.aio.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.aio.models.lti_configuration1p3_base_supported_services_ags import LtiConfiguration1p3BaseSupportedServicesAgs +from flat_api.aio.models.lti_configuration1p3_base_supported_services_deep_linking import LtiConfiguration1p3BaseSupportedServicesDeepLinking +from flat_api.aio.models.lti_configuration1p3_base_supported_services_nrps import LtiConfiguration1p3BaseSupportedServicesNrps +from flat_api.aio.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from flat_api.aio.models.lti_configuration1p3_deployment import LtiConfiguration1p3Deployment +from flat_api.aio.models.lti_configuration1p3_dynamic import LtiConfiguration1p3Dynamic +from flat_api.aio.models.lti_configuration1p3_manual import LtiConfiguration1p3Manual +from flat_api.aio.models.lti_configuration_base import LtiConfigurationBase +from flat_api.aio.models.lti_configuration_create import LtiConfigurationCreate +from flat_api.aio.models.lti_configuration_create1p1 import LtiConfigurationCreate1p1 +from flat_api.aio.models.lti_configuration_create1p3_deployment import LtiConfigurationCreate1p3Deployment +from flat_api.aio.models.lti_configuration_create1p3_dynamic import LtiConfigurationCreate1p3Dynamic +from flat_api.aio.models.lti_configuration_create1p3_dynamic_platform_info import LtiConfigurationCreate1p3DynamicPlatformInfo +from flat_api.aio.models.lti_configuration_create1p3_manual import LtiConfigurationCreate1p3Manual +from flat_api.aio.models.lti_configuration_update import LtiConfigurationUpdate +from flat_api.aio.models.lti_configuration_update_deployment import LtiConfigurationUpdateDeployment +from flat_api.aio.models.lti_configuration_update_standalone import LtiConfigurationUpdateStandalone +from flat_api.aio.models.lti_credentials import LtiCredentials +from flat_api.aio.models.lti_credentials_creation import LtiCredentialsCreation +from flat_api.aio.models.media_attachment import MediaAttachment +from flat_api.aio.models.media_score_sharing_mode import MediaScoreSharingMode +from flat_api.aio.models.microsoft_graph_assignment import MicrosoftGraphAssignment +from flat_api.aio.models.microsoft_graph_submission import MicrosoftGraphSubmission +from flat_api.aio.models.omr_capabilities import OmrCapabilities +from flat_api.aio.models.omr_details_step_data import OmrDetailsStepData +from flat_api.aio.models.omr_details_submission import OmrDetailsSubmission +from flat_api.aio.models.omr_detected_instrument import OmrDetectedInstrument +from flat_api.aio.models.omr_imported_metadata import OmrImportedMetadata +from flat_api.aio.models.omr_instrument_override import OmrInstrumentOverride +from flat_api.aio.models.omr_job import OmrJob +from flat_api.aio.models.omr_job_creation import OmrJobCreation +from flat_api.aio.models.omr_job_file_metadata import OmrJobFileMetadata +from flat_api.aio.models.omr_job_file_upload import OmrJobFileUpload +from flat_api.aio.models.omr_job_file_upload_result import OmrJobFileUploadResult +from flat_api.aio.models.omr_job_input_file import OmrJobInputFile +from flat_api.aio.models.omr_job_output import OmrJobOutput +from flat_api.aio.models.omr_job_progress import OmrJobProgress +from flat_api.aio.models.omr_job_result import OmrJobResult +from flat_api.aio.models.omr_job_retention import OmrJobRetention +from flat_api.aio.models.omr_job_status import OmrJobStatus +from flat_api.aio.models.omr_locale_details import OmrLocaleDetails +from flat_api.aio.models.omr_pending_step import OmrPendingStep +from flat_api.aio.models.omr_step_name import OmrStepName +from flat_api.aio.models.organization_invitation import OrganizationInvitation +from flat_api.aio.models.organization_invitation_creation import OrganizationInvitationCreation +from flat_api.aio.models.organization_roles import OrganizationRoles +from flat_api.aio.models.organization_user_access_token_creation import OrganizationUserAccessTokenCreation +from flat_api.aio.models.rename_group_request import RenameGroupRequest +from flat_api.aio.models.resource_collaborator import ResourceCollaborator +from flat_api.aio.models.resource_collaborator_creation import ResourceCollaboratorCreation +from flat_api.aio.models.resource_rights import ResourceRights +from flat_api.aio.models.score_comment import ScoreComment +from flat_api.aio.models.score_comment_context import ScoreCommentContext +from flat_api.aio.models.score_comment_creation import ScoreCommentCreation +from flat_api.aio.models.score_comment_moderation import ScoreCommentModeration +from flat_api.aio.models.score_comment_update import ScoreCommentUpdate +from flat_api.aio.models.score_comments_counts import ScoreCommentsCounts +from flat_api.aio.models.score_creation import ScoreCreation +from flat_api.aio.models.score_creation_builder_data import ScoreCreationBuilderData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data import ScoreCreationBuilderDataAllOfBuilderData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_layout_data import ScoreCreationBuilderDataAllOfBuilderDataLayoutData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_score_data import ScoreCreationBuilderDataAllOfBuilderDataScoreData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_score_data_instruments import ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments +from flat_api.aio.models.score_creation_common import ScoreCreationCommon +from flat_api.aio.models.score_creation_file_import import ScoreCreationFileImport +from flat_api.aio.models.score_creation_google_drive_import import ScoreCreationGoogleDriveImport +from flat_api.aio.models.score_creation_type import ScoreCreationType +from flat_api.aio.models.score_details import ScoreDetails +from flat_api.aio.models.score_details_all_of_me import ScoreDetailsAllOfMe +from flat_api.aio.models.score_fork import ScoreFork +from flat_api.aio.models.score_license import ScoreLicense +from flat_api.aio.models.score_likes_counts import ScoreLikesCounts +from flat_api.aio.models.score_modification import ScoreModification +from flat_api.aio.models.score_plays_counts import ScorePlaysCounts +from flat_api.aio.models.score_privacy import ScorePrivacy +from flat_api.aio.models.score_revision import ScoreRevision +from flat_api.aio.models.score_revision_creation import ScoreRevisionCreation +from flat_api.aio.models.score_revision_statistics import ScoreRevisionStatistics +from flat_api.aio.models.score_source import ScoreSource +from flat_api.aio.models.score_summary import ScoreSummary +from flat_api.aio.models.score_track import ScoreTrack +from flat_api.aio.models.score_track_creation import ScoreTrackCreation +from flat_api.aio.models.score_track_creation_response import ScoreTrackCreationResponse +from flat_api.aio.models.score_track_point import ScoreTrackPoint +from flat_api.aio.models.score_track_purpose import ScoreTrackPurpose +from flat_api.aio.models.score_track_state import ScoreTrackState +from flat_api.aio.models.score_track_type import ScoreTrackType +from flat_api.aio.models.score_track_update import ScoreTrackUpdate +from flat_api.aio.models.score_views_counts import ScoreViewsCounts +from flat_api.aio.models.task import Task +from flat_api.aio.models.task_export_options import TaskExportOptions +from flat_api.aio.models.task_progress import TaskProgress +from flat_api.aio.models.task_result import TaskResult +from flat_api.aio.models.teaching_theme import TeachingTheme +from flat_api.aio.models.tutteo_product import TutteoProduct +from flat_api.aio.models.user_admin_update import UserAdminUpdate +from flat_api.aio.models.user_azure_details import UserAzureDetails +from flat_api.aio.models.user_basics import UserBasics +from flat_api.aio.models.user_community_profile_links import UserCommunityProfileLinks +from flat_api.aio.models.user_creation import UserCreation +from flat_api.aio.models.user_details import UserDetails +from flat_api.aio.models.user_details_admin import UserDetailsAdmin +from flat_api.aio.models.user_details_admin_all_of_license import UserDetailsAdminAllOfLicense +from flat_api.aio.models.user_public import UserPublic +from flat_api.aio.models.user_public_summary import UserPublicSummary +from flat_api.aio.models.user_signin_link import UserSigninLink +from flat_api.aio.models.user_signin_link_creation import UserSigninLinkCreation + diff --git a/flat_api/aio/models/add_group_user200_response.py b/flat_api/aio/models/add_group_user200_response.py new file mode 100644 index 0000000..a1ec49e --- /dev/null +++ b/flat_api/aio/models/add_group_user200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AddGroupUser200Response(BaseModel): + """ + AddGroupUser200Response + """ # noqa: E501 + user: Optional[StrictStr] = Field(default=None, description="User ID that was added") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["user"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddGroupUser200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddGroupUser200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "user": obj.get("user") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/add_group_user_request.py b/flat_api/aio/models/add_group_user_request.py new file mode 100644 index 0000000..b9ddd17 --- /dev/null +++ b/flat_api/aio/models/add_group_user_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AddGroupUserRequest(BaseModel): + """ + AddGroupUserRequest + """ # noqa: E501 + user: StrictStr = Field(description="ID of the student to add") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["user"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddGroupUserRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddGroupUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "user": obj.get("user") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/api_access_token.py b/flat_api/aio/models/api_access_token.py new file mode 100644 index 0000000..2372074 --- /dev/null +++ b/flat_api/aio/models/api_access_token.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.app_scopes import AppScopes +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ApiAccessToken(BaseModel): + """ + An API access token + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of this private token") + name: Optional[StrictStr] = Field(default=None, description="Name of the personal access token") + token: Optional[StrictStr] = Field(default=None, description="The token. This token will only be returned once, then only the first 4 characters will be returned. ") + issued_date: Optional[datetime] = Field(default=None, description="The date then this token was issued ", alias="issuedDate") + expiration_date: Optional[datetime] = Field(default=None, description="The date then this token will expire ", alias="expirationDate") + scopes: Optional[List[AppScopes]] = Field(default=None, description="The list of scopes associated to the token ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "token", "issuedDate", "expirationDate", "scopes"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ApiAccessToken from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ApiAccessToken from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "token": obj.get("token"), + "issuedDate": obj.get("issuedDate"), + "expirationDate": obj.get("expirationDate"), + "scopes": obj.get("scopes") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/app_scopes.py b/flat_api/aio/models/app_scopes.py new file mode 100644 index 0000000..412161a --- /dev/null +++ b/flat_api/aio/models/app_scopes.py @@ -0,0 +1,59 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AppScopes(str, Enum): + """ + Available scopes + """ + + """ + allowed enum values + """ + ACCOUNT_DOT_PUBLIC_PROFILE = 'account.public_profile' + ACCOUNT_DOT_EMAIL = 'account.email' + ACCOUNT_DOT_EDUCATION_PROFILE = 'account.education_profile' + SCORES_DOT_READONLY = 'scores.readonly' + SCORES_DOT_SOCIAL = 'scores.social' + SCORES = 'scores' + COLLECTIONS_DOT_READONLY = 'collections.readonly' + COLLECTIONS_DOT_ADD_SCORES = 'collections.add_scores' + COLLECTIONS = 'collections' + NOTIFICATIONS_DOT_READONLY = 'notifications.readonly' + EDU_DOT_RESOURCES = 'edu.resources' + EDU_DOT_RESOURCES_DOT_READONLY = 'edu.resources.readonly' + EDU_DOT_CLASSES = 'edu.classes' + EDU_DOT_CLASSES_DOT_READONLY = 'edu.classes.readonly' + EDU_DOT_ASSIGNMENTS = 'edu.assignments' + EDU_DOT_ASSIGNMENTS_DOT_READONLY = 'edu.assignments.readonly' + EDU_DOT_ADMIN = 'edu.admin' + EDU_DOT_ADMIN_DOT_LTI = 'edu.admin.lti' + EDU_DOT_ADMIN_DOT_LTI_DOT_READONLY = 'edu.admin.lti.readonly' + EDU_DOT_ADMIN_DOT_USERS = 'edu.admin.users' + EDU_DOT_ADMIN_DOT_USERS_DOT_READONLY = 'edu.admin.users.readonly' + TASKS_DOT_READONLY = 'tasks.readonly' + OMR = 'omr' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AppScopes from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/assignment.py b/flat_api/aio/models/assignment.py new file mode 100644 index 0000000..a5ea9de --- /dev/null +++ b/flat_api/aio/models/assignment.py @@ -0,0 +1,184 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.assignment_capabilities import AssignmentCapabilities +from flat_api.aio.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode +from flat_api.aio.models.assignment_type import AssignmentType +from flat_api.aio.models.media_attachment import MediaAttachment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Assignment(BaseModel): + """ + Assignment details + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the assignment") + type: AssignmentType + capabilities: AssignmentCapabilities + title: StrictStr = Field(description="Title of the assignment") + description: Optional[StrictStr] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[StrictStr] = Field(default=None, description="HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="descriptionHtml") + teacher_instructions: Optional[StrictStr] = Field(default=None, description="Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. ", alias="teacherInstructions") + teacher_instructions_html: Optional[StrictStr] = Field(default=None, description="HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="teacherInstructionsHtml") + cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") + cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") + attachments: List[MediaAttachment] = Field(description="Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. ") + use_dedicated_attachments: Optional[StrictBool] = Field(default=None, description="For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. ", alias="useDedicatedAttachments") + max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If set, the grading will be enabled for the assignement ", alias="maxPoints") + release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") + shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") + toolset: Optional[StrictStr] = Field(default=None, description="The id of the associated toolset") + nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord"] + + @field_validator('release_grades') + def release_grades_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'manual']): + raise ValueError("must be one of enum values ('auto', 'manual')") + return value + + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Assignment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Assignment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "capabilities": AssignmentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "title": obj.get("title"), + "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), + "cover": obj.get("cover"), + "coverFile": obj.get("coverFile"), + "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "useDedicatedAttachments": obj.get("useDedicatedAttachments"), + "maxPoints": obj.get("maxPoints"), + "releaseGrades": obj.get("releaseGrades"), + "shuffleExercises": obj.get("shuffleExercises"), + "toolset": obj.get("toolset"), + "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_capabilities.py b/flat_api/aio/models/assignment_capabilities.py new file mode 100644 index 0000000..fd54a61 --- /dev/null +++ b/flat_api/aio/models/assignment_capabilities.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.assignment_capabilities_can_publish_in_class_error import AssignmentCapabilitiesCanPublishInClassError +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCapabilities(BaseModel): + """ + Capabilities the current user has on this assignment. Each capability corresponds to a fine-grained action that a user may take. + """ # noqa: E501 + can_edit: StrictBool = Field(description="Whether the current user can edit the assignment ", alias="canEdit") + can_publish_in_class: StrictBool = Field(description="Whether this assignment can be published in a class ", alias="canPublishInClass") + can_publish_in_class_error: Optional[AssignmentCapabilitiesCanPublishInClassError] = Field(default=None, alias="canPublishInClassError") + can_archive: StrictBool = Field(description="Whether the current user can archive the assignment ", alias="canArchive") + can_unarchive: StrictBool = Field(description="Whether the current user can unarchive the assignment ", alias="canUnarchive") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["canEdit", "canPublishInClass", "canPublishInClassError", "canArchive", "canUnarchive"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of can_publish_in_class_error + if self.can_publish_in_class_error: + _dict['canPublishInClassError'] = self.can_publish_in_class_error.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "canEdit": obj.get("canEdit"), + "canPublishInClass": obj.get("canPublishInClass"), + "canPublishInClassError": AssignmentCapabilitiesCanPublishInClassError.from_dict(obj["canPublishInClassError"]) if obj.get("canPublishInClassError") is not None else None, + "canArchive": obj.get("canArchive"), + "canUnarchive": obj.get("canUnarchive") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_capabilities_can_publish_in_class_error.py b/flat_api/aio/models/assignment_capabilities_can_publish_in_class_error.py new file mode 100644 index 0000000..90571c7 --- /dev/null +++ b/flat_api/aio/models/assignment_capabilities_can_publish_in_class_error.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCapabilitiesCanPublishInClassError(BaseModel): + """ + If `canPublishInClass` and `canEdit` are false, the issue why this assignment cannot be published in a class + """ # noqa: E501 + code: StrictStr = Field(description="A corresponding code for this error") + message: StrictStr = Field(description="A printable and localized message for this error") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCapabilitiesCanPublishInClassError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCapabilitiesCanPublishInClassError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_copy.py b/flat_api/aio/models/assignment_copy.py new file mode 100644 index 0000000..b7e5247 --- /dev/null +++ b/flat_api/aio/models/assignment_copy.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.aio.models.assignment_copy_to_class import AssignmentCopyToClass +from flat_api.aio.models.assignment_copy_to_resource_library import AssignmentCopyToResourceLibrary +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +ASSIGNMENTCOPY_ONE_OF_SCHEMAS = ["AssignmentCopyToClass", "AssignmentCopyToResourceLibrary"] + +class AssignmentCopy(BaseModel): + """ + AssignmentCopy + """ + # data type: AssignmentCopyToClass + oneof_schema_1_validator: Optional[AssignmentCopyToClass] = None + # data type: AssignmentCopyToResourceLibrary + oneof_schema_2_validator: Optional[AssignmentCopyToResourceLibrary] = None + actual_instance: Optional[Union[AssignmentCopyToClass, AssignmentCopyToResourceLibrary]] = None + one_of_schemas: Set[str] = { "AssignmentCopyToClass", "AssignmentCopyToResourceLibrary" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = AssignmentCopy.model_construct() + error_messages = [] + match = 0 + # validate data type: AssignmentCopyToClass + if not isinstance(v, AssignmentCopyToClass): + error_messages.append(f"Error! Input type `{type(v)}` is not `AssignmentCopyToClass`") + else: + match += 1 + # validate data type: AssignmentCopyToResourceLibrary + if not isinstance(v, AssignmentCopyToResourceLibrary): + error_messages.append(f"Error! Input type `{type(v)}` is not `AssignmentCopyToResourceLibrary`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AssignmentCopyToClass + try: + instance.actual_instance = AssignmentCopyToClass.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AssignmentCopyToResourceLibrary + try: + instance.actual_instance = AssignmentCopyToResourceLibrary.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 AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AssignmentCopyToClass, AssignmentCopyToResourceLibrary]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/aio/models/assignment_copy_response.py b/flat_api/aio/models/assignment_copy_response.py new file mode 100644 index 0000000..43c3e02 --- /dev/null +++ b/flat_api/aio/models/assignment_copy_response.py @@ -0,0 +1,186 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.assignment_capabilities import AssignmentCapabilities +from flat_api.aio.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode +from flat_api.aio.models.assignment_type import AssignmentType +from flat_api.aio.models.media_attachment import MediaAttachment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCopyResponse(BaseModel): + """ + AssignmentCopyResponse + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the assignment") + type: AssignmentType + capabilities: AssignmentCapabilities + title: StrictStr = Field(description="Title of the assignment") + description: Optional[StrictStr] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[StrictStr] = Field(default=None, description="HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="descriptionHtml") + teacher_instructions: Optional[StrictStr] = Field(default=None, description="Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. ", alias="teacherInstructions") + teacher_instructions_html: Optional[StrictStr] = Field(default=None, description="HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="teacherInstructionsHtml") + cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") + cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") + attachments: List[MediaAttachment] = Field(description="Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. ") + use_dedicated_attachments: Optional[StrictBool] = Field(default=None, description="For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. ", alias="useDedicatedAttachments") + max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If set, the grading will be enabled for the assignement ", alias="maxPoints") + release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") + shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") + toolset: Optional[StrictStr] = Field(default=None, description="The id of the associated toolset") + nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") + resource: Optional[StrictStr] = Field(default=None, description="If this assignment is stored as a resource in the Flat for Education Resource Library, the unique identifier of the resource.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord", "resource"] + + @field_validator('release_grades') + def release_grades_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'manual']): + raise ValueError("must be one of enum values ('auto', 'manual')") + return value + + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCopyResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCopyResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "capabilities": AssignmentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "title": obj.get("title"), + "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), + "cover": obj.get("cover"), + "coverFile": obj.get("coverFile"), + "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "useDedicatedAttachments": obj.get("useDedicatedAttachments"), + "maxPoints": obj.get("maxPoints"), + "releaseGrades": obj.get("releaseGrades"), + "shuffleExercises": obj.get("shuffleExercises"), + "toolset": obj.get("toolset"), + "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord"), + "resource": obj.get("resource") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_copy_to_class.py b/flat_api/aio/models/assignment_copy_to_class.py new file mode 100644 index 0000000..f931c0a --- /dev/null +++ b/flat_api/aio/models/assignment_copy_to_class.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCopyToClass(BaseModel): + """ + Copy the assignment to a class + """ # noqa: E501 + classroom: StrictStr = Field(description="The destination classroom where the assignment will be copied") + assignment: Optional[StrictStr] = Field(default=None, description="An optional destination assignment where the original assignement will be copied. Must be a draft.") + scheduled_date: Optional[datetime] = Field(default=None, description="The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. Alternatively the existing `scheduledDate` from the copied assignment will be used. ", alias="scheduledDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["classroom", "assignment", "scheduledDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCopyToClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCopyToClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "classroom": obj.get("classroom"), + "assignment": obj.get("assignment"), + "scheduledDate": obj.get("scheduledDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_copy_to_resource_library.py b/flat_api/aio/models/assignment_copy_to_resource_library.py new file mode 100644 index 0000000..e3a0e30 --- /dev/null +++ b/flat_api/aio/models/assignment_copy_to_resource_library.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCopyToResourceLibrary(BaseModel): + """ + Copy the assignment to the EDU Resource Library + """ # noqa: E501 + library_parent: StrictStr = Field(description="Identifier of the parent resource where the new one will created, e.g. a folder id or `root`", alias="libraryParent") + verify_if_not_already_in_resource_library: Optional[StrictBool] = Field(default=None, description="Option to check if the assignment is already in Resource Library", alias="verifyIfNotAlreadyInResourceLibrary") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["libraryParent", "verifyIfNotAlreadyInResourceLibrary"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCopyToResourceLibrary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCopyToResourceLibrary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "libraryParent": obj.get("libraryParent"), + "verifyIfNotAlreadyInResourceLibrary": obj.get("verifyIfNotAlreadyInResourceLibrary") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_group.py b/flat_api/aio/models/assignment_group.py new file mode 100644 index 0000000..d4b3685 --- /dev/null +++ b/flat_api/aio/models/assignment_group.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentGroup(BaseModel): + """ + A group assigned to an assignment for shared writing assignments + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the group") + name: StrictStr = Field(description="The display name of the group") + parent: Optional[StrictStr] = Field(default=None, description="The unique identifier of the parent class group. Only available for groups of type 'assignmentStudentsSubGroup'. May be null if the parent class group was deleted.") + members: List[StrictStr] = Field(description="Array of user IDs that are members of this group") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "parent", "members"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "parent": obj.get("parent"), + "members": obj.get("members") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission.py b/flat_api/aio/models/assignment_submission.py new file mode 100644 index 0000000..d0c1147 --- /dev/null +++ b/flat_api/aio/models/assignment_submission.py @@ -0,0 +1,181 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.assignment_submission_comments import AssignmentSubmissionComments +from flat_api.aio.models.assignment_submission_lti import AssignmentSubmissionLti +from flat_api.aio.models.assignment_submission_playback import AssignmentSubmissionPlayback +from flat_api.aio.models.assignment_submission_state import AssignmentSubmissionState +from flat_api.aio.models.google_classroom_submission import GoogleClassroomSubmission +from flat_api.aio.models.media_attachment import MediaAttachment +from flat_api.aio.models.microsoft_graph_submission import MicrosoftGraphSubmission +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmission(BaseModel): + """ + Assignment Submission + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the submission") + state: AssignmentSubmissionState + classroom: StrictStr = Field(description="Unique identifier of the classroom where the assignment was posted ") + assignment: StrictStr = Field(description="Unique identifier of the assignment") + creator: StrictStr = Field(description="The User identifier of the student who created the submission") + creation_date: StrictStr = Field(description="The date when the submission was created", alias="creationDate") + attachments: List[MediaAttachment] + submission_date: Optional[StrictStr] = Field(default=None, description="The date when the student submitted their work", alias="submissionDate") + return_date: Optional[StrictStr] = Field(default=None, description="The date when the teacher returned the work", alias="returnDate") + return_creator: Optional[StrictStr] = Field(default=None, description="The User unique identifier of the teacher who returned the submission ", alias="returnCreator") + grade: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional grade. If unset, no grade was set.") + draft_grade: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission", alias="draftGrade") + max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional max points for the grade. If set, a corresponding `draftGrade` or `grade` will be set.", alias="maxPoints") + exercises_ids: Optional[List[StrictStr]] = Field(default=None, description="The ids of exercises when they need to be in a specific order", alias="exercisesIds") + playback: List[AssignmentSubmissionPlayback] + comments: AssignmentSubmissionComments + google_classroom: Optional[GoogleClassroomSubmission] = Field(default=None, alias="googleClassroom") + microsoft_graph: Optional[MicrosoftGraphSubmission] = Field(default=None, alias="microsoftGraph") + lti: Optional[AssignmentSubmissionLti] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state", "classroom", "assignment", "creator", "creationDate", "attachments", "submissionDate", "returnDate", "returnCreator", "grade", "draftGrade", "maxPoints", "exercisesIds", "playback", "comments", "googleClassroom", "microsoftGraph", "lti"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmission from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in playback (list) + _items = [] + if self.playback: + for _item_playback in self.playback: + if _item_playback: + _items.append(_item_playback.to_dict()) + _dict['playback'] = _items + # override the default output from pydantic by calling `to_dict()` of comments + if self.comments: + _dict['comments'] = self.comments.to_dict() + # override the default output from pydantic by calling `to_dict()` of google_classroom + if self.google_classroom: + _dict['googleClassroom'] = self.google_classroom.to_dict() + # override the default output from pydantic by calling `to_dict()` of microsoft_graph + if self.microsoft_graph: + _dict['microsoftGraph'] = self.microsoft_graph.to_dict() + # override the default output from pydantic by calling `to_dict()` of lti + if self.lti: + _dict['lti'] = self.lti.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if grade (nullable) is None + # and model_fields_set contains the field + if self.grade is None and "grade" in self.model_fields_set: + _dict['grade'] = None + + # set to None if draft_grade (nullable) is None + # and model_fields_set contains the field + if self.draft_grade is None and "draft_grade" in self.model_fields_set: + _dict['draftGrade'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "classroom": obj.get("classroom"), + "assignment": obj.get("assignment"), + "creator": obj.get("creator"), + "creationDate": obj.get("creationDate"), + "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "submissionDate": obj.get("submissionDate"), + "returnDate": obj.get("returnDate"), + "returnCreator": obj.get("returnCreator"), + "grade": obj.get("grade"), + "draftGrade": obj.get("draftGrade"), + "maxPoints": obj.get("maxPoints"), + "exercisesIds": obj.get("exercisesIds"), + "playback": [AssignmentSubmissionPlayback.from_dict(_item) for _item in obj["playback"]] if obj.get("playback") is not None else None, + "comments": AssignmentSubmissionComments.from_dict(obj["comments"]) if obj.get("comments") is not None else None, + "googleClassroom": GoogleClassroomSubmission.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, + "microsoftGraph": MicrosoftGraphSubmission.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, + "lti": AssignmentSubmissionLti.from_dict(obj["lti"]) if obj.get("lti") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_comment.py b/flat_api/aio/models/assignment_submission_comment.py new file mode 100644 index 0000000..56983e4 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_comment.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionComment(BaseModel): + """ + Feedback comment added to an assignment submission + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The comment unique identifier") + user: Optional[StrictStr] = Field(default=None, description="The author unique identifier") + submission: Optional[StrictStr] = Field(default=None, description="The submission unique identifier") + var_date: Optional[datetime] = Field(default=None, description="The date when the comment was posted", alias="date") + modification_date: Optional[datetime] = Field(default=None, description="The date of the last comment modification", alias="modificationDate") + comment: Optional[StrictStr] = Field(default=None, description="The comment text") + unread: Optional[StrictBool] = Field(default=None, description="True if the comment is unread by the current user") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "user", "submission", "date", "modificationDate", "comment", "unread"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionComment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionComment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "user": obj.get("user"), + "submission": obj.get("submission"), + "date": obj.get("date"), + "modificationDate": obj.get("modificationDate"), + "comment": obj.get("comment"), + "unread": obj.get("unread") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_comment_creation.py b/flat_api/aio/models/assignment_submission_comment_creation.py new file mode 100644 index 0000000..f3e3f6f --- /dev/null +++ b/flat_api/aio/models/assignment_submission_comment_creation.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionCommentCreation(BaseModel): + """ + Creation of a assignment submission comment + """ # noqa: E501 + comment: StrictStr = Field(description="The comment text") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["comment"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionCommentCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionCommentCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "comment": obj.get("comment") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_comments.py b/flat_api/aio/models/assignment_submission_comments.py new file mode 100644 index 0000000..b499aa9 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_comments.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionComments(BaseModel): + """ + AssignmentSubmissionComments + """ # noqa: E501 + total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of comments added to the submission") + unread: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of unread comments for the current user") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "unread"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionComments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionComments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "unread": obj.get("unread") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_history.py b/flat_api/aio/models/assignment_submission_history.py new file mode 100644 index 0000000..f0e68a1 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_history.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment +from flat_api.aio.models.assignment_submission_history_state import AssignmentSubmissionHistoryState +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionHistory(BaseModel): + """ + History item of the submission + """ # noqa: E501 + var_date: datetime = Field(description="The date when the submission was changed", alias="date") + classroom: Optional[StrictStr] = Field(default=None, description="The classroom unique identifier where the submission was changed") + assignment: Optional[StrictStr] = Field(default=None, description="The assignment unique identifier where the submission was changed") + submission: Optional[StrictStr] = Field(default=None, description="The submission unique identifier") + users: List[StrictStr] = Field(description="The user(s) unique identifier(s) who made the change") + source: Optional[StrictStr] = Field(default=None, description="The source of the change if the change was made by a third-party software") + state: Optional[AssignmentSubmissionHistoryState] = None + draft_grade: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The numerator of the grade at this time in the submission grade history", alias="draftGrade") + grade: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The numerator of the grade at this time in the submission grade history") + max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The denominator of the grade at this time in the submission grade history", alias="maxPoints") + comment: Optional[StrictStr] = Field(default=None, description="The comment that is made to this submission") + due_date: Optional[datetime] = Field(default=None, description="The due date of this assignment", alias="dueDate") + attachment: Optional[AssignmentSubmissionHistoryAttachment] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["date", "classroom", "assignment", "submission", "users", "source", "state", "draftGrade", "grade", "maxPoints", "comment", "dueDate", "attachment"] + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['lti', 'googleClassroom', 'microsoftGraph']): + raise ValueError("must be one of enum values ('lti', 'googleClassroom', 'microsoftGraph')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionHistory from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of attachment + if self.attachment: + _dict['attachment'] = self.attachment.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionHistory from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "date": obj.get("date"), + "classroom": obj.get("classroom"), + "assignment": obj.get("assignment"), + "submission": obj.get("submission"), + "users": obj.get("users"), + "source": obj.get("source"), + "state": obj.get("state"), + "draftGrade": obj.get("draftGrade"), + "grade": obj.get("grade"), + "maxPoints": obj.get("maxPoints"), + "comment": obj.get("comment"), + "dueDate": obj.get("dueDate"), + "attachment": AssignmentSubmissionHistoryAttachment.from_dict(obj["attachment"]) if obj.get("attachment") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_history_attachment.py b/flat_api/aio/models/assignment_submission_history_attachment.py new file mode 100644 index 0000000..12c1edf --- /dev/null +++ b/flat_api/aio/models/assignment_submission_history_attachment.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionHistoryAttachment(BaseModel): + """ + AssignmentSubmissionHistoryAttachment + """ # noqa: E501 + score: Optional[StrictStr] = Field(default=None, description="The score identifier that changed") + revision: Optional[StrictStr] = Field(default=None, description="The revision identifier that changed") + title: Optional[StrictStr] = Field(default=None, description="The title of the score that changed") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["score", "revision", "title"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionHistoryAttachment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionHistoryAttachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "score": obj.get("score"), + "revision": obj.get("revision"), + "title": obj.get("title") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_history_state.py b/flat_api/aio/models/assignment_submission_history_state.py new file mode 100644 index 0000000..64ee184 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_history_state.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AssignmentSubmissionHistoryState(str, Enum): + """ + State of the submission history + """ + + """ + allowed enum values + """ + CREATED = 'created' + TURNEDIN = 'turnedIn' + RETURNED = 'returned' + GRADED = 'graded' + RESET = 'reset' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AssignmentSubmissionHistoryState from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/assignment_submission_lti.py b/flat_api/aio/models/assignment_submission_lti.py new file mode 100644 index 0000000..8f1add3 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_lti.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionLti(BaseModel): + """ + If set, this submission has a linked LTI 1.3 AGS or LTI 1.1 Outcomes + """ # noqa: E501 + grade_service: StrictStr = Field(description="The kind of grading service available for this submission: - `ags2p0`: LTI 1.3 Assignment and Grade Services 2.0 - `outcomes1p1`: LTI 1.1 Outcomes 1.1 ", alias="gradeService") + sourcedid: Optional[StrictStr] = Field(default=None, description="The sourcedid of the LTI submission when using LTI Outcomes") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["gradeService", "sourcedid"] + + @field_validator('grade_service') + def grade_service_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ags2p0', 'outcomes1p1']): + raise ValueError("must be one of enum values ('ags2p0', 'outcomes1p1')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionLti from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionLti from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "gradeService": obj.get("gradeService"), + "sourcedid": obj.get("sourcedid") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_playback.py b/flat_api/aio/models/assignment_submission_playback.py new file mode 100644 index 0000000..e950918 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_playback.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionPlayback(BaseModel): + """ + Playback used by a student for an assignment submission. + """ # noqa: E501 + score: StrictStr = Field(description="The score unique identifier") + nb_play_attempt: Union[StrictFloat, StrictInt] = Field(description="Number of times the score was played", alias="nbPlayAttempt") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["score", "nbPlayAttempt"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionPlayback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionPlayback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "score": obj.get("score"), + "nbPlayAttempt": obj.get("nbPlayAttempt") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_submission_state.py b/flat_api/aio/models/assignment_submission_state.py new file mode 100644 index 0000000..a1a2230 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_state.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AssignmentSubmissionState(str, Enum): + """ + State of the submission + """ + + """ + allowed enum values + """ + CREATED = 'created' + TURNEDIN = 'turnedIn' + RETURNED = 'returned' + GRADED = 'graded' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AssignmentSubmissionState from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/assignment_submission_students_mode.py b/flat_api/aio/models/assignment_submission_students_mode.py new file mode 100644 index 0000000..ba298d3 --- /dev/null +++ b/flat_api/aio/models/assignment_submission_students_mode.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AssignmentSubmissionStudentsMode(str, Enum): + """ + Submission mode for assignments: - \"single\": Individual submissions (default) - \"group\": Group submissions (for shared writing assignments) + """ + + """ + allowed enum values + """ + SINGLE = 'single' + GROUP = 'group' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AssignmentSubmissionStudentsMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/assignment_submission_update.py b/flat_api/aio/models/assignment_submission_update.py new file mode 100644 index 0000000..97abb1a --- /dev/null +++ b/flat_api/aio/models/assignment_submission_update.py @@ -0,0 +1,146 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from flat_api.aio.models.assignment_submission_playback import AssignmentSubmissionPlayback +from flat_api.aio.models.class_attachment_creation import ClassAttachmentCreation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionUpdate(BaseModel): + """ + Assignment Submission creation + """ # noqa: E501 + attachments: Optional[List[ClassAttachmentCreation]] = None + playback: Optional[List[AssignmentSubmissionPlayback]] = None + submit: Optional[StrictBool] = Field(default=None, description="If `true`, the submission will be marked as done") + draft_grade: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission", alias="draftGrade") + grade: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="Optional grade. If unset, no grade was set.") + exercises_ids: Optional[List[StrictStr]] = Field(default=None, description="The ids of exercises when they need to be in a specific order", alias="exercisesIds") + var_return: Optional[StrictBool] = Field(default=None, description="If `true`, the submission will be marked as done", alias="return") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attachments", "playback", "submit", "draftGrade", "grade", "exercisesIds", "return"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in playback (list) + _items = [] + if self.playback: + for _item_playback in self.playback: + if _item_playback: + _items.append(_item_playback.to_dict()) + _dict['playback'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if draft_grade (nullable) is None + # and model_fields_set contains the field + if self.draft_grade is None and "draft_grade" in self.model_fields_set: + _dict['draftGrade'] = None + + # set to None if grade (nullable) is None + # and model_fields_set contains the field + if self.grade is None and "grade" in self.model_fields_set: + _dict['grade'] = None + + # set to None if exercises_ids (nullable) is None + # and model_fields_set contains the field + if self.exercises_ids is None and "exercises_ids" in self.model_fields_set: + _dict['exercisesIds'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "attachments": [ClassAttachmentCreation.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "playback": [AssignmentSubmissionPlayback.from_dict(_item) for _item in obj["playback"]] if obj.get("playback") is not None else None, + "submit": obj.get("submit"), + "draftGrade": obj.get("draftGrade"), + "grade": obj.get("grade"), + "exercisesIds": obj.get("exercisesIds"), + "return": obj.get("return") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/assignment_type.py b/flat_api/aio/models/assignment_type.py new file mode 100644 index 0000000..77eef64 --- /dev/null +++ b/flat_api/aio/models/assignment_type.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AssignmentType(str, Enum): + """ + Type of the assignment + """ + + """ + allowed enum values + """ + NONE = 'none' + NEWSCORE = 'newScore' + SCORETEMPLATE = 'scoreTemplate' + SHAREDWRITING = 'sharedWriting' + WORKSHEET = 'worksheet' + WORKSHEETTEXT = 'worksheetText' + PERFORMANCE = 'performance' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AssignmentType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/assignment_update.py b/flat_api/aio/models/assignment_update.py new file mode 100644 index 0000000..9b0196c --- /dev/null +++ b/flat_api/aio/models/assignment_update.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from flat_api.aio.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode +from flat_api.aio.models.assignment_type import AssignmentType +from flat_api.aio.models.class_attachment_creation import ClassAttachmentCreation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentUpdate(BaseModel): + """ + Assignment Resource Editing + """ # noqa: E501 + type: Optional[AssignmentType] = None + title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Title of the assignment") + description: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of student instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="descriptionHtml") + teacher_instructions: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Teacher-only instructions (plain text)", alias="teacherInstructions") + teacher_instructions_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of teacher-only instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="teacherInstructionsHtml") + attachments: Optional[List[ClassAttachmentCreation]] = Field(default=None, description="The complete attachment list. Omitting this property on an update leaves the existing attachments alone; sending it replaces them. Dropping a dedicated score from the list deletes the students' copies of it, so send the full set you want to keep rather than only the additions. Duplicates, judged by `url`, `score`, `worksheet` or `googleDriveFileId`, are discarded silently, and exceeding the per-assignment limit fails with `ASSIGNMENT_ATTACHMENTS_LIMIT`. ") + nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + toolset: Optional[StrictStr] = Field(default=None, description="The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. ") + cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") + cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") + max_points: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="If set, the grading will be enabled for the assignement with this value as the maximum of points ", alias="maxPoints") + release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") + shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "attachments", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "toolset", "coverFile", "cover", "maxPoints", "releaseGrades", "shuffleExercises", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord"] + + @field_validator('release_grades') + def release_grades_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'manual']): + raise ValueError("must be one of enum values ('auto', 'manual')") + return value + + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if nb_playback_authorized (nullable) is None + # and model_fields_set contains the field + if self.nb_playback_authorized is None and "nb_playback_authorized" in self.model_fields_set: + _dict['nbPlaybackAuthorized'] = None + + # set to None if toolset (nullable) is None + # and model_fields_set contains the field + if self.toolset is None and "toolset" in self.model_fields_set: + _dict['toolset'] = None + + # set to None if cover_file (nullable) is None + # and model_fields_set contains the field + if self.cover_file is None and "cover_file" in self.model_fields_set: + _dict['coverFile'] = None + + # set to None if cover (nullable) is None + # and model_fields_set contains the field + if self.cover is None and "cover" in self.model_fields_set: + _dict['cover'] = None + + # set to None if max_points (nullable) is None + # and model_fields_set contains the field + if self.max_points is None and "max_points" in self.model_fields_set: + _dict['maxPoints'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), + "attachments": [ClassAttachmentCreation.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "toolset": obj.get("toolset"), + "coverFile": obj.get("coverFile"), + "cover": obj.get("cover"), + "maxPoints": obj.get("maxPoints"), + "releaseGrades": obj.get("releaseGrades"), + "shuffleExercises": obj.get("shuffleExercises"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_assignment.py b/flat_api/aio/models/class_assignment.py new file mode 100644 index 0000000..6511923 --- /dev/null +++ b/flat_api/aio/models/class_assignment.py @@ -0,0 +1,270 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.assignment_capabilities import AssignmentCapabilities +from flat_api.aio.models.assignment_group import AssignmentGroup +from flat_api.aio.models.assignment_submission import AssignmentSubmission +from flat_api.aio.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode +from flat_api.aio.models.assignment_type import AssignmentType +from flat_api.aio.models.class_assignment_all_of_canvas import ClassAssignmentAllOfCanvas +from flat_api.aio.models.class_assignment_all_of_lti import ClassAssignmentAllOfLti +from flat_api.aio.models.class_assignment_all_of_mfc import ClassAssignmentAllOfMfc +from flat_api.aio.models.google_classroom_coursework import GoogleClassroomCoursework +from flat_api.aio.models.media_attachment import MediaAttachment +from flat_api.aio.models.microsoft_graph_assignment import MicrosoftGraphAssignment +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignment(BaseModel): + """ + ClassAssignment + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the assignment") + type: AssignmentType + capabilities: AssignmentCapabilities + title: StrictStr = Field(description="Title of the assignment") + description: Optional[StrictStr] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[StrictStr] = Field(default=None, description="HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="descriptionHtml") + teacher_instructions: Optional[StrictStr] = Field(default=None, description="Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. ", alias="teacherInstructions") + teacher_instructions_html: Optional[StrictStr] = Field(default=None, description="HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="teacherInstructionsHtml") + cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") + cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") + attachments: List[MediaAttachment] = Field(description="Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. ") + use_dedicated_attachments: Optional[StrictBool] = Field(default=None, description="For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. ", alias="useDedicatedAttachments") + max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If set, the grading will be enabled for the assignement ", alias="maxPoints") + release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") + shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") + toolset: Optional[StrictStr] = Field(default=None, description="The id of the associated toolset") + nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") + creator: Optional[StrictStr] = Field(default=None, description="The User unique identifier of the creator of this assignment ") + state: StrictStr = Field(description="State of the assignment") + classroom: Optional[StrictStr] = Field(default=None, description="The unique identifier of the class where this assignment was posted") + creation_date: datetime = Field(description="The creation date of this assignment", alias="creationDate") + scheduled_date: Optional[datetime] = Field(default=None, description="The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. ", alias="scheduledDate") + due_date: Optional[datetime] = Field(default=None, description="The due date of this assignment, late submissions will be marked as paste due. ", alias="dueDate") + assignee_mode: Optional[StrictStr] = Field(default=None, description="Possible modes of assigning assignments", alias="assigneeMode") + assigned_students: Optional[List[StrictStr]] = Field(default=None, description="Identifiers for the students that have access to the assignment", alias="assignedStudents") + assigned_groups: Optional[List[AssignmentGroup]] = Field(default=None, description="Groups that have access to the assignment (for shared writing assignments)", alias="assignedGroups") + submissions: List[AssignmentSubmission] + google_classroom: Optional[GoogleClassroomCoursework] = Field(default=None, alias="googleClassroom") + microsoft_graph: Optional[MicrosoftGraphAssignment] = Field(default=None, alias="microsoftGraph") + mfc: Optional[ClassAssignmentAllOfMfc] = None + canvas: Optional[ClassAssignmentAllOfCanvas] = None + lti: Optional[ClassAssignmentAllOfLti] = None + issue: Optional[StrictStr] = Field(default=None, description="Detected issue for this assignment") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord", "creator", "state", "classroom", "creationDate", "scheduledDate", "dueDate", "assigneeMode", "assignedStudents", "assignedGroups", "submissions", "googleClassroom", "microsoftGraph", "mfc", "canvas", "lti", "issue"] + + @field_validator('release_grades') + def release_grades_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'manual']): + raise ValueError("must be one of enum values ('auto', 'manual')") + return value + + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['draft', 'active', 'archived']): + raise ValueError("must be one of enum values ('draft', 'active', 'archived')") + return value + + @field_validator('assignee_mode') + def assignee_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['everyone', 'selected']): + raise ValueError("must be one of enum values ('everyone', 'selected')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in assigned_groups (list) + _items = [] + if self.assigned_groups: + for _item_assigned_groups in self.assigned_groups: + if _item_assigned_groups: + _items.append(_item_assigned_groups.to_dict()) + _dict['assignedGroups'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in submissions (list) + _items = [] + if self.submissions: + for _item_submissions in self.submissions: + if _item_submissions: + _items.append(_item_submissions.to_dict()) + _dict['submissions'] = _items + # override the default output from pydantic by calling `to_dict()` of google_classroom + if self.google_classroom: + _dict['googleClassroom'] = self.google_classroom.to_dict() + # override the default output from pydantic by calling `to_dict()` of microsoft_graph + if self.microsoft_graph: + _dict['microsoftGraph'] = self.microsoft_graph.to_dict() + # override the default output from pydantic by calling `to_dict()` of mfc + if self.mfc: + _dict['mfc'] = self.mfc.to_dict() + # override the default output from pydantic by calling `to_dict()` of canvas + if self.canvas: + _dict['canvas'] = self.canvas.to_dict() + # override the default output from pydantic by calling `to_dict()` of lti + if self.lti: + _dict['lti'] = self.lti.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "capabilities": AssignmentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "title": obj.get("title"), + "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), + "cover": obj.get("cover"), + "coverFile": obj.get("coverFile"), + "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "useDedicatedAttachments": obj.get("useDedicatedAttachments"), + "maxPoints": obj.get("maxPoints"), + "releaseGrades": obj.get("releaseGrades"), + "shuffleExercises": obj.get("shuffleExercises"), + "toolset": obj.get("toolset"), + "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord"), + "creator": obj.get("creator"), + "state": obj.get("state"), + "classroom": obj.get("classroom"), + "creationDate": obj.get("creationDate"), + "scheduledDate": obj.get("scheduledDate"), + "dueDate": obj.get("dueDate"), + "assigneeMode": obj.get("assigneeMode"), + "assignedStudents": obj.get("assignedStudents"), + "assignedGroups": [AssignmentGroup.from_dict(_item) for _item in obj["assignedGroups"]] if obj.get("assignedGroups") is not None else None, + "submissions": [AssignmentSubmission.from_dict(_item) for _item in obj["submissions"]] if obj.get("submissions") is not None else None, + "googleClassroom": GoogleClassroomCoursework.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, + "microsoftGraph": MicrosoftGraphAssignment.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, + "mfc": ClassAssignmentAllOfMfc.from_dict(obj["mfc"]) if obj.get("mfc") is not None else None, + "canvas": ClassAssignmentAllOfCanvas.from_dict(obj["canvas"]) if obj.get("canvas") is not None else None, + "lti": ClassAssignmentAllOfLti.from_dict(obj["lti"]) if obj.get("lti") is not None else None, + "issue": obj.get("issue") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_assignment_all_of_canvas.py b/flat_api/aio/models/class_assignment_all_of_canvas.py new file mode 100644 index 0000000..b2a3149 --- /dev/null +++ b/flat_api/aio/models/class_assignment_all_of_canvas.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentAllOfCanvas(BaseModel): + """ + A Canvas LMS assignment + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on Canvas assignment") + alternate_link: Optional[StrictStr] = Field(default=None, description="Link to Canvas assignment", alias="alternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "alternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfCanvas from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfCanvas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alternateLink": obj.get("alternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_assignment_all_of_lti.py b/flat_api/aio/models/class_assignment_all_of_lti.py new file mode 100644 index 0000000..3b0a866 --- /dev/null +++ b/flat_api/aio/models/class_assignment_all_of_lti.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentAllOfLti(BaseModel): + """ + An LTI assignment + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Resource ID in the LMS") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfLti from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfLti from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_assignment_all_of_mfc.py b/flat_api/aio/models/class_assignment_all_of_mfc.py new file mode 100644 index 0000000..0a55224 --- /dev/null +++ b/flat_api/aio/models/class_assignment_all_of_mfc.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentAllOfMfc(BaseModel): + """ + A MusicFirst Classroom assignment + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on MusicFirst Task") + alternate_link: Optional[StrictStr] = Field(default=None, description="Link to MusicFirst Classroom task", alias="alternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "alternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfMfc from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfMfc from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alternateLink": obj.get("alternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_assignment_update.py b/flat_api/aio/models/class_assignment_update.py new file mode 100644 index 0000000..d9aaa1f --- /dev/null +++ b/flat_api/aio/models/class_assignment_update.py @@ -0,0 +1,235 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from flat_api.aio.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode +from flat_api.aio.models.assignment_type import AssignmentType +from flat_api.aio.models.class_assignment_update_all_of_google_classroom import ClassAssignmentUpdateAllOfGoogleClassroom +from flat_api.aio.models.class_assignment_update_all_of_microsoft_graph import ClassAssignmentUpdateAllOfMicrosoftGraph +from flat_api.aio.models.class_attachment_creation import ClassAttachmentCreation +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentUpdate(BaseModel): + """ + ClassAssignmentUpdate + """ # noqa: E501 + type: Optional[AssignmentType] = None + title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Title of the assignment") + description: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of student instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="descriptionHtml") + teacher_instructions: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Teacher-only instructions (plain text)", alias="teacherInstructions") + teacher_instructions_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of teacher-only instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="teacherInstructionsHtml") + attachments: Optional[List[ClassAttachmentCreation]] = Field(default=None, description="The complete attachment list. Omitting this property on an update leaves the existing attachments alone; sending it replaces them. Dropping a dedicated score from the list deletes the students' copies of it, so send the full set you want to keep rather than only the additions. Duplicates, judged by `url`, `score`, `worksheet` or `googleDriveFileId`, are discarded silently, and exceeding the per-assignment limit fails with `ASSIGNMENT_ATTACHMENTS_LIMIT`. ") + nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + toolset: Optional[StrictStr] = Field(default=None, description="The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. ") + cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") + cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") + max_points: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="If set, the grading will be enabled for the assignement with this value as the maximum of points ", alias="maxPoints") + release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") + shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") + state: Optional[StrictStr] = Field(default=None, description="State of the assignment") + due_date: Optional[datetime] = Field(default=None, description="The due date of this assignment, late submissions will be marked as paste due. If not set, the assignment won't have a due date. ", alias="dueDate") + scheduled_date: Optional[datetime] = Field(default=None, description="The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. ", alias="scheduledDate") + google_classroom: Optional[ClassAssignmentUpdateAllOfGoogleClassroom] = Field(default=None, alias="googleClassroom") + microsoft_graph: Optional[ClassAssignmentUpdateAllOfMicrosoftGraph] = Field(default=None, alias="microsoftGraph") + assignee_mode: Optional[StrictStr] = Field(default=None, description="Possible modes of assigning assignments", alias="assigneeMode") + assigned_students: Optional[List[StrictStr]] = Field(default=None, description="Identifiers for the students that have access to the assignment", alias="assignedStudents") + class_group_ids: Optional[List[StrictStr]] = Field(default=None, description="Optional list of specific class group IDs to apply to the assignment. When transitioning to active state with group submission mode: - If provided: Only these specific groups will be applied - If not provided: All class groups will be applied, or randomized groups created if none exist ", alias="classGroupIds") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "attachments", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "toolset", "coverFile", "cover", "maxPoints", "releaseGrades", "shuffleExercises", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord", "state", "dueDate", "scheduledDate", "googleClassroom", "microsoftGraph", "assigneeMode", "assignedStudents", "classGroupIds"] + + @field_validator('release_grades') + def release_grades_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['auto', 'manual']): + raise ValueError("must be one of enum values ('auto', 'manual')") + return value + + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['draft', 'active']): + raise ValueError("must be one of enum values ('draft', 'active')") + return value + + @field_validator('assignee_mode') + def assignee_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['everyone', 'selected']): + raise ValueError("must be one of enum values ('everyone', 'selected')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) + _items = [] + if self.attachments: + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) + _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of google_classroom + if self.google_classroom: + _dict['googleClassroom'] = self.google_classroom.to_dict() + # override the default output from pydantic by calling `to_dict()` of microsoft_graph + if self.microsoft_graph: + _dict['microsoftGraph'] = self.microsoft_graph.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if due_date (nullable) is None + # and model_fields_set contains the field + if self.due_date is None and "due_date" in self.model_fields_set: + _dict['dueDate'] = None + + # set to None if scheduled_date (nullable) is None + # and model_fields_set contains the field + if self.scheduled_date is None and "scheduled_date" in self.model_fields_set: + _dict['scheduledDate'] = None + + # set to None if class_group_ids (nullable) is None + # and model_fields_set contains the field + if self.class_group_ids is None and "class_group_ids" in self.model_fields_set: + _dict['classGroupIds'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), + "attachments": [ClassAttachmentCreation.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "toolset": obj.get("toolset"), + "coverFile": obj.get("coverFile"), + "cover": obj.get("cover"), + "maxPoints": obj.get("maxPoints"), + "releaseGrades": obj.get("releaseGrades"), + "shuffleExercises": obj.get("shuffleExercises"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord"), + "state": obj.get("state"), + "dueDate": obj.get("dueDate"), + "scheduledDate": obj.get("scheduledDate"), + "googleClassroom": ClassAssignmentUpdateAllOfGoogleClassroom.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, + "microsoftGraph": ClassAssignmentUpdateAllOfMicrosoftGraph.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, + "assigneeMode": obj.get("assigneeMode"), + "assignedStudents": obj.get("assignedStudents"), + "classGroupIds": obj.get("classGroupIds") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_assignment_update_all_of_google_classroom.py b/flat_api/aio/models/class_assignment_update_all_of_google_classroom.py new file mode 100644 index 0000000..b203ce2 --- /dev/null +++ b/flat_api/aio/models/class_assignment_update_all_of_google_classroom.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentUpdateAllOfGoogleClassroom(BaseModel): + """ + Google Classroom options for this assignment + """ # noqa: E501 + topic_id: Optional[StrictStr] = Field(default=None, description="Identifier of the topic where the assignment is created", alias="topicId") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["topicId"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfGoogleClassroom from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if topic_id (nullable) is None + # and model_fields_set contains the field + if self.topic_id is None and "topic_id" in self.model_fields_set: + _dict['topicId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfGoogleClassroom from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "topicId": obj.get("topicId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_assignment_update_all_of_microsoft_graph.py b/flat_api/aio/models/class_assignment_update_all_of_microsoft_graph.py new file mode 100644 index 0000000..de42c4b --- /dev/null +++ b/flat_api/aio/models/class_assignment_update_all_of_microsoft_graph.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentUpdateAllOfMicrosoftGraph(BaseModel): + """ + Microsoft Graph options for this assignment + """ # noqa: E501 + categories: Optional[List[StrictStr]] = Field(default=None, description="List of categories this assignment belongs to") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["categories"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfMicrosoftGraph from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if categories (nullable) is None + # and model_fields_set contains the field + if self.categories is None and "categories" in self.model_fields_set: + _dict['categories'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfMicrosoftGraph from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "categories": obj.get("categories") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_attachment_creation.py b/flat_api/aio/models/class_attachment_creation.py new file mode 100644 index 0000000..51bc54d --- /dev/null +++ b/flat_api/aio/models/class_attachment_creation.py @@ -0,0 +1,131 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.media_score_sharing_mode import MediaScoreSharingMode +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAttachmentCreation(BaseModel): + """ + Attachment creation for an assignment or stream post. This attachment must contain a `score` or an `url`, all the details of this one will be resolved and returned as `ClassAttachment` once the assignment or stream post is created. + """ # noqa: E501 + type: Optional[StrictStr] = Field(default=None, description="The type of the attachment posted: * `rich`, `photo`, `video` are attachment types that are automatically resolved from a `link` attachment. * A `flat` attachment is a score document where the unique identifier will be specified in the `score` property. Its sharing mode will be provided in the `sharingMode` property. ") + score: Optional[StrictStr] = Field(default=None, description="A unique Flat score identifier. The user creating the assignment must at least have read access to the document. If the user has admin rights, new group permissions will be automatically added for the teachers and students of the class. ") + worksheet: Optional[StrictStr] = Field(default=None, description="An unique worksheet identifier") + revision: Optional[StrictStr] = Field(default=None, description="An unique revision identifier of a score") + part_uuid: Optional[StrictStr] = Field(default=None, description="The UUID of the instrument part selected for this attachment (for performance submissions)", alias="partUuid") + sharing_mode: Optional[MediaScoreSharingMode] = Field(default=MediaScoreSharingMode.READ, alias="sharingMode") + lock_score_template: Optional[StrictBool] = Field(default=None, description="To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template.", alias="lockScoreTemplate") + url: Optional[StrictStr] = Field(default=None, description="The URL of the attachment.") + google_drive_file_id: Optional[StrictStr] = Field(default=None, description="The ID of the Google Drive File", alias="googleDriveFileId") + teacher_only: Optional[StrictBool] = Field(default=False, description="Flag indicating if this attachment should only be visible to teachers", alias="teacherOnly") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "score", "worksheet", "revision", "partUuid", "sharingMode", "lockScoreTemplate", "url", "googleDriveFileId", "teacherOnly"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet']): + raise ValueError("must be one of enum values ('rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAttachmentCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAttachmentCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "score": obj.get("score"), + "worksheet": obj.get("worksheet"), + "revision": obj.get("revision"), + "partUuid": obj.get("partUuid"), + "sharingMode": obj.get("sharingMode") if obj.get("sharingMode") is not None else MediaScoreSharingMode.READ, + "lockScoreTemplate": obj.get("lockScoreTemplate"), + "url": obj.get("url"), + "googleDriveFileId": obj.get("googleDriveFileId"), + "teacherOnly": obj.get("teacherOnly") if obj.get("teacherOnly") is not None else False + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_creation.py b/flat_api/aio/models/class_creation.py new file mode 100644 index 0000000..a8dcf66 --- /dev/null +++ b/flat_api/aio/models/class_creation.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from flat_api.aio.models.class_grade_level import ClassGradeLevel +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassCreation(BaseModel): + """ + Creation of a classroom + """ # noqa: E501 + name: Annotated[str, Field(strict=True, max_length=255)] = Field(description="The name of the new class") + section: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The section of the new class") + level: Optional[ClassGradeLevel] = None + skills_focused: Optional[List[StrictStr]] = Field(default=None, description="Specific skills that will be focused in classroom", alias="skillsFocused") + size: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="Number of students in the classroom") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "section", "level", "skillsFocused", "size"] + + @field_validator('skills_focused') + def skills_focused_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other']): + raise ValueError("each list item must be one of ('notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if size (nullable) is None + # and model_fields_set contains the field + if self.size is None and "size" in self.model_fields_set: + _dict['size'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "section": obj.get("section"), + "level": obj.get("level"), + "skillsFocused": obj.get("skillsFocused"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details.py b/flat_api/aio/models/class_details.py new file mode 100644 index 0000000..92d846f --- /dev/null +++ b/flat_api/aio/models/class_details.py @@ -0,0 +1,208 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.class_details_canvas import ClassDetailsCanvas +from flat_api.aio.models.class_details_clever import ClassDetailsClever +from flat_api.aio.models.class_details_google_classroom import ClassDetailsGoogleClassroom +from flat_api.aio.models.class_details_google_drive import ClassDetailsGoogleDrive +from flat_api.aio.models.class_details_issues import ClassDetailsIssues +from flat_api.aio.models.class_details_lti import ClassDetailsLti +from flat_api.aio.models.class_details_mfc import ClassDetailsMfc +from flat_api.aio.models.class_details_microsoft_graph import ClassDetailsMicrosoftGraph +from flat_api.aio.models.class_grade_level import ClassGradeLevel +from flat_api.aio.models.class_state import ClassState +from flat_api.aio.models.group_details import GroupDetails +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetails(BaseModel): + """ + A classroom + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the class") + state: ClassState + name: StrictStr = Field(description="The name of the class") + section: Optional[StrictStr] = Field(default=None, description="The section of the class") + description: Optional[StrictStr] = Field(default=None, description="An optionnal description for this class") + organization: Optional[StrictStr] = Field(default=None, description="The unique identifier of the Organization owning this class") + owner: Optional[StrictStr] = Field(default=None, description="The unique identifier of the User owning this class") + creation_date: datetime = Field(description="The date when the class was create", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="The date when the class was last modified", alias="modificationDate") + enrollment_code: Optional[StrictStr] = Field(default=None, description="[Teachers only] The enrollment code that can be used by the students to join the class ", alias="enrollmentCode") + theme: Optional[StrictStr] = Field(default=None, description="The theme identifier using in Flat User Interface") + assignments_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of assignments created in the class", alias="assignmentsCount") + students_group: Optional[GroupDetails] = Field(default=None, alias="studentsGroup") + teachers_group: Optional[GroupDetails] = Field(default=None, alias="teachersGroup") + issues: Optional[ClassDetailsIssues] = None + google_classroom: Optional[ClassDetailsGoogleClassroom] = Field(default=None, alias="googleClassroom") + google_drive: Optional[ClassDetailsGoogleDrive] = Field(default=None, alias="googleDrive") + microsoft_graph: Optional[ClassDetailsMicrosoftGraph] = Field(default=None, alias="microsoftGraph") + lti: Optional[ClassDetailsLti] = None + canvas: Optional[ClassDetailsCanvas] = None + mfc: Optional[ClassDetailsMfc] = None + clever: Optional[ClassDetailsClever] = None + level: Optional[ClassGradeLevel] = None + skills_focused: Optional[List[StrictStr]] = Field(default=None, description="Specific skills that will be focused in classroom", alias="skillsFocused") + size: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Number of students in the classroom") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state", "name", "section", "description", "organization", "owner", "creationDate", "modificationDate", "enrollmentCode", "theme", "assignmentsCount", "studentsGroup", "teachersGroup", "issues", "googleClassroom", "googleDrive", "microsoftGraph", "lti", "canvas", "mfc", "clever", "level", "skillsFocused", "size"] + + @field_validator('skills_focused') + def skills_focused_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other']): + raise ValueError("each list item must be one of ('notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of students_group + if self.students_group: + _dict['studentsGroup'] = self.students_group.to_dict() + # override the default output from pydantic by calling `to_dict()` of teachers_group + if self.teachers_group: + _dict['teachersGroup'] = self.teachers_group.to_dict() + # override the default output from pydantic by calling `to_dict()` of issues + if self.issues: + _dict['issues'] = self.issues.to_dict() + # override the default output from pydantic by calling `to_dict()` of google_classroom + if self.google_classroom: + _dict['googleClassroom'] = self.google_classroom.to_dict() + # override the default output from pydantic by calling `to_dict()` of google_drive + if self.google_drive: + _dict['googleDrive'] = self.google_drive.to_dict() + # override the default output from pydantic by calling `to_dict()` of microsoft_graph + if self.microsoft_graph: + _dict['microsoftGraph'] = self.microsoft_graph.to_dict() + # override the default output from pydantic by calling `to_dict()` of lti + if self.lti: + _dict['lti'] = self.lti.to_dict() + # override the default output from pydantic by calling `to_dict()` of canvas + if self.canvas: + _dict['canvas'] = self.canvas.to_dict() + # override the default output from pydantic by calling `to_dict()` of mfc + if self.mfc: + _dict['mfc'] = self.mfc.to_dict() + # override the default output from pydantic by calling `to_dict()` of clever + if self.clever: + _dict['clever'] = self.clever.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if size (nullable) is None + # and model_fields_set contains the field + if self.size is None and "size" in self.model_fields_set: + _dict['size'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "name": obj.get("name"), + "section": obj.get("section"), + "description": obj.get("description"), + "organization": obj.get("organization"), + "owner": obj.get("owner"), + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), + "enrollmentCode": obj.get("enrollmentCode"), + "theme": obj.get("theme"), + "assignmentsCount": obj.get("assignmentsCount"), + "studentsGroup": GroupDetails.from_dict(obj["studentsGroup"]) if obj.get("studentsGroup") is not None else None, + "teachersGroup": GroupDetails.from_dict(obj["teachersGroup"]) if obj.get("teachersGroup") is not None else None, + "issues": ClassDetailsIssues.from_dict(obj["issues"]) if obj.get("issues") is not None else None, + "googleClassroom": ClassDetailsGoogleClassroom.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, + "googleDrive": ClassDetailsGoogleDrive.from_dict(obj["googleDrive"]) if obj.get("googleDrive") is not None else None, + "microsoftGraph": ClassDetailsMicrosoftGraph.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, + "lti": ClassDetailsLti.from_dict(obj["lti"]) if obj.get("lti") is not None else None, + "canvas": ClassDetailsCanvas.from_dict(obj["canvas"]) if obj.get("canvas") is not None else None, + "mfc": ClassDetailsMfc.from_dict(obj["mfc"]) if obj.get("mfc") is not None else None, + "clever": ClassDetailsClever.from_dict(obj["clever"]) if obj.get("clever") is not None else None, + "level": obj.get("level"), + "skillsFocused": obj.get("skillsFocused"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_canvas.py b/flat_api/aio/models/class_details_canvas.py new file mode 100644 index 0000000..cbf2502 --- /dev/null +++ b/flat_api/aio/models/class_details_canvas.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsCanvas(BaseModel): + """ + Meta information provided by Canvs LMS + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on Canvas") + domain: Optional[StrictStr] = Field(default=None, description="Canvas instance domain (e.g. \"canvas.instructure.com\")") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "domain"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsCanvas from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsCanvas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "domain": obj.get("domain") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_clever.py b/flat_api/aio/models/class_details_clever.py new file mode 100644 index 0000000..8b3e893 --- /dev/null +++ b/flat_api/aio/models/class_details_clever.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsClever(BaseModel): + """ + Clever.com section-related information + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Clever section unique identifier") + creation_date: Optional[datetime] = Field(default=None, description="The creation date of the section on clever", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="The last modification date of the section on clever", alias="modificationDate") + subject: Optional[StrictStr] = Field(default=None, description="Normalized subject of the course") + term_name: Optional[StrictStr] = Field(default=None, description="Name of the term when this course happens", alias="termName") + term_start_date: Optional[datetime] = Field(default=None, description="Beginning date of the term", alias="termStartDate") + term_end_date: Optional[datetime] = Field(default=None, description="End date of the term", alias="termEndDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "creationDate", "modificationDate", "subject", "termName", "termStartDate", "termEndDate"] + + @field_validator('subject') + def subject_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other']): + raise ValueError("must be one of enum values ('english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsClever from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsClever from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), + "subject": obj.get("subject"), + "termName": obj.get("termName"), + "termStartDate": obj.get("termStartDate"), + "termEndDate": obj.get("termEndDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_google_classroom.py b/flat_api/aio/models/class_details_google_classroom.py new file mode 100644 index 0000000..82a3bd1 --- /dev/null +++ b/flat_api/aio/models/class_details_google_classroom.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsGoogleClassroom(BaseModel): + """ + Google Classroom course-related information + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The course identifier on Google Classroom") + alternate_link: Optional[StrictStr] = Field(default=None, description="Absolute link to this course in the Classroom web UI", alias="alternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "alternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsGoogleClassroom from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsGoogleClassroom from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alternateLink": obj.get("alternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_google_drive.py b/flat_api/aio/models/class_details_google_drive.py new file mode 100644 index 0000000..d6b9c49 --- /dev/null +++ b/flat_api/aio/models/class_details_google_drive.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsGoogleDrive(BaseModel): + """ + Google Drive course-related information provided by Google Classroom + """ # noqa: E501 + teacher_folder_id: Optional[StrictStr] = Field(default=None, description="[Teachers only] The Drive directory identifier of the teachers' folder ", alias="teacherFolderId") + teacher_folder_alternate_link: Optional[StrictStr] = Field(default=None, description="[Teachers only] The Drive URL of the teachers' folder ", alias="teacherFolderAlternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["teacherFolderId", "teacherFolderAlternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsGoogleDrive from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsGoogleDrive from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "teacherFolderId": obj.get("teacherFolderId"), + "teacherFolderAlternateLink": obj.get("teacherFolderAlternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_issues.py b/flat_api/aio/models/class_details_issues.py new file mode 100644 index 0000000..412d81c --- /dev/null +++ b/flat_api/aio/models/class_details_issues.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.class_details_issues_sync_inner import ClassDetailsIssuesSyncInner +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsIssues(BaseModel): + """ + Detected issues for this class + """ # noqa: E501 + sync: Optional[List[ClassDetailsIssuesSyncInner]] = Field(default=None, description="Synchronization issues for the class") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["sync"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsIssues from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in sync (list) + _items = [] + if self.sync: + for _item_sync in self.sync: + if _item_sync: + _items.append(_item_sync.to_dict()) + _dict['sync'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsIssues from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "sync": [ClassDetailsIssuesSyncInner.from_dict(_item) for _item in obj["sync"]] if obj.get("sync") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_issues_sync_inner.py b/flat_api/aio/models/class_details_issues_sync_inner.py new file mode 100644 index 0000000..42c8098 --- /dev/null +++ b/flat_api/aio/models/class_details_issues_sync_inner.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsIssuesSyncInner(BaseModel): + """ + A sync issue + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The account user identifier") + email: Optional[StrictStr] = Field(default=None, description="The email address of the user concerned by this sync issue") + reason: Optional[StrictStr] = Field(default=None, description="The reason why the account cannot be synced") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "email", "reason"] + + @field_validator('reason') + def reason_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['otherOrgnanization', 'productMigration', 'disabledAccount']): + raise ValueError("must be one of enum values ('otherOrgnanization', 'productMigration', 'disabledAccount')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsIssuesSyncInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsIssuesSyncInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "email": obj.get("email"), + "reason": obj.get("reason") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_lti.py b/flat_api/aio/models/class_details_lti.py new file mode 100644 index 0000000..e53098e --- /dev/null +++ b/flat_api/aio/models/class_details_lti.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsLti(BaseModel): + """ + Info about LTI context (1.1 and 1.3) + """ # noqa: E501 + context_id: Optional[StrictStr] = Field(default=None, description="Unique context identifier provided", alias="contextId") + context_title: Optional[StrictStr] = Field(default=None, description="Context title", alias="contextTitle") + context_label: Optional[StrictStr] = Field(default=None, description="Context label", alias="contextLabel") + has_nrps_service: Optional[StrictBool] = Field(default=None, description="If true, the class has been synchronized with the LTI 1.3 NRPS 2.0 service", alias="hasNrpsService") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["contextId", "contextTitle", "contextLabel", "hasNrpsService"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsLti from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsLti from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "contextId": obj.get("contextId"), + "contextTitle": obj.get("contextTitle"), + "contextLabel": obj.get("contextLabel"), + "hasNrpsService": obj.get("hasNrpsService") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_mfc.py b/flat_api/aio/models/class_details_mfc.py new file mode 100644 index 0000000..f21f807 --- /dev/null +++ b/flat_api/aio/models/class_details_mfc.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsMfc(BaseModel): + """ + Meta information provided by Canvs LMS + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on MusicFirst Classroom") + alternate_link: Optional[StrictStr] = Field(default=None, description="Link to MusicFirst Classroom class", alias="alternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "alternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsMfc from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsMfc from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alternateLink": obj.get("alternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_details_microsoft_graph.py b/flat_api/aio/models/class_details_microsoft_graph.py new file mode 100644 index 0000000..edd2e3c --- /dev/null +++ b/flat_api/aio/models/class_details_microsoft_graph.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassDetailsMicrosoftGraph(BaseModel): + """ + ClassDetailsMicrosoftGraph + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The course identifier on Microsoft Graph") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassDetailsMicrosoftGraph from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassDetailsMicrosoftGraph from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/class_grade_level.py b/flat_api/aio/models/class_grade_level.py new file mode 100644 index 0000000..112409e --- /dev/null +++ b/flat_api/aio/models/class_grade_level.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ClassGradeLevel(str, Enum): + """ + Class grade level + """ + + """ + allowed enum values + """ + ELEMENTARY = 'elementary' + MIDDLE = 'middle' + HIGH = 'high' + UNIVERSITY = 'university' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ClassGradeLevel from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/class_roles.py b/flat_api/aio/models/class_roles.py new file mode 100644 index 0000000..b1c6f03 --- /dev/null +++ b/flat_api/aio/models/class_roles.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ClassRoles(str, Enum): + """ + User's Class Role (for Edu users only) + """ + + """ + allowed enum values + """ + TEACHER = 'teacher' + STUDENT = 'student' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ClassRoles from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/class_state.py b/flat_api/aio/models/class_state.py new file mode 100644 index 0000000..51d66f3 --- /dev/null +++ b/flat_api/aio/models/class_state.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ClassState(str, Enum): + """ + The state of a classroom + """ + + """ + allowed enum values + """ + ACTIVE = 'active' + INACTIVE = 'inactive' + ARCHIVED = 'archived' + DELETED = 'deleted' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ClassState from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/class_update.py b/flat_api/aio/models/class_update.py new file mode 100644 index 0000000..d354427 --- /dev/null +++ b/flat_api/aio/models/class_update.py @@ -0,0 +1,128 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from flat_api.aio.models.class_grade_level import ClassGradeLevel +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassUpdate(BaseModel): + """ + Update of a classroom + """ # noqa: E501 + name: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The name of the class") + section: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, description="The section of the class") + level: Optional[ClassGradeLevel] = None + skills_focused: Optional[List[StrictStr]] = Field(default=None, description="Specific skills that will be focused in classroom", alias="skillsFocused") + size: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="Number of students in the classroom") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "section", "level", "skillsFocused", "size"] + + @field_validator('skills_focused') + def skills_focused_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + for i in value: + if i not in set(['notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other']): + raise ValueError("each list item must be one of ('notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if size (nullable) is None + # and model_fields_set contains the field + if self.size is None and "size" in self.model_fields_set: + _dict['size'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "section": obj.get("section"), + "level": obj.get("level"), + "skillsFocused": obj.get("skillsFocused"), + "size": obj.get("size") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/collection.py b/flat_api/aio/models/collection.py new file mode 100644 index 0000000..0c4172a --- /dev/null +++ b/flat_api/aio/models/collection.py @@ -0,0 +1,167 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.collection_app import CollectionApp +from flat_api.aio.models.collection_capabilities import CollectionCapabilities +from flat_api.aio.models.collection_contents import CollectionContents +from flat_api.aio.models.collection_privacy import CollectionPrivacy +from flat_api.aio.models.collection_type import CollectionType +from flat_api.aio.models.resource_collaborator import ResourceCollaborator +from flat_api.aio.models.resource_rights import ResourceRights +from flat_api.aio.models.user_public_summary import UserPublicSummary +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Collection(BaseModel): + """ + Collection of scores + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the collection") + title: StrictStr = Field(description="The title of the collection") + html_url: StrictStr = Field(description="The url where the collection can be viewed in a web browser", alias="htmlUrl") + type: CollectionType + label_key: Optional[StrictStr] = Field(default=None, description="Product-specific translation key for the collection type. Only set for specific collection types: * For `regular` type: `playlist` (Flat) or `collection` (Flat for Education) * For `collaborations` type: `collaboration` (Flat) or `shared-scores` (Flat for Education) Not set for other collection types. ", alias="labelKey") + privacy: CollectionPrivacy + sharing_key: Optional[StrictStr] = Field(default=None, description="The private sharing key of the collection (available when the `privacy` mode is set to `privateLink`)", alias="sharingKey") + app: Optional[CollectionApp] = None + creation_date: datetime = Field(description="The date when the collection was created", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="The date when the collection was last modified", alias="modificationDate") + user: Optional[UserPublicSummary] = None + organization: Optional[StrictStr] = Field(default=None, description="If the score has been created in an organization, the identifier of this organization. ") + rights: Optional[ResourceRights] = None + collaborators: Optional[List[ResourceCollaborator]] = Field(default=None, description="The list of the collaborators of the collection") + is_pinned: Optional[StrictBool] = Field(default=None, description="Whether the collection is pinned by the owner", alias="isPinned") + contents: CollectionContents + capabilities: CollectionCapabilities + collections: Optional[List[StrictStr]] = Field(default=None, description="The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "title", "htmlUrl", "type", "labelKey", "privacy", "sharingKey", "app", "creationDate", "modificationDate", "user", "organization", "rights", "collaborators", "isPinned", "contents", "capabilities", "collections"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Collection from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of app + if self.app: + _dict['app'] = self.app.to_dict() + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + # override the default output from pydantic by calling `to_dict()` of rights + if self.rights: + _dict['rights'] = self.rights.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in collaborators (list) + _items = [] + if self.collaborators: + for _item_collaborators in self.collaborators: + if _item_collaborators: + _items.append(_item_collaborators.to_dict()) + _dict['collaborators'] = _items + # override the default output from pydantic by calling `to_dict()` of contents + if self.contents: + _dict['contents'] = self.contents.to_dict() + # override the default output from pydantic by calling `to_dict()` of capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Collection from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "title": obj.get("title"), + "htmlUrl": obj.get("htmlUrl"), + "type": obj.get("type"), + "labelKey": obj.get("labelKey"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else CollectionPrivacy.PRIVATE, + "sharingKey": obj.get("sharingKey"), + "app": CollectionApp.from_dict(obj["app"]) if obj.get("app") is not None else None, + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), + "user": UserPublicSummary.from_dict(obj["user"]) if obj.get("user") is not None else None, + "organization": obj.get("organization"), + "rights": ResourceRights.from_dict(obj["rights"]) if obj.get("rights") is not None else None, + "collaborators": [ResourceCollaborator.from_dict(_item) for _item in obj["collaborators"]] if obj.get("collaborators") is not None else None, + "isPinned": obj.get("isPinned"), + "contents": CollectionContents.from_dict(obj["contents"]) if obj.get("contents") is not None else None, + "capabilities": CollectionCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "collections": obj.get("collections") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/collection_app.py b/flat_api/aio/models/collection_app.py new file mode 100644 index 0000000..c057ae5 --- /dev/null +++ b/flat_api/aio/models/collection_app.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CollectionApp(BaseModel): + """ + For App collections, the details of the app that created the collection + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The app unique identifier") + name: Optional[StrictStr] = Field(default=None, description="The name of the app") + logo: Optional[StrictStr] = Field(default=None, description="The app logo url") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "logo"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CollectionApp from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionApp from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "logo": obj.get("logo") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/collection_capabilities.py b/flat_api/aio/models/collection_capabilities.py new file mode 100644 index 0000000..1d9a09e --- /dev/null +++ b/flat_api/aio/models/collection_capabilities.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CollectionCapabilities(BaseModel): + """ + Capabilities the current user has on this collection. Each capability corresponds to a fine-grained action that a user may take. + """ # noqa: E501 + can_edit: StrictBool = Field(description="Whether the current user can modify the metadata for the collection ", alias="canEdit") + can_share: StrictBool = Field(description="Whether the current user can modify the sharing settings for the collection ", alias="canShare") + can_delete: StrictBool = Field(description="Whether the current user can delete the collection ", alias="canDelete") + can_add_scores: StrictBool = Field(description="Whether the current user can add scores to the collection If this collection has the `type` `trash`, this property will be set to `false`. Use `DELETE /v2/scores/{score}` to trash a score. ", alias="canAddScores") + can_delete_scores: StrictBool = Field(description="Whether the current user can delete scores from the collection If this collection has the `type` `trash`, this property will be set to `false`. Use `POST /v2/scores/{score}/untrash` to restore a score. ", alias="canDeleteScores") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["canEdit", "canShare", "canDelete", "canAddScores", "canDeleteScores"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CollectionCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "canEdit": obj.get("canEdit"), + "canShare": obj.get("canShare"), + "canDelete": obj.get("canDelete"), + "canAddScores": obj.get("canAddScores"), + "canDeleteScores": obj.get("canDeleteScores") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/collection_contents.py b/flat_api/aio/models/collection_contents.py new file mode 100644 index 0000000..9d8933b --- /dev/null +++ b/flat_api/aio/models/collection_contents.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CollectionContents(BaseModel): + """ + The contents of the collection + """ # noqa: E501 + scores_count: StrictInt = Field(description="The number of scores in the collection", alias="scoresCount") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["scoresCount"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CollectionContents from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionContents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scoresCount": obj.get("scoresCount") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/collection_creation.py b/flat_api/aio/models/collection_creation.py new file mode 100644 index 0000000..7357433 --- /dev/null +++ b/flat_api/aio/models/collection_creation.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.collection_privacy import CollectionPrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CollectionCreation(BaseModel): + """ + CollectionCreation + """ # noqa: E501 + title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=300)]] = Field(default=None, description="The title of the collection") + privacy: Optional[CollectionPrivacy] = CollectionPrivacy.PRIVATE + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CollectionCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else CollectionPrivacy.PRIVATE + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/collection_modification.py b/flat_api/aio/models/collection_modification.py new file mode 100644 index 0000000..1b742c1 --- /dev/null +++ b/flat_api/aio/models/collection_modification.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.collection_privacy import CollectionPrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CollectionModification(BaseModel): + """ + Edit the collection metadata + """ # noqa: E501 + title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=300)]] = Field(default=None, description="The title of the collection") + privacy: Optional[CollectionPrivacy] = CollectionPrivacy.PRIVATE + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CollectionModification from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionModification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else CollectionPrivacy.PRIVATE + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/collection_privacy.py b/flat_api/aio/models/collection_privacy.py new file mode 100644 index 0000000..46d5eca --- /dev/null +++ b/flat_api/aio/models/collection_privacy.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CollectionPrivacy(str, Enum): + """ + The collection main privacy mode. - `private`: The collection is private and can only be accessed, modified, and administered by specified collaborators. + """ + + """ + allowed enum values + """ + PRIVATE = 'private' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CollectionPrivacy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/collection_type.py b/flat_api/aio/models/collection_type.py new file mode 100644 index 0000000..7a49bda --- /dev/null +++ b/flat_api/aio/models/collection_type.py @@ -0,0 +1,43 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class CollectionType(str, Enum): + """ + Type of the collection. The type will influence the capabilitied available on the collections and how this collection is/can be populated. - `root`: **Deprecated.** Previously the root collection of the user. The `allScores` virtual collection should be used instead. - `regular`: A regular collection created by the user. This collection can be deleted and modified by the user. - `app`: An automatically created collection containing the scores created by an app (e.g. Music Snippet) - `trash`: An automatically created collection containing the trashed scores. Virtual collections: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores + """ + + """ + allowed enum values + """ + ROOT = 'root' + REGULAR = 'regular' + APP = 'app' + TRASH = 'trash' + ALLSCORES = 'allScores' + COLLABORATIONS = 'collaborations' + LIKES = 'likes' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of CollectionType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/create_lti_configuration200_response.py b/flat_api/aio/models/create_lti_configuration200_response.py new file mode 100644 index 0000000..87b0b3b --- /dev/null +++ b/flat_api/aio/models/create_lti_configuration200_response.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration import LtiConfiguration +from flat_api.aio.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.aio.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateLtiConfiguration200Response(LtiConfiguration): + """ + CreateLtiConfiguration200Response + """ # noqa: E501 + registration_url: Optional[StrictStr] = Field(default=None, description="One-time registration URL (only for dynamic registration)", alias="registrationUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "consumerKey", "consumerSecret", "lms", "name", "tool", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching", "parentId", "deploymentKey", "deploymentBreakdownBy", "deploymentBreakdownId", "registrationToken", "registrationUrl", "registrationTokenUsed", "registrationCompletionDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateLtiConfiguration200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if last_used_date (nullable) is None + # and model_fields_set contains the field + if self.last_used_date is None and "last_used_date" in self.model_fields_set: + _dict['lastUsedDate'] = None + + # set to None if registration_completion_date (nullable) is None + # and model_fields_set contains the field + if self.registration_completion_date is None and "registration_completion_date" in self.model_fields_set: + _dict['registrationCompletionDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateLtiConfiguration200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "consumerKey": obj.get("consumerKey"), + "consumerSecret": obj.get("consumerSecret"), + "lms": obj.get("lms"), + "name": obj.get("name"), + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True, + "parentId": obj.get("parentId"), + "deploymentKey": obj.get("deploymentKey"), + "deploymentBreakdownBy": obj.get("deploymentBreakdownBy"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId"), + "registrationToken": obj.get("registrationToken"), + "registrationUrl": obj.get("registrationUrl"), + "registrationTokenUsed": obj.get("registrationTokenUsed"), + "registrationCompletionDate": obj.get("registrationCompletionDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/credit_transaction.py b/flat_api/aio/models/credit_transaction.py new file mode 100644 index 0000000..e4ebbaf --- /dev/null +++ b/flat_api/aio/models/credit_transaction.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreditTransaction(BaseModel): + """ + A single credit ledger entry + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the credit transaction") + type: StrictStr = Field(description="Credit category. `ai` covers every AI-powered feature.") + feature: Optional[StrictStr] = Field(default=None, description="Which product the credits relate to. Set on deductions and on the credits a refund returns, absent on credit-pack top-ups, which are not tied to a single feature. ") + amount: StrictInt = Field(description="How many credits this entry moved, signed: positive for top-ups (`+30` from a credit pack), negative for deductions (`-2` for a two-page import). Sum only entries whose `state` is `active`. ") + source: StrictStr = Field(description="Which pool the credits came from: * `subscription`: the plan's periodic allowance * `purchase`: credits bought as a pack, which do not expire with the billing period * `free_tier`: promotional grants * `support`: a manual adjustment made by Flat's support team A single import can produce two entries when it spans two pools: the plan allowance is drawn down first, and the remainder comes from `purchase`. ") + state: StrictStr = Field(description="Whether the entry still counts: * `active`: in effect * `canceled`: reversed, and no longer affecting the balance. Deductions are canceled when the import they paid for fails or is refunded. ") + job: Optional[StrictStr] = Field(default=None, description="Identifier of the import this entry belongs to, when it relates to one. Present on an import's deduction, on its reversal, and on credits returned when an import is refunded. Absent on credit-pack top-ups and manual adjustments. ") + creation_date: datetime = Field(description="When the transaction was created", alias="creationDate") + modification_date: datetime = Field(description="When the transaction was last modified", alias="modificationDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "feature", "amount", "source", "state", "job", "creationDate", "modificationDate"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ai']): + raise ValueError("must be one of enum values ('ai')") + return value + + @field_validator('feature') + def feature_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['omr']): + raise ValueError("must be one of enum values ('omr')") + return value + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['subscription', 'purchase', 'free_tier', 'support']): + raise ValueError("must be one of enum values ('subscription', 'purchase', 'free_tier', 'support')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['active', 'canceled']): + raise ValueError("must be one of enum values ('active', 'canceled')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreditTransaction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreditTransaction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "feature": obj.get("feature"), + "amount": obj.get("amount"), + "source": obj.get("source"), + "state": obj.get("state"), + "job": obj.get("job"), + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_library.py b/flat_api/aio/models/edu_library.py new file mode 100644 index 0000000..610e62b --- /dev/null +++ b/flat_api/aio/models/edu_library.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduLibrary(BaseModel): + """ + A Flat for Education Library + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the library. This one can be used to list the underlying resources using `GET /v2/eduResources?parent={library-id}` ") + name: StrictStr = Field(description="Name of the lirbary") + type: StrictStr = Field(description="Type of the library") + visibility: StrictStr = Field(description="Visibility of the library") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "type", "visibility"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['myResources', 'organizationResources', 'flatEduContent']): + raise ValueError("must be one of enum values ('myResources', 'organizationResources', 'flatEduContent')") + return value + + @field_validator('visibility') + def visibility_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['private', 'organization', 'public']): + raise ValueError("must be one of enum values ('private', 'organization', 'public')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduLibrary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduLibrary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "type": obj.get("type"), + "visibility": obj.get("visibility") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource.py b/flat_api/aio/models/edu_resource.py new file mode 100644 index 0000000..14c771a --- /dev/null +++ b/flat_api/aio/models/edu_resource.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.edu_resource_capabilities import EduResourceCapabilities +from flat_api.aio.models.edu_resource_privacy import EduResourcePrivacy +from flat_api.aio.models.edu_resource_resource import EduResourceResource +from flat_api.aio.models.edu_resource_type import EduResourceType +from flat_api.aio.models.grade import Grade +from flat_api.aio.models.teaching_theme import TeachingTheme +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResource(BaseModel): + """ + A Flat for Education resource contained in a resources library + """ # noqa: E501 + id: StrictStr = Field(description="Resource unique identifier") + creator: Optional[StrictStr] = Field(default=None, description="The User identifier of the resource creator") + type: EduResourceType + privacy: Optional[EduResourcePrivacy] = EduResourcePrivacy.PRIVATE + tags: Optional[List[StrictStr]] = Field(default=None, description="Specific attributes for the resource (e.g. sample resources with custom design)") + parent: Optional[StrictStr] = Field(default=None, description="Identifier of the parent resource, e.g. a folder or root") + title: StrictStr = Field(description="Title of the resource") + sharing_description: Optional[StrictStr] = Field(default=None, description="Sharing description of this resource", alias="sharingDescription") + sharing_description_html: Optional[StrictStr] = Field(default=None, description="HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. ", alias="sharingDescriptionHtml") + creation_date: Optional[datetime] = Field(default=None, description="The date when the resource was created", alias="creationDate") + update_date: Optional[datetime] = Field(default=None, description="The date when the resource was updated", alias="updateDate") + resource: Optional[EduResourceResource] = None + capabilities: EduResourceCapabilities + subjects: Optional[List[TeachingTheme]] = Field(default=None, description="The subjects of this resource, or the subjects of the resources included in the folder") + grades: Optional[List[Grade]] = Field(default=None, description="The grades of this resource, or the grades of the resources included in the folder.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "creator", "type", "privacy", "tags", "parent", "title", "sharingDescription", "sharingDescriptionHtml", "creationDate", "updateDate", "resource", "capabilities", "subjects", "grades"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resource + if self.resource: + _dict['resource'] = self.resource.to_dict() + # override the default output from pydantic by calling `to_dict()` of capabilities + if self.capabilities: + _dict['capabilities'] = self.capabilities.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "creator": obj.get("creator"), + "type": obj.get("type"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else EduResourcePrivacy.PRIVATE, + "tags": obj.get("tags"), + "parent": obj.get("parent"), + "title": obj.get("title"), + "sharingDescription": obj.get("sharingDescription"), + "sharingDescriptionHtml": obj.get("sharingDescriptionHtml"), + "creationDate": obj.get("creationDate"), + "updateDate": obj.get("updateDate"), + "resource": EduResourceResource.from_dict(obj["resource"]) if obj.get("resource") is not None else None, + "capabilities": EduResourceCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "subjects": obj.get("subjects"), + "grades": obj.get("grades") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_assignment_creation.py b/flat_api/aio/models/edu_resource_assignment_creation.py new file mode 100644 index 0000000..0760582 --- /dev/null +++ b/flat_api/aio/models/edu_resource_assignment_creation.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.assignment_type import AssignmentType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceAssignmentCreation(BaseModel): + """ + Assignment-specific creation options. Only applicable when creating a resource with `type: assignment`. If `type` is not provided, defaults to `none`. + """ # noqa: E501 + type: Optional[AssignmentType] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceAssignmentCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceAssignmentCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_capabilities.py b/flat_api/aio/models/edu_resource_capabilities.py new file mode 100644 index 0000000..183bea9 --- /dev/null +++ b/flat_api/aio/models/edu_resource_capabilities.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceCapabilities(BaseModel): + """ + Capabilities available for this resource + """ # noqa: E501 + can_edit: Optional[StrictBool] = Field(default=None, description="Whether the current user can modify this resource ", alias="canEdit") + can_add_resources: Optional[StrictBool] = Field(default=None, description="Whether the current user can add resources within this resource (e.g. `assignment` inside a `folder`) ", alias="canAddResources") + can_add_folders: Optional[StrictBool] = Field(default=None, description="Whether the current user can add folders within this resource (e.g. `folder` inside `root`) ", alias="canAddFolders") + can_change_privacy: Optional[StrictBool] = Field(default=None, description="Whether the current user can change the privacy of this resource (e.g. to share as `organizationPublic` or unshare it with `private`) ", alias="canChangePrivacy") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["canEdit", "canAddResources", "canAddFolders", "canChangePrivacy"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "canEdit": obj.get("canEdit"), + "canAddResources": obj.get("canAddResources"), + "canAddFolders": obj.get("canAddFolders"), + "canChangePrivacy": obj.get("canChangePrivacy") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_copy.py b/flat_api/aio/models/edu_resource_copy.py new file mode 100644 index 0000000..5ef7a15 --- /dev/null +++ b/flat_api/aio/models/edu_resource_copy.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceCopy(BaseModel): + """ + Copy an education resource + """ # noqa: E501 + destination: StrictStr = Field(description="Unique identifier of the destination of the folder where to copy this resource. This can also be `root` to copy the resource at the root of the user resource library. ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["destination"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceCopy from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceCopy from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "destination": obj.get("destination") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_creation.py b/flat_api/aio/models/edu_resource_creation.py new file mode 100644 index 0000000..3fe21ce --- /dev/null +++ b/flat_api/aio/models/edu_resource_creation.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.edu_resource_assignment_creation import EduResourceAssignmentCreation +from flat_api.aio.models.edu_resource_type import EduResourceType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceCreation(BaseModel): + """ + Creation of an education resource + """ # noqa: E501 + type: EduResourceType + title: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="Title of the resource") + parent: Optional[StrictStr] = Field(default='root', description="Identifier of the parent resource where the new one will created, e.g. a folder id or `root`") + sharing_description: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field(default=None, description="Sharing description of the resource", alias="sharingDescription") + sharing_description_html: Optional[Annotated[str, Field(strict=True, max_length=10000)]] = Field(default=None, description="HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. ", alias="sharingDescriptionHtml") + resource: Optional[EduResourceAssignmentCreation] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "title", "parent", "sharingDescription", "sharingDescriptionHtml", "resource"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of resource + if self.resource: + _dict['resource'] = self.resource.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "title": obj.get("title"), + "parent": obj.get("parent") if obj.get("parent") is not None else 'root', + "sharingDescription": obj.get("sharingDescription"), + "sharingDescriptionHtml": obj.get("sharingDescriptionHtml"), + "resource": EduResourceAssignmentCreation.from_dict(obj["resource"]) if obj.get("resource") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_folder.py b/flat_api/aio/models/edu_resource_folder.py new file mode 100644 index 0000000..2cd4282 --- /dev/null +++ b/flat_api/aio/models/edu_resource_folder.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.assignment_type import AssignmentType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceFolder(BaseModel): + """ + Education resources folder + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="Title of the folder") + assignments_types: Optional[List[AssignmentType]] = Field(default=None, description="The assignment type of the resources that are included in the folder,", alias="assignmentsTypes") + resources_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of resources inside the folder", alias="resourcesCount") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "assignmentsTypes", "resourcesCount"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceFolder from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceFolder from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "assignmentsTypes": obj.get("assignmentsTypes"), + "resourcesCount": obj.get("resourcesCount") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_lti_link.py b/flat_api/aio/models/edu_resource_lti_link.py new file mode 100644 index 0000000..21c2e76 --- /dev/null +++ b/flat_api/aio/models/edu_resource_lti_link.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceLtiLink(BaseModel): + """ + LTI Link details for the class + """ # noqa: E501 + lti_url: StrictStr = Field(description="An URL that can be used to launch LTI with this resource in a classroom.", alias="ltiUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["ltiUrl"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceLtiLink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceLtiLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ltiUrl": obj.get("ltiUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_move.py b/flat_api/aio/models/edu_resource_move.py new file mode 100644 index 0000000..8212436 --- /dev/null +++ b/flat_api/aio/models/edu_resource_move.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceMove(BaseModel): + """ + Move an education resource + """ # noqa: E501 + destination: StrictStr = Field(description="Unique identifier of the destination of the folder where to move this resource. This can also be `root` to move the resource at the root of the user resource library. ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["destination"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceMove from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceMove from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "destination": obj.get("destination") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_privacy.py b/flat_api/aio/models/edu_resource_privacy.py new file mode 100644 index 0000000..21354b8 --- /dev/null +++ b/flat_api/aio/models/edu_resource_privacy.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EduResourcePrivacy(str, Enum): + """ + The Education resource privacy mode. + """ + + """ + allowed enum values + """ + PRIVATE = 'private' + ORGANIZATIONPUBLIC = 'organizationPublic' + PUBLIC = 'public' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EduResourcePrivacy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/edu_resource_resource.py b/flat_api/aio/models/edu_resource_resource.py new file mode 100644 index 0000000..d4b2f34 --- /dev/null +++ b/flat_api/aio/models/edu_resource_resource.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.aio.models.assignment import Assignment +from flat_api.aio.models.edu_resource_folder import EduResourceFolder +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +EDURESOURCERESOURCE_ONE_OF_SCHEMAS = ["Assignment", "EduResourceFolder"] + +class EduResourceResource(BaseModel): + """ + EduResourceResource + """ + # data type: Assignment + oneof_schema_1_validator: Optional[Assignment] = None + # data type: EduResourceFolder + oneof_schema_2_validator: Optional[EduResourceFolder] = None + actual_instance: Optional[Union[Assignment, EduResourceFolder]] = None + one_of_schemas: Set[str] = { "Assignment", "EduResourceFolder" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EduResourceResource.model_construct() + error_messages = [] + match = 0 + # validate data type: Assignment + if not isinstance(v, Assignment): + error_messages.append(f"Error! Input type `{type(v)}` is not `Assignment`") + else: + match += 1 + # validate data type: EduResourceFolder + if not isinstance(v, EduResourceFolder): + error_messages.append(f"Error! Input type `{type(v)}` is not `EduResourceFolder`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into Assignment + try: + instance.actual_instance = Assignment.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EduResourceFolder + try: + instance.actual_instance = EduResourceFolder.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 EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Assignment, EduResourceFolder]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/aio/models/edu_resource_type.py b/flat_api/aio/models/edu_resource_type.py new file mode 100644 index 0000000..ca62b58 --- /dev/null +++ b/flat_api/aio/models/edu_resource_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class EduResourceType(str, Enum): + """ + Type of an education resource + """ + + """ + allowed enum values + """ + ASSIGNMENT = 'assignment' + FOLDER = 'folder' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of EduResourceType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/edu_resource_update.py b/flat_api/aio/models/edu_resource_update.py new file mode 100644 index 0000000..9d175c9 --- /dev/null +++ b/flat_api/aio/models/edu_resource_update.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.edu_resource_privacy import EduResourcePrivacy +from flat_api.aio.models.grade import Grade +from flat_api.aio.models.teaching_theme import TeachingTheme +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceUpdate(BaseModel): + """ + Update of an education resource + """ # noqa: E501 + title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Title of the resource") + sharing_description: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field(default=None, description="Sharing description of the resource", alias="sharingDescription") + sharing_description_html: Optional[Annotated[str, Field(strict=True, max_length=10000)]] = Field(default=None, description="HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. ", alias="sharingDescriptionHtml") + privacy: Optional[EduResourcePrivacy] = EduResourcePrivacy.PRIVATE + subjects: Optional[List[TeachingTheme]] = Field(default=None, description="The subjects of this resource, or the subjects of the resources included in the folder") + grades: Optional[List[Grade]] = Field(default=None, description="The grades of this resource, or the grades of the resources included in the folder.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "sharingDescription", "sharingDescriptionHtml", "privacy", "subjects", "grades"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "sharingDescription": obj.get("sharingDescription"), + "sharingDescriptionHtml": obj.get("sharingDescriptionHtml"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else EduResourcePrivacy.PRIVATE, + "subjects": obj.get("subjects"), + "grades": obj.get("grades") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/edu_resource_use_in_class.py b/flat_api/aio/models/edu_resource_use_in_class.py new file mode 100644 index 0000000..2a2c70e --- /dev/null +++ b/flat_api/aio/models/edu_resource_use_in_class.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceUseInClass(BaseModel): + """ + Use an education resource in class + """ # noqa: E501 + classroom: StrictStr = Field(description="The destination classroom where the resource will be copied.") + assignment: Optional[StrictStr] = Field(default=None, description="An optional destination assignment where the original assignement will be copied. Must be a draft.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["classroom", "assignment"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceUseInClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceUseInClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "classroom": obj.get("classroom"), + "assignment": obj.get("assignment") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/flat_error_response.py b/flat_api/aio/models/flat_error_response.py new file mode 100644 index 0000000..cd87fc5 --- /dev/null +++ b/flat_api/aio/models/flat_error_response.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class FlatErrorResponse(BaseModel): + """ + An API Error response + """ # noqa: E501 + code: StrictStr = Field(description="A corresponding code for this error") + message: StrictStr = Field(description="A printable message for this error") + id: Optional[StrictStr] = Field(default=None, description="An unique error identifier generated for the request") + param: Optional[StrictStr] = Field(default=None, description="The related parameter that caused the error") + provider_message: Optional[StrictStr] = Field(default=None, description="The untranslated error message returned by an external provider (e.g. Google Classroom), when the error originates from one. Only set on errors forwarded from a third party. Meant for support and IT: display it alongside `message`, never in place of it. `message` is the localized, user-facing text; this field is raw provider output and is always in English. ", alias="providerMessage") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "id", "param", "providerMessage"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FlatErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FlatErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message"), + "id": obj.get("id"), + "param": obj.get("param"), + "providerMessage": obj.get("providerMessage") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/google_classroom_coursework.py b/flat_api/aio/models/google_classroom_coursework.py new file mode 100644 index 0000000..cb8191c --- /dev/null +++ b/flat_api/aio/models/google_classroom_coursework.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GoogleClassroomCoursework(BaseModel): + """ + A coursework on Google Classroom + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the coursework assigned by Classroom") + state: Optional[StrictStr] = Field(default=None, description="State of the coursework") + alternate_link: Optional[StrictStr] = Field(default=None, description="Absolute link to this coursework in the Classroom web UI", alias="alternateLink") + topic_id: Optional[StrictStr] = Field(default=None, description="Identifier of the topic where the assignment is created", alias="topicId") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state", "alternateLink", "topicId"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GoogleClassroomCoursework from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if topic_id (nullable) is None + # and model_fields_set contains the field + if self.topic_id is None and "topic_id" in self.model_fields_set: + _dict['topicId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GoogleClassroomCoursework from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "alternateLink": obj.get("alternateLink"), + "topicId": obj.get("topicId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/google_classroom_submission.py b/flat_api/aio/models/google_classroom_submission.py new file mode 100644 index 0000000..6975dde --- /dev/null +++ b/flat_api/aio/models/google_classroom_submission.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GoogleClassroomSubmission(BaseModel): + """ + A coursework submission on Google Classroom + """ # noqa: E501 + id: StrictStr = Field(description="Identifier of the coursework submission assigned by Classroom") + state: StrictStr = Field(description="State of the submission on Google Classroom") + alternate_link: StrictStr = Field(description="Absolute link to this coursework in the Classroom web UI", alias="alternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state", "alternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GoogleClassroomSubmission from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GoogleClassroomSubmission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "alternateLink": obj.get("alternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/grade.py b/flat_api/aio/models/grade.py new file mode 100644 index 0000000..16a122a --- /dev/null +++ b/flat_api/aio/models/grade.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class Grade(str, Enum): + """ + Class grade of the resource + """ + + """ + allowed enum values + """ + ENUM_1 = '1' + ENUM_2 = '2' + ENUM_3 = '3' + ENUM_4 = '4' + ENUM_5 = '5' + ENUM_6 = '6' + ENUM_7 = '7' + ENUM_8 = '8' + ENUM_9 = '9' + ENUM_10 = '10' + ENUM_11 = '11' + ENUM_12 = '12' + UNIVERSITY = 'university' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Grade from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/group.py b/flat_api/aio/models/group.py new file mode 100644 index 0000000..e79a3d0 --- /dev/null +++ b/flat_api/aio/models/group.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.group_type import GroupType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Group(BaseModel): + """ + A group of users + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the group") + name: Optional[StrictStr] = Field(default=None, description="The display name of the group") + type: Optional[GroupType] = None + users_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of users in this group", alias="usersCount") + read_only: Optional[StrictBool] = Field(default=None, description="`True` if the group is set in read-only ", alias="readOnly") + organization: Optional[StrictStr] = Field(default=None, description="If the group is related to an organization, this field will contain the unique identifier of the organization ") + creation_date: Optional[datetime] = Field(default=None, description="The creation date of the group", alias="creationDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "type", "usersCount", "readOnly", "organization", "creationDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Group from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Group from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "type": obj.get("type"), + "usersCount": obj.get("usersCount"), + "readOnly": obj.get("readOnly"), + "organization": obj.get("organization"), + "creationDate": obj.get("creationDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/group_creation.py b/flat_api/aio/models/group_creation.py new file mode 100644 index 0000000..cbcbe9d --- /dev/null +++ b/flat_api/aio/models/group_creation.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GroupCreation(BaseModel): + """ + GroupCreation + """ # noqa: E501 + type: StrictStr = Field(description="Type of group (currently only classStudentsSubGroup is supported)") + classroom: StrictStr = Field(description="Classroom ID") + name: Optional[StrictStr] = Field(default=None, description="Name of the group (optional - auto-generated if not provided). **Special names:** * `edu:testing-students`: Creates a group tagged for test student accounts. The display name will be localized (e.g., \"Test Students\") and the group will be tagged with `edu:testing-students`. ") + members: Optional[List[StrictStr]] = Field(default=None, description="Array of student IDs to add to the group") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "classroom", "name", "members"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['classStudentsSubGroup']): + raise ValueError("must be one of enum values ('classStudentsSubGroup')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "classroom": obj.get("classroom"), + "name": obj.get("name"), + "members": obj.get("members") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/group_details.py b/flat_api/aio/models/group_details.py new file mode 100644 index 0000000..6f5bd55 --- /dev/null +++ b/flat_api/aio/models/group_details.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.group_type import GroupType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GroupDetails(BaseModel): + """ + The details of a group + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the group") + name: StrictStr = Field(description="The displayable name of the group") + type: GroupType + organization: Optional[StrictStr] = Field(default=None, description="The unique identifier of the Organization owning the group") + classroom: Optional[StrictStr] = Field(default=None, description="The unique identifier of the classroom owning the group. Only available for groups of type 'classromStudentsSubGroup' or 'assignmentStudentsSubGroup'") + assignment: Optional[StrictStr] = Field(default=None, description="The unique identifier of the assignment owning the group. Only available for groups of type 'assignmentStudentsSubGroup'.") + parent: Optional[StrictStr] = Field(default=None, description="The unique identifier of the parent class group. Only available for groups of type 'assignmentStudentsSubGroup'. May be null if the parent class group was deleted.") + creation_date: datetime = Field(description="The date when the group was create", alias="creationDate") + users_count: Union[StrictFloat, StrictInt] = Field(description="The number of students in this group", alias="usersCount") + read_only: StrictBool = Field(description="`true` if the properties and members of this group are in in read-only ", alias="readOnly") + tags: List[StrictStr] = Field(description="Tags for categorizing groups. * `edu:testing-students`: Marks this group as containing test student accounts ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "type", "organization", "classroom", "assignment", "parent", "creationDate", "usersCount", "readOnly", "tags"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "type": obj.get("type"), + "organization": obj.get("organization"), + "classroom": obj.get("classroom"), + "assignment": obj.get("assignment"), + "parent": obj.get("parent"), + "creationDate": obj.get("creationDate"), + "usersCount": obj.get("usersCount"), + "readOnly": obj.get("readOnly"), + "tags": obj.get("tags") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/group_type.py b/flat_api/aio/models/group_type.py new file mode 100644 index 0000000..c9e76a9 --- /dev/null +++ b/flat_api/aio/models/group_type.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class GroupType(str, Enum): + """ + The type of the group: * `generic`: A group created by a Flat user * `classTeachers`: A group created automaticaly by Flat that contains the teachers of a class * `classStudents`: A group created automaticaly by Flat that contains the studnets of a class * `classStudentsSubGroup`: Manually created sub-group of students of a class. * `assignmentStudentsSubGroup`: Manually created Sub-group of students of a class, in relation to a specific assignment. + """ + + """ + allowed enum values + """ + GENERIC = 'generic' + CLASSTEACHERS = 'classTeachers' + CLASSSTUDENTS = 'classStudents' + CLASSSTUDENTSSUBGROUP = 'classStudentsSubGroup' + ASSIGNMENTSTUDENTSSUBGROUP = 'assignmentStudentsSubGroup' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of GroupType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/license_mode.py b/flat_api/aio/models/license_mode.py new file mode 100644 index 0000000..7758678 --- /dev/null +++ b/flat_api/aio/models/license_mode.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class LicenseMode(str, Enum): + """ + Mode of the license + """ + + """ + allowed enum values + """ + CREDIT = 'credit' + SITE = 'site' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of LicenseMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/license_sources.py b/flat_api/aio/models/license_sources.py new file mode 100644 index 0000000..0ab0988 --- /dev/null +++ b/flat_api/aio/models/license_sources.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class LicenseSources(str, Enum): + """ + Source of the license + """ + + """ + allowed enum values + """ + ORDER = 'order' + TRIAL = 'trial' + VOUCHER = 'voucher' + DISTRIBUTOR = 'distributor' + SUBSCRIPTION = 'subscription' + APPSTORE = 'appStore' + PLAYSTORE = 'playStore' + MUSICFIRST = 'musicfirst' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of LicenseSources from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/lms_name.py b/flat_api/aio/models/lms_name.py new file mode 100644 index 0000000..5648b1b --- /dev/null +++ b/flat_api/aio/models/lms_name.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class LmsName(str, Enum): + """ + LMS name + """ + + """ + allowed enum values + """ + CANVAS = 'canvas' + MOODLE = 'moodle' + SCHOOLOGY = 'schoology' + BLACKBOARD = 'blackboard' + DESIRE2LEARN = 'desire2learn' + SAKAI = 'sakai' + SCHOOLBOX = 'schoolbox' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of LmsName from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/lti_configuration.py b/flat_api/aio/models/lti_configuration.py new file mode 100644 index 0000000..46a8973 --- /dev/null +++ b/flat_api/aio/models/lti_configuration.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.aio.models.lti_configuration1p1 import LtiConfiguration1p1 +from flat_api.aio.models.lti_configuration1p3 import LtiConfiguration1p3 +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LTICONFIGURATION_ONE_OF_SCHEMAS = ["LtiConfiguration1p1", "LtiConfiguration1p3"] + +class LtiConfiguration(BaseModel): + """ + LTI configuration details (unified 1.1 and 1.3) + """ + # data type: LtiConfiguration1p1 + oneof_schema_1_validator: Optional[LtiConfiguration1p1] = None + # data type: LtiConfiguration1p3 + oneof_schema_2_validator: Optional[LtiConfiguration1p3] = None + actual_instance: Optional[Union[LtiConfiguration1p1, LtiConfiguration1p3]] = None + one_of_schemas: Set[str] = { "LtiConfiguration1p1", "LtiConfiguration1p3" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + 'createLtiConfiguration_200_response': 'CreateLtiConfiguration200Response' + } + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LtiConfiguration.model_construct() + error_messages = [] + match = 0 + # validate data type: LtiConfiguration1p1 + if not isinstance(v, LtiConfiguration1p1): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p1`") + else: + match += 1 + # validate data type: LtiConfiguration1p3 + if not isinstance(v, LtiConfiguration1p3): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LtiConfiguration1p1 + try: + instance.actual_instance = LtiConfiguration1p1.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfiguration1p3 + try: + instance.actual_instance = LtiConfiguration1p3.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 LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfiguration1p1, LtiConfiguration1p3]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/aio/models/lti_configuration1p1.py b/flat_api/aio/models/lti_configuration1p1.py new file mode 100644 index 0000000..f2dab43 --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p1.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration1p1_all_of_tool import LtiConfiguration1p1AllOfTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p1(BaseModel): + """ + LtiConfiguration1p1 + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.1)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + consumer_key: Optional[StrictStr] = Field(default=None, description="LTI 1.1 consumer key", alias="consumerKey") + consumer_secret: Optional[StrictStr] = Field(default=None, description="LTI 1.1 consumer secret (only included for admins)", alias="consumerSecret") + lms: Optional[StrictStr] = Field(default=None, description="LMS type") + name: Optional[StrictStr] = Field(default=None, description="Configuration name") + tool: Optional[LtiConfiguration1p1AllOfTool] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "consumerKey", "consumerSecret", "lms", "name", "tool"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p1']): + raise ValueError("must be one of enum values ('1p1')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "consumerKey": obj.get("consumerKey"), + "consumerSecret": obj.get("consumerSecret"), + "lms": obj.get("lms"), + "name": obj.get("name"), + "tool": LtiConfiguration1p1AllOfTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p1_all_of_tool.py b/flat_api/aio/models/lti_configuration1p1_all_of_tool.py new file mode 100644 index 0000000..39bbbbc --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p1_all_of_tool.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p1AllOfTool(BaseModel): + """ + Platform/tool product information + """ # noqa: E501 + product: Optional[StrictStr] = Field(default=None, description="Product family code (e.g., canvas, moodle, schoology)") + version: Optional[StrictStr] = Field(default=None, description="Platform version string") + instance_name: Optional[StrictStr] = Field(default=None, description="Instance display name", alias="instanceName") + instance_guid: Optional[StrictStr] = Field(default=None, description="Unique instance identifier", alias="instanceGuid") + instance_contact: Optional[StrictStr] = Field(default=None, description="Contact email or handle for the instance", alias="instanceContact") + instance_domain: Optional[StrictStr] = Field(default=None, description="Instance root domain", alias="instanceDomain") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["product", "version", "instanceName", "instanceGuid", "instanceContact", "instanceDomain"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1AllOfTool from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1AllOfTool from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "product": obj.get("product"), + "version": obj.get("version"), + "instanceName": obj.get("instanceName"), + "instanceGuid": obj.get("instanceGuid"), + "instanceContact": obj.get("instanceContact"), + "instanceDomain": obj.get("instanceDomain") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3.py b/flat_api/aio/models/lti_configuration1p3.py new file mode 100644 index 0000000..e770f6e --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.aio.models.lti_configuration1p3_deployment import LtiConfiguration1p3Deployment +from flat_api.aio.models.lti_configuration1p3_dynamic import LtiConfiguration1p3Dynamic +from flat_api.aio.models.lti_configuration1p3_manual import LtiConfiguration1p3Manual +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LTICONFIGURATION1P3_ONE_OF_SCHEMAS = ["LtiConfiguration1p3Deployment", "LtiConfiguration1p3Dynamic", "LtiConfiguration1p3Manual"] + +class LtiConfiguration1p3(BaseModel): + """ + LTI 1.3 configuration details + """ + # data type: LtiConfiguration1p3Manual + oneof_schema_1_validator: Optional[LtiConfiguration1p3Manual] = None + # data type: LtiConfiguration1p3Deployment + oneof_schema_2_validator: Optional[LtiConfiguration1p3Deployment] = None + # data type: LtiConfiguration1p3Dynamic + oneof_schema_3_validator: Optional[LtiConfiguration1p3Dynamic] = None + actual_instance: Optional[Union[LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual]] = None + one_of_schemas: Set[str] = { "LtiConfiguration1p3Deployment", "LtiConfiguration1p3Dynamic", "LtiConfiguration1p3Manual" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LtiConfiguration1p3.model_construct() + error_messages = [] + match = 0 + # validate data type: LtiConfiguration1p3Manual + if not isinstance(v, LtiConfiguration1p3Manual): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3Manual`") + else: + match += 1 + # validate data type: LtiConfiguration1p3Deployment + if not isinstance(v, LtiConfiguration1p3Deployment): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3Deployment`") + else: + match += 1 + # validate data type: LtiConfiguration1p3Dynamic + if not isinstance(v, LtiConfiguration1p3Dynamic): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3Dynamic`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LtiConfiguration1p3Manual + try: + instance.actual_instance = LtiConfiguration1p3Manual.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfiguration1p3Deployment + try: + instance.actual_instance = LtiConfiguration1p3Deployment.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfiguration1p3Dynamic + try: + instance.actual_instance = LtiConfiguration1p3Dynamic.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 LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/aio/models/lti_configuration1p3_base.py b/flat_api/aio/models/lti_configuration1p3_base.py new file mode 100644 index 0000000..100f49e --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_base.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.aio.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Base(BaseModel): + """ + LtiConfiguration1p3Base + """ # noqa: E501 + mode: Optional[StrictStr] = Field(default=None, description="LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-manual', '1p3-deployment', '1p3-dynamic']): + raise ValueError("must be one of enum values ('1p3-manual', '1p3-deployment', '1p3-dynamic')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Base from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Base from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_base_supported_services.py b/flat_api/aio/models/lti_configuration1p3_base_supported_services.py new file mode 100644 index 0000000..5a6cfd1 --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_base_supported_services.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration1p3_base_supported_services_ags import LtiConfiguration1p3BaseSupportedServicesAgs +from flat_api.aio.models.lti_configuration1p3_base_supported_services_deep_linking import LtiConfiguration1p3BaseSupportedServicesDeepLinking +from flat_api.aio.models.lti_configuration1p3_base_supported_services_nrps import LtiConfiguration1p3BaseSupportedServicesNrps +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServices(BaseModel): + """ + LTI services support information + """ # noqa: E501 + ags: Optional[LtiConfiguration1p3BaseSupportedServicesAgs] = None + nrps: Optional[LtiConfiguration1p3BaseSupportedServicesNrps] = None + deep_linking: Optional[LtiConfiguration1p3BaseSupportedServicesDeepLinking] = Field(default=None, alias="deepLinking") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["ags", "nrps", "deepLinking"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServices from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of ags + if self.ags: + _dict['ags'] = self.ags.to_dict() + # override the default output from pydantic by calling `to_dict()` of nrps + if self.nrps: + _dict['nrps'] = self.nrps.to_dict() + # override the default output from pydantic by calling `to_dict()` of deep_linking + if self.deep_linking: + _dict['deepLinking'] = self.deep_linking.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServices from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ags": LtiConfiguration1p3BaseSupportedServicesAgs.from_dict(obj["ags"]) if obj.get("ags") is not None else None, + "nrps": LtiConfiguration1p3BaseSupportedServicesNrps.from_dict(obj["nrps"]) if obj.get("nrps") is not None else None, + "deepLinking": LtiConfiguration1p3BaseSupportedServicesDeepLinking.from_dict(obj["deepLinking"]) if obj.get("deepLinking") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_base_supported_services_ags.py b/flat_api/aio/models/lti_configuration1p3_base_supported_services_ags.py new file mode 100644 index 0000000..30cc3b5 --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_base_supported_services_ags.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServicesAgs(BaseModel): + """ + Assignment and Grade Services support + """ # noqa: E501 + available: Optional[StrictBool] = Field(default=None, description="Whether AGS claims were detected in launches from this platform") + version: Optional[StrictStr] = Field(default=None, description="AGS version supported (e.g., \"2.0\")") + enabled: Optional[StrictBool] = Field(default=None, description="Whether we have AGS enabled for this platform") + lineitems_url: Optional[StrictStr] = Field(default=None, description="Base URL for line items operations as provided by the platform", alias="lineitemsUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["available", "version", "enabled", "lineitemsUrl"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesAgs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesAgs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "version": obj.get("version"), + "enabled": obj.get("enabled"), + "lineitemsUrl": obj.get("lineitemsUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_base_supported_services_deep_linking.py b/flat_api/aio/models/lti_configuration1p3_base_supported_services_deep_linking.py new file mode 100644 index 0000000..a92f835 --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_base_supported_services_deep_linking.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServicesDeepLinking(BaseModel): + """ + Deep Linking support + """ # noqa: E501 + available: Optional[StrictBool] = Field(default=None, description="Whether Deep Linking claims were detected in launches from this platform") + version: Optional[StrictStr] = Field(default=None, description="Deep Linking version supported (e.g., \"2.0\")") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["available", "version"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesDeepLinking from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesDeepLinking from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "version": obj.get("version") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_base_supported_services_nrps.py b/flat_api/aio/models/lti_configuration1p3_base_supported_services_nrps.py new file mode 100644 index 0000000..580fff9 --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_base_supported_services_nrps.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServicesNrps(BaseModel): + """ + Names and Role Provisioning Services support + """ # noqa: E501 + available: Optional[StrictBool] = Field(default=None, description="Whether NRPS claims were detected in launches from this platform") + version: Optional[StrictStr] = Field(default=None, description="NRPS version supported (e.g., \"2.0\")") + enabled: Optional[StrictBool] = Field(default=None, description="Whether we have NRPS enabled for this platform") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["available", "version", "enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesNrps from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesNrps from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "version": obj.get("version"), + "enabled": obj.get("enabled") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_base_tool.py b/flat_api/aio/models/lti_configuration1p3_base_tool.py new file mode 100644 index 0000000..9fd38e6 --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_base_tool.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseTool(BaseModel): + """ + Platform/tool product information + """ # noqa: E501 + product: Optional[StrictStr] = Field(default=None, description="Product family code (e.g., canvas, moodle, schoology)") + version: Optional[StrictStr] = Field(default=None, description="Platform version string") + instance_name: Optional[StrictStr] = Field(default=None, description="Instance name (e.g., 'My University Canvas')", alias="instanceName") + instance_guid: Optional[StrictStr] = Field(default=None, description="Unique instance identifier", alias="instanceGuid") + instance_contact: Optional[StrictStr] = Field(default=None, description="Contact email or handle for the instance", alias="instanceContact") + instance_domain: Optional[StrictStr] = Field(default=None, description="Instance root domain", alias="instanceDomain") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["product", "version", "instanceName", "instanceGuid", "instanceContact", "instanceDomain"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseTool from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseTool from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "product": obj.get("product"), + "version": obj.get("version"), + "instanceName": obj.get("instanceName"), + "instanceGuid": obj.get("instanceGuid"), + "instanceContact": obj.get("instanceContact"), + "instanceDomain": obj.get("instanceDomain") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_deployment.py b/flat_api/aio/models/lti_configuration1p3_deployment.py new file mode 100644 index 0000000..f248c5d --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_deployment.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.aio.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Deployment(BaseModel): + """ + LtiConfiguration1p3Deployment + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.3)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + mode: Optional[StrictStr] = Field(default=None, description="Deployment-based LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + parent_id: Optional[StrictStr] = Field(default=None, description="Parent configuration ID (for deployment-based configs)", alias="parentId") + deployment_key: Optional[StrictStr] = Field(default=None, description="Deployment key (e.g., schoology, classlink)", alias="deploymentKey") + deployment_breakdown_by: Optional[StrictStr] = Field(default=None, description="Custom claim used for tenant identification (parent platforms only, read-only)", alias="deploymentBreakdownBy") + deployment_breakdown_id: Optional[StrictStr] = Field(default=None, description="Value of the custom claim that identifies this specific tenant (child platforms only)", alias="deploymentBreakdownId") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching", "parentId", "deploymentKey", "deploymentBreakdownBy", "deploymentBreakdownId"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3']): + raise ValueError("must be one of enum values ('1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-deployment']): + raise ValueError("must be one of enum values ('1p3-deployment')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Deployment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Deployment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True, + "parentId": obj.get("parentId"), + "deploymentKey": obj.get("deploymentKey"), + "deploymentBreakdownBy": obj.get("deploymentBreakdownBy"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_dynamic.py b/flat_api/aio/models/lti_configuration1p3_dynamic.py new file mode 100644 index 0000000..772cad1 --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_dynamic.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.aio.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Dynamic(BaseModel): + """ + LtiConfiguration1p3Dynamic + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.3)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + mode: Optional[StrictStr] = Field(default=None, description="Dynamic registration LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + registration_token: Optional[StrictStr] = Field(default=None, description="Only included for admins", alias="registrationToken") + registration_url: Optional[StrictStr] = Field(default=None, description="Dynamic registration URL (only included for admins when available)", alias="registrationUrl") + registration_token_used: Optional[StrictBool] = Field(default=None, description="Whether dynamic registration token has been used", alias="registrationTokenUsed") + registration_completion_date: Optional[datetime] = Field(default=None, description="Date when dynamic registration completed (null when not completed)", alias="registrationCompletionDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching", "registrationToken", "registrationUrl", "registrationTokenUsed", "registrationCompletionDate"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3']): + raise ValueError("must be one of enum values ('1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-dynamic']): + raise ValueError("must be one of enum values ('1p3-dynamic')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Dynamic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if registration_completion_date (nullable) is None + # and model_fields_set contains the field + if self.registration_completion_date is None and "registration_completion_date" in self.model_fields_set: + _dict['registrationCompletionDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Dynamic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True, + "registrationToken": obj.get("registrationToken"), + "registrationUrl": obj.get("registrationUrl"), + "registrationTokenUsed": obj.get("registrationTokenUsed"), + "registrationCompletionDate": obj.get("registrationCompletionDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration1p3_manual.py b/flat_api/aio/models/lti_configuration1p3_manual.py new file mode 100644 index 0000000..4ef9ebd --- /dev/null +++ b/flat_api/aio/models/lti_configuration1p3_manual.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.aio.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Manual(BaseModel): + """ + LtiConfiguration1p3Manual + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.3)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + mode: Optional[StrictStr] = Field(default=None, description="Manual LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3']): + raise ValueError("must be one of enum values ('1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-manual']): + raise ValueError("must be one of enum values ('1p3-manual')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Manual from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Manual from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_base.py b/flat_api/aio/models/lti_configuration_base.py new file mode 100644 index 0000000..876e041 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_base.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationBase(BaseModel): + """ + LtiConfigurationBase + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p1', '1p3']): + raise ValueError("must be one of enum values ('1p1', '1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if last_used_date (nullable) is None + # and model_fields_set contains the field + if self.last_used_date is None and "last_used_date" in self.model_fields_set: + _dict['lastUsedDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_create.py b/flat_api/aio/models/lti_configuration_create.py new file mode 100644 index 0000000..a9bb2c4 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_create.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.aio.models.lti_configuration_create1p1 import LtiConfigurationCreate1p1 +from flat_api.aio.models.lti_configuration_create1p3_deployment import LtiConfigurationCreate1p3Deployment +from flat_api.aio.models.lti_configuration_create1p3_dynamic import LtiConfigurationCreate1p3Dynamic +from flat_api.aio.models.lti_configuration_create1p3_manual import LtiConfigurationCreate1p3Manual +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LTICONFIGURATIONCREATE_ONE_OF_SCHEMAS = ["LtiConfigurationCreate1p1", "LtiConfigurationCreate1p3Deployment", "LtiConfigurationCreate1p3Dynamic", "LtiConfigurationCreate1p3Manual"] + +class LtiConfigurationCreate(BaseModel): + """ + Request to create a new LTI configuration (unified 1.1 and 1.3) + """ + # data type: LtiConfigurationCreate1p1 + oneof_schema_1_validator: Optional[LtiConfigurationCreate1p1] = None + # data type: LtiConfigurationCreate1p3Dynamic + oneof_schema_2_validator: Optional[LtiConfigurationCreate1p3Dynamic] = None + # data type: LtiConfigurationCreate1p3Deployment + oneof_schema_3_validator: Optional[LtiConfigurationCreate1p3Deployment] = None + # data type: LtiConfigurationCreate1p3Manual + oneof_schema_4_validator: Optional[LtiConfigurationCreate1p3Manual] = None + actual_instance: Optional[Union[LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual]] = None + one_of_schemas: Set[str] = { "LtiConfigurationCreate1p1", "LtiConfigurationCreate1p3Deployment", "LtiConfigurationCreate1p3Dynamic", "LtiConfigurationCreate1p3Manual" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LtiConfigurationCreate.model_construct() + error_messages = [] + match = 0 + # validate data type: LtiConfigurationCreate1p1 + if not isinstance(v, LtiConfigurationCreate1p1): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p1`") + else: + match += 1 + # validate data type: LtiConfigurationCreate1p3Dynamic + if not isinstance(v, LtiConfigurationCreate1p3Dynamic): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p3Dynamic`") + else: + match += 1 + # validate data type: LtiConfigurationCreate1p3Deployment + if not isinstance(v, LtiConfigurationCreate1p3Deployment): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p3Deployment`") + else: + match += 1 + # validate data type: LtiConfigurationCreate1p3Manual + if not isinstance(v, LtiConfigurationCreate1p3Manual): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p3Manual`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LtiConfigurationCreate1p1 + try: + instance.actual_instance = LtiConfigurationCreate1p1.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfigurationCreate1p3Dynamic + try: + instance.actual_instance = LtiConfigurationCreate1p3Dynamic.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfigurationCreate1p3Deployment + try: + instance.actual_instance = LtiConfigurationCreate1p3Deployment.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfigurationCreate1p3Manual + try: + instance.actual_instance = LtiConfigurationCreate1p3Manual.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 LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/aio/models/lti_configuration_create1p1.py b/flat_api/aio/models/lti_configuration_create1p1.py new file mode 100644 index 0000000..32e8ea9 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_create1p1.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p1(BaseModel): + """ + LTI 1.1 manual configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.1 manual creation mode") + name: Optional[StrictStr] = Field(default=None, description="Display name for LTI 1.1 credentials") + lms: Optional[StrictStr] = Field(default=None, description="LMS identifier for LTI 1.1 credentials") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "name", "lms"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p1-manual']): + raise ValueError("must be one of enum values ('1p1-manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "name": obj.get("name"), + "lms": obj.get("lms") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_create1p3_deployment.py b/flat_api/aio/models/lti_configuration_create1p3_deployment.py new file mode 100644 index 0000000..8a261d9 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_create1p3_deployment.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3Deployment(BaseModel): + """ + LTI 1.3 deployment-based configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.3 deployment-based creation mode") + deployment_type: StrictStr = Field(description="Parent platform key (e.g., canvas, blackboard, schoology, classlink)", alias="deploymentType") + deployment_id: StrictStr = Field(description="Deployment identifier provided by the platform", alias="deploymentId") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id for the tenant; required for ClassLink deployments", alias="clientId") + deployment_breakdown_id: Optional[StrictStr] = Field(default=None, description="Value of the custom claim that identifies this specific tenant (for multi-tenant platforms like Schoology)", alias="deploymentBreakdownId") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "deploymentType", "deploymentId", "clientId", "deploymentBreakdownId"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3-deployment']): + raise ValueError("must be one of enum values ('1p3-deployment')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Deployment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Deployment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "deploymentType": obj.get("deploymentType"), + "deploymentId": obj.get("deploymentId"), + "clientId": obj.get("clientId"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_create1p3_dynamic.py b/flat_api/aio/models/lti_configuration_create1p3_dynamic.py new file mode 100644 index 0000000..42ace80 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_create1p3_dynamic.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lti_configuration_create1p3_dynamic_platform_info import LtiConfigurationCreate1p3DynamicPlatformInfo +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3Dynamic(BaseModel): + """ + LTI 1.3 dynamic registration configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.3 dynamic registration mode") + platform_info: Optional[LtiConfigurationCreate1p3DynamicPlatformInfo] = Field(default=None, alias="platformInfo") + locale: Optional[StrictStr] = Field(default=None, description="Optional locale code for registration URL. Input values will be automatically normalized to a supported locale code.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "platformInfo", "locale"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3-dynamic']): + raise ValueError("must be one of enum values ('1p3-dynamic')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Dynamic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of platform_info + if self.platform_info: + _dict['platformInfo'] = self.platform_info.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Dynamic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "platformInfo": LtiConfigurationCreate1p3DynamicPlatformInfo.from_dict(obj["platformInfo"]) if obj.get("platformInfo") is not None else None, + "locale": obj.get("locale") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_create1p3_dynamic_platform_info.py b/flat_api/aio/models/lti_configuration_create1p3_dynamic_platform_info.py new file mode 100644 index 0000000..546fa43 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_create1p3_dynamic_platform_info.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3DynamicPlatformInfo(BaseModel): + """ + Optional platform information for dynamic registration + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Platform display name") + url: Optional[StrictStr] = Field(default=None, description="Optional platform homepage or admin URL for reference") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3DynamicPlatformInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3DynamicPlatformInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_create1p3_manual.py b/flat_api/aio/models/lti_configuration_create1p3_manual.py new file mode 100644 index 0000000..c52d1a1 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_create1p3_manual.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3Manual(BaseModel): + """ + LTI 1.3 manual configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.3 manual creation mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment identifier provided by the platform", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="Platform access token endpoint URL", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="Platform OIDC authorization endpoint URL", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint URL for public keys", alias="jwksUrl") + enable_email_matching: Optional[StrictBool] = Field(default=None, description="Enable email-based user matching during LTI authentication", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "enableEmailMatching"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3-manual']): + raise ValueError("must be one of enum values ('1p3-manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Manual from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Manual from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "enableEmailMatching": obj.get("enableEmailMatching") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_update.py b/flat_api/aio/models/lti_configuration_update.py new file mode 100644 index 0000000..52ac125 --- /dev/null +++ b/flat_api/aio/models/lti_configuration_update.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from flat_api.aio.models.lti_configuration_update_deployment import LtiConfigurationUpdateDeployment +from flat_api.aio.models.lti_configuration_update_standalone import LtiConfigurationUpdateStandalone +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +LTICONFIGURATIONUPDATE_ANY_OF_SCHEMAS = ["LtiConfigurationUpdateDeployment", "LtiConfigurationUpdateStandalone"] + +class LtiConfigurationUpdate(BaseModel): + """ + Update an existing LTI 1.3 configuration (deployment clone or standalone) + """ + + # data type: LtiConfigurationUpdateDeployment + anyof_schema_1_validator: Optional[LtiConfigurationUpdateDeployment] = None + # data type: LtiConfigurationUpdateStandalone + anyof_schema_2_validator: Optional[LtiConfigurationUpdateStandalone] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "LtiConfigurationUpdateDeployment", "LtiConfigurationUpdateStandalone" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = LtiConfigurationUpdate.model_construct() + error_messages = [] + # validate data type: LtiConfigurationUpdateDeployment + if not isinstance(v, LtiConfigurationUpdateDeployment): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationUpdateDeployment`") + else: + return v + + # validate data type: LtiConfigurationUpdateStandalone + if not isinstance(v, LtiConfigurationUpdateStandalone): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationUpdateStandalone`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in LtiConfigurationUpdate with anyOf schemas: LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[LtiConfigurationUpdateDeployment] = None + try: + instance.actual_instance = LtiConfigurationUpdateDeployment.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[LtiConfigurationUpdateStandalone] = None + try: + instance.actual_instance = LtiConfigurationUpdateStandalone.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfigurationUpdate with anyOf schemas: LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/aio/models/lti_configuration_update_deployment.py b/flat_api/aio/models/lti_configuration_update_deployment.py new file mode 100644 index 0000000..910c8eb --- /dev/null +++ b/flat_api/aio/models/lti_configuration_update_deployment.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationUpdateDeployment(BaseModel): + """ + Update fields allowed for deployment-based configurations + """ # noqa: E501 + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment identifier provided by the platform", alias="deploymentId") + deployment_breakdown_id: Optional[StrictStr] = Field(default=None, description="Specific tenant identifier for multi-tenant platforms", alias="deploymentBreakdownId") + enable_email_matching: Optional[StrictBool] = Field(default=None, description="Enable email-based user matching during LTI authentication", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["deploymentId", "deploymentBreakdownId", "enableEmailMatching"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateDeployment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateDeployment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "deploymentId": obj.get("deploymentId"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId"), + "enableEmailMatching": obj.get("enableEmailMatching") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_configuration_update_standalone.py b/flat_api/aio/models/lti_configuration_update_standalone.py new file mode 100644 index 0000000..b21686a --- /dev/null +++ b/flat_api/aio/models/lti_configuration_update_standalone.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationUpdateStandalone(BaseModel): + """ + Update fields allowed for standalone (manual/dynamic) configurations + """ # noqa: E501 + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment identifier provided by the platform", alias="deploymentId") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + access_token_url: Optional[StrictStr] = Field(default=None, description="Platform access token endpoint URL", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="Platform OIDC authorization endpoint URL", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint URL for public keys", alias="jwksUrl") + enable_email_matching: Optional[StrictBool] = Field(default=None, description="Enable email-based user matching during LTI authentication", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["deploymentId", "platformIss", "platformName", "clientId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "enableEmailMatching"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateStandalone from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateStandalone from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "deploymentId": obj.get("deploymentId"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "enableEmailMatching": obj.get("enableEmailMatching") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_credentials.py b/flat_api/aio/models/lti_credentials.py new file mode 100644 index 0000000..a52582a --- /dev/null +++ b/flat_api/aio/models/lti_credentials.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.lms_name import LmsName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiCredentials(BaseModel): + """ + A couple of LTI 1.x OAuth credentials + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of this couple of credentials") + name: Optional[StrictStr] = Field(default=None, description="Name of the couple of credentials") + lms: Optional[LmsName] = None + organization: Optional[StrictStr] = Field(default=None, description="The unique identifier of the Organization associated to these credentials") + creator: Optional[StrictStr] = Field(default=None, description="Unique identifier of the user who created these credentials") + creation_date: Optional[datetime] = Field(default=None, description="The creation date of thse credentials", alias="creationDate") + last_usage: Optional[datetime] = Field(default=None, description="The last time these credentials were used", alias="lastUsage") + consumer_key: Optional[StrictStr] = Field(default=None, description="OAuth 1 Consumer Key", alias="consumerKey") + consumer_secret: Optional[StrictStr] = Field(default=None, description="OAuth 1 Consumer Secret", alias="consumerSecret") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "lms", "organization", "creator", "creationDate", "lastUsage", "consumerKey", "consumerSecret", "enableEmailMatching"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiCredentials from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiCredentials from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "lms": obj.get("lms"), + "organization": obj.get("organization"), + "creator": obj.get("creator"), + "creationDate": obj.get("creationDate"), + "lastUsage": obj.get("lastUsage"), + "consumerKey": obj.get("consumerKey"), + "consumerSecret": obj.get("consumerSecret"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/lti_credentials_creation.py b/flat_api/aio/models/lti_credentials_creation.py new file mode 100644 index 0000000..a2d40b5 --- /dev/null +++ b/flat_api/aio/models/lti_credentials_creation.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from flat_api.aio.models.lms_name import LmsName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiCredentialsCreation(BaseModel): + """ + Creation of a couple of LTI 1.x OAuth credentials + """ # noqa: E501 + name: Annotated[str, Field(strict=True, max_length=300)] = Field(description="Name of the couple of credentials") + lms: LmsName + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "lms"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiCredentialsCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiCredentialsCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "lms": obj.get("lms") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/media_attachment.py b/flat_api/aio/models/media_attachment.py new file mode 100644 index 0000000..bd46eee --- /dev/null +++ b/flat_api/aio/models/media_attachment.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.media_score_sharing_mode import MediaScoreSharingMode +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MediaAttachment(BaseModel): + """ + Media attachment. The API will automatically resolve the details, oEmbed, and media available if possible and return them in this object + """ # noqa: E501 + type: StrictStr = Field(description="The type of the assignment resolved: * `rich`, `photo`, `video` are automatically resolved as `link` * A `flat` attachment is a score document where the unique identifier will be specified in the `score` property. Its sharing mode will be provided in the `sharingMode` property. ") + score: Optional[StrictStr] = Field(default=None, description="An unique Flat score identifier") + revision: Optional[StrictStr] = Field(default=None, description="An unique revision identifier of a score") + worksheet: Optional[StrictStr] = Field(default=None, description="An unique worksheet identifier") + dedicated: Optional[StrictBool] = Field(default=None, description="True if the resource is dedicated for the assignment (for scores and worksheets), meaning on the user-side this one is stored in the assignment") + track: Optional[StrictStr] = Field(default=None, description="A unique track identifier") + part_uuid: Optional[StrictStr] = Field(default=None, description="The UUID of the instrument part selected for this attachment (for performance submissions)", alias="partUuid") + sharing_mode: Optional[MediaScoreSharingMode] = Field(default=MediaScoreSharingMode.READ, alias="sharingMode") + lock_score_template: Optional[StrictBool] = Field(default=None, description="To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template.", alias="lockScoreTemplate") + title: Optional[StrictStr] = Field(default=None, description="The resolved title of the attachment") + description: Optional[StrictStr] = Field(default=None, description="The resolved description of the attachment") + html: Optional[StrictStr] = Field(default=None, description="If the attachment type is `rich` or `video`, the HTML code of the media to display ") + html_width: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If the `html` is available, the width of the widget", alias="htmlWidth") + html_height: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If the `html` is available, the height of the widget", alias="htmlHeight") + url: Optional[StrictStr] = Field(default=None, description="The url of the attachment") + thumbnail_url: Optional[StrictStr] = Field(default=None, description="If the attachment type is `rich`, `video`, `photo` or `link`, a displayable thumbnail for this attachment ", alias="thumbnailUrl") + thumbnail_width: Optional[StrictInt] = Field(default=None, description="If the `thumbnailUrl` is available, the width of the thumbnail ", alias="thumbnailWidth") + thumbnail_height: Optional[StrictInt] = Field(default=None, description="If the `thumbnailUrl` is available, the width of the thumbnail ", alias="thumbnailHeight") + author_name: Optional[StrictStr] = Field(default=None, description="The resolved author name of the attachment", alias="authorName") + author_url: Optional[StrictStr] = Field(default=None, description="The resolved author url of the attachment", alias="authorUrl") + icon_url: Optional[StrictStr] = Field(default=None, description="The URL of the icon", alias="iconUrl") + mime_type: Optional[StrictStr] = Field(default=None, description="The mine type of the file", alias="mimeType") + google_drive_file_id: Optional[StrictStr] = Field(default=None, description="The ID of the Google Drive File", alias="googleDriveFileId") + teacher_only: Optional[StrictBool] = Field(default=False, description="If true, this attachment is only visible to teachers. When students view the assignment, attachments with this flag will be filtered out. ", alias="teacherOnly") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "score", "revision", "worksheet", "dedicated", "track", "partUuid", "sharingMode", "lockScoreTemplate", "title", "description", "html", "htmlWidth", "htmlHeight", "url", "thumbnailUrl", "thumbnailWidth", "thumbnailHeight", "authorName", "authorUrl", "iconUrl", "mimeType", "googleDriveFileId", "teacherOnly"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet']): + raise ValueError("must be one of enum values ('rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MediaAttachment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MediaAttachment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "score": obj.get("score"), + "revision": obj.get("revision"), + "worksheet": obj.get("worksheet"), + "dedicated": obj.get("dedicated"), + "track": obj.get("track"), + "partUuid": obj.get("partUuid"), + "sharingMode": obj.get("sharingMode") if obj.get("sharingMode") is not None else MediaScoreSharingMode.READ, + "lockScoreTemplate": obj.get("lockScoreTemplate"), + "title": obj.get("title"), + "description": obj.get("description"), + "html": obj.get("html"), + "htmlWidth": obj.get("htmlWidth"), + "htmlHeight": obj.get("htmlHeight"), + "url": obj.get("url"), + "thumbnailUrl": obj.get("thumbnailUrl"), + "thumbnailWidth": obj.get("thumbnailWidth"), + "thumbnailHeight": obj.get("thumbnailHeight"), + "authorName": obj.get("authorName"), + "authorUrl": obj.get("authorUrl"), + "iconUrl": obj.get("iconUrl"), + "mimeType": obj.get("mimeType"), + "googleDriveFileId": obj.get("googleDriveFileId"), + "teacherOnly": obj.get("teacherOnly") if obj.get("teacherOnly") is not None else False + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/media_score_sharing_mode.py b/flat_api/aio/models/media_score_sharing_mode.py new file mode 100644 index 0000000..90e7e14 --- /dev/null +++ b/flat_api/aio/models/media_score_sharing_mode.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class MediaScoreSharingMode(str, Enum): + """ + The sharing mode of the score for classes post and assignments + """ + + """ + allowed enum values + """ + READ = 'read' + WRITE = 'write' + COPY = 'copy' + PERFORMANCE = 'performance' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of MediaScoreSharingMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/microsoft_graph_assignment.py b/flat_api/aio/models/microsoft_graph_assignment.py new file mode 100644 index 0000000..299edef --- /dev/null +++ b/flat_api/aio/models/microsoft_graph_assignment.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MicrosoftGraphAssignment(BaseModel): + """ + A Microsoft Teams assignment + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Identifier of the assignment assigned by Microsoft Teams") + state: Optional[StrictStr] = Field(default=None, description="State of the assignment on Microsoft Teams. * `draft`: Assignment is in draft mode * `scheduled`: Assignment is scheduled to be published at a future date * `published`: Assignment has been published to students * `assigned`: Assignment has been assigned (legacy status) * `inactive`: Assignment is inactive ") + alternate_link: Optional[StrictStr] = Field(default=None, description="Absolute link to this assignment in the Microsoft Teams web UI", alias="alternateLink") + assign_date_time: Optional[datetime] = Field(default=None, description="The date when the assignment will become active on Microsoft Teams. If set to a future date, the assignment will have status `scheduled` and won't be visible to students until this date. ", alias="assignDateTime") + categories: Optional[List[StrictStr]] = Field(default=None, description="List of categories where this assignment is published under") + assign_to_type: Optional[StrictStr] = Field(default=None, description="Recipient configuration for this assignment on Microsoft Teams. * `class`: Assignment is visible to all students in the class * `individual`: Assignment is visible only to specific assigned students ", alias="assignToType") + assigned_students_ms_ids: Optional[List[StrictStr]] = Field(default=None, description="When assignToType is 'individual', array of Microsoft Azure user IDs of students assigned to this assignment. These are the students who can see and submit to this assignment on Teams. ", alias="assignedStudentsMsIds") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state", "alternateLink", "assignDateTime", "categories", "assignToType", "assignedStudentsMsIds"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['draft', 'scheduled', 'published', 'assigned', 'inactive']): + raise ValueError("must be one of enum values ('draft', 'scheduled', 'published', 'assigned', 'inactive')") + return value + + @field_validator('assign_to_type') + def assign_to_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['class', 'individual']): + raise ValueError("must be one of enum values ('class', 'individual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MicrosoftGraphAssignment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MicrosoftGraphAssignment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state"), + "alternateLink": obj.get("alternateLink"), + "assignDateTime": obj.get("assignDateTime"), + "categories": obj.get("categories"), + "assignToType": obj.get("assignToType"), + "assignedStudentsMsIds": obj.get("assignedStudentsMsIds") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/microsoft_graph_submission.py b/flat_api/aio/models/microsoft_graph_submission.py new file mode 100644 index 0000000..8014efe --- /dev/null +++ b/flat_api/aio/models/microsoft_graph_submission.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class MicrosoftGraphSubmission(BaseModel): + """ + A Microsoft Teams submission + """ # noqa: E501 + id: StrictStr = Field(description="Identifier of the submission assigned by Microsoft Teams") + state: StrictStr = Field(description="State of the submission") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of MicrosoftGraphSubmission from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of MicrosoftGraphSubmission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "state": obj.get("state") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_capabilities.py b/flat_api/aio/models/omr_capabilities.py new file mode 100644 index 0000000..2868202 --- /dev/null +++ b/flat_api/aio/models/omr_capabilities.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.omr_job_output import OmrJobOutput +from flat_api.aio.models.omr_locale_details import OmrLocaleDetails +from flat_api.aio.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrCapabilities(BaseModel): + """ + What the account or app can do, for client feature-detection. + """ # noqa: E501 + steps: List[OmrStepName] = Field(description="Interactive steps this server supports.") + formats: List[StrictStr] = Field(description="Export formats available via `getOmrJobExport`.") + outputs: List[OmrJobOutput] = Field(description="Output destinations the account can use when creating a job.") + max_files: StrictInt = Field(description="Maximum number of input files that can be added to a single job.", alias="maxFiles") + max_pages: StrictInt = Field(description="Maximum number of pages allowed across all input files of a single job.", alias="maxPages") + max_parallel_jobs: StrictInt = Field(description="Maximum number of OMR jobs that can run in parallel for this account.", alias="maxParallelJobs") + max_file_size: StrictInt = Field(description="Maximum size of a single file, in bytes.", alias="maxFileSize") + accepted_mime_types: List[StrictStr] = Field(description="MIME types accepted for input files: PDF, plus the raster image formats. Drive the file picker from this list rather than hardcoding it, so newly supported formats need no client release. A file is identified by its content, so its declared type and its extension do not have to match. A multi-page input counts as several pages against `maxPages` and is charged accordingly. That covers PDFs and, among the image formats, multi-page TIFF and animated GIF/WebP. ", alias="acceptedMimeTypes") + accepted_extensions: List[StrictStr] = Field(description="Filename extensions the accepted types appear under, for building a file picker. Use these alongside `acceptedMimeTypes` in an `accept` attribute: browsers and native file dialogs filter unreliably on some of the image types, so a valid file can be greyed out when only its MIME type is offered. Longer than `acceptedMimeTypes`, because one type arrives under several extensions (`.jpg` and `.jpeg`, `.tif` and `.tiff`, `.heic` and `.heif`). Picker metadata only. A file is identified by its content, so its extension never decides whether an upload is accepted. ", alias="acceptedExtensions") + cost_per_page: Optional[StrictInt] = Field(default=None, description="Credits charged per page.", alias="costPerPage") + remaining_credits: Optional[StrictInt] = Field(default=None, description="OMR credits remaining for the account.", alias="remainingCredits") + retention_days: Optional[StrictInt] = Field(default=None, description="How many days a `musicxml` job's uploaded files and results are kept before erasure. Reflects the account's own period when one has been set, otherwise the platform default. Read-only: contact support to change it. Jobs with `output: library` are not covered by the retention policy and are unaffected by this value. ", alias="retentionDays") + locales: List[StrictStr] = Field(description="Locales selectable for OCR, as BCP 47 codes sorted alphabetically. These are the locales the recognition pipeline can actually read, which is neither the list of Flat interface locales nor a fixed set: new languages are added over time. Clients should default to the user's own locale when it appears here. ") + locales_details: List[OmrLocaleDetails] = Field(description="The same locales as `locales`, each with its English display name, sorted alphabetically by `name` and ready to bind to a language picker. Prefer this over `locales` when rendering a selector: it saves clients from shipping their own code-to-label table. ", alias="localesDetails") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["steps", "formats", "outputs", "maxFiles", "maxPages", "maxParallelJobs", "maxFileSize", "acceptedMimeTypes", "acceptedExtensions", "costPerPage", "remainingCredits", "retentionDays", "locales", "localesDetails"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in locales_details (list) + _items = [] + if self.locales_details: + for _item_locales_details in self.locales_details: + if _item_locales_details: + _items.append(_item_locales_details.to_dict()) + _dict['localesDetails'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "steps": obj.get("steps"), + "formats": obj.get("formats"), + "outputs": obj.get("outputs"), + "maxFiles": obj.get("maxFiles"), + "maxPages": obj.get("maxPages"), + "maxParallelJobs": obj.get("maxParallelJobs"), + "maxFileSize": obj.get("maxFileSize"), + "acceptedMimeTypes": obj.get("acceptedMimeTypes"), + "acceptedExtensions": obj.get("acceptedExtensions"), + "costPerPage": obj.get("costPerPage"), + "remainingCredits": obj.get("remainingCredits"), + "retentionDays": obj.get("retentionDays"), + "locales": obj.get("locales"), + "localesDetails": [OmrLocaleDetails.from_dict(_item) for _item in obj["localesDetails"]] if obj.get("localesDetails") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_details_step_data.py b/flat_api/aio/models/omr_details_step_data.py new file mode 100644 index 0000000..f268321 --- /dev/null +++ b/flat_api/aio/models/omr_details_step_data.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.omr_detected_instrument import OmrDetectedInstrument +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrDetailsStepData(BaseModel): + """ + Detected score details for review (the \"Check your score details\" screen). The worker produces `title` and `instruments` from assembly; the language is not detected and is not part of this payload (the client reads the job's `locales`, set at creation). + """ # noqa: E501 + step: StrictStr = Field(description="Discriminator for `OmrPendingStep.data`; always `details` for this payload.") + title: Optional[StrictStr] = Field(default=None, description="OCR-detected work title.") + instruments: List[OmrDetectedInstrument] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["step", "title", "instruments"] + + @field_validator('step') + def step_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['details']): + raise ValueError("must be one of enum values ('details')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrDetailsStepData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instruments (list) + _items = [] + if self.instruments: + for _item_instruments in self.instruments: + if _item_instruments: + _items.append(_item_instruments.to_dict()) + _dict['instruments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrDetailsStepData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "step": obj.get("step"), + "title": obj.get("title"), + "instruments": [OmrDetectedInstrument.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_details_submission.py b/flat_api/aio/models/omr_details_submission.py new file mode 100644 index 0000000..6077574 --- /dev/null +++ b/flat_api/aio/models/omr_details_submission.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.omr_instrument_override import OmrInstrumentOverride +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrDetailsSubmission(BaseModel): + """ + Overrides for the `details` step. Omitted fields keep the server's detected values. + """ # noqa: E501 + step: StrictStr = Field(description="Discriminator for `OmrStepSubmission`; always `details` for this submission.") + title: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="Override the detected work title.") + main_language: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=35)]] = Field(default=None, description="Override the main language (BCP 47) used for lyric and text reading on resume. Defaults to the job locale (`locales`); set this to correct it on the review screen. ", alias="mainLanguage") + instruments: Optional[Annotated[List[OmrInstrumentOverride], Field(max_length=200)]] = Field(default=None, description="Per-part overrides, each matched to a detected part by `index`.") + __properties: ClassVar[List[str]] = ["step", "title", "mainLanguage", "instruments"] + + @field_validator('step') + def step_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['details']): + raise ValueError("must be one of enum values ('details')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrDetailsSubmission from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instruments (list) + _items = [] + if self.instruments: + for _item_instruments in self.instruments: + if _item_instruments: + _items.append(_item_instruments.to_dict()) + _dict['instruments'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrDetailsSubmission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "step": obj.get("step"), + "title": obj.get("title"), + "mainLanguage": obj.get("mainLanguage"), + "instruments": [OmrInstrumentOverride.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None + }) + return _obj + + diff --git a/flat_api/aio/models/omr_detected_instrument.py b/flat_api/aio/models/omr_detected_instrument.py new file mode 100644 index 0000000..e6e19e5 --- /dev/null +++ b/flat_api/aio/models/omr_detected_instrument.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrDetectedInstrument(BaseModel): + """ + One detected part. + """ # noqa: E501 + index: StrictInt = Field(description="0-based position of the part in the score.") + part_name: Optional[StrictStr] = Field(default=None, description="Verbatim part name read from the score.", alias="partName") + instrument_id: Optional[StrictStr] = Field(default=None, description="Flat instrument ID in dotted `.` form, for example `brass.horn` or `vocals.voice-oohs`. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments). Always the canonical (non-premium) ID.", alias="instrumentId") + instrument_name: Optional[StrictStr] = Field(default=None, description="Localized display name, resolved server-side so the client needs no instruments dictionary.", alias="instrumentName") + midi_program: Optional[StrictInt] = Field(default=None, description="General MIDI program number.", alias="midiProgram") + transpose_key: Optional[StrictStr] = Field(default=None, description="Transposition or written key shown in the UI, for example `F` for Horn in F.", alias="transposeKey") + resolved_confidence: Optional[StrictStr] = Field(default=None, description="Server confidence in the resolved instrument match.", alias="resolvedConfidence") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["index", "partName", "instrumentId", "instrumentName", "midiProgram", "transposeKey", "resolvedConfidence"] + + @field_validator('resolved_confidence') + def resolved_confidence_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['high', 'medium', 'low']): + raise ValueError("must be one of enum values ('high', 'medium', 'low')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrDetectedInstrument from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrDetectedInstrument from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index": obj.get("index"), + "partName": obj.get("partName"), + "instrumentId": obj.get("instrumentId"), + "instrumentName": obj.get("instrumentName"), + "midiProgram": obj.get("midiProgram"), + "transposeKey": obj.get("transposeKey"), + "resolvedConfidence": obj.get("resolvedConfidence") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_imported_metadata.py b/flat_api/aio/models/omr_imported_metadata.py new file mode 100644 index 0000000..38a8ae4 --- /dev/null +++ b/flat_api/aio/models/omr_imported_metadata.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrImportedMetadata(BaseModel): + """ + Metadata extracted from the recognized score. + """ # noqa: E501 + instruments: Optional[List[StrictStr]] = Field(default=None, description="Instrument IDs of the assembled parts.") + number_measures: Optional[StrictInt] = Field(default=None, description="Number of measures in the recognized score.", alias="numberMeasures") + main_tempo_qpm: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Main tempo, in quarter notes per minute.", alias="mainTempoQpm") + main_key_signature: Optional[StrictInt] = Field(default=None, description="Main key signature as a fifths count (negative for flats, positive for sharps, 0 for C major / A minor).", alias="mainKeySignature") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["instruments", "numberMeasures", "mainTempoQpm", "mainKeySignature"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrImportedMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrImportedMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instruments": obj.get("instruments"), + "numberMeasures": obj.get("numberMeasures"), + "mainTempoQpm": obj.get("mainTempoQpm"), + "mainKeySignature": obj.get("mainKeySignature") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_instrument_override.py b/flat_api/aio/models/omr_instrument_override.py new file mode 100644 index 0000000..984298c --- /dev/null +++ b/flat_api/aio/models/omr_instrument_override.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrInstrumentOverride(BaseModel): + """ + Override for a single detected part, matched by `index`. Omitted fields keep the detected value. To set the instrument you may use **either** `instrumentId` (Flat's instrument id) **or** `midiProgram` (a standard General MIDI program) — whichever your integration prefers; you do not need both. If both are sent, `instrumentId` wins; otherwise `midiProgram` is resolved to the matching instrument; otherwise the detected instrument is kept. `transposeKey` and `partName` apply independently on top. + """ # noqa: E501 + index: Annotated[int, Field(strict=True, ge=0)] = Field(description="0-based position of the part to override, matching the `index` of the detected part.") + instrument_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default=None, description="Override the resolved instrument with this Flat instrument id, for example `brass.horn`. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments) for valid values. Both the dotted `.` form (`brass.horn`) and the bare instrument key (`horn`) are accepted. Use this or `midiProgram`. Takes precedence over `midiProgram` when both are set. ", alias="instrumentId") + part_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="Override the part name.", alias="partName") + transpose_key: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Override the transposition / written key: a pitch class as a letter `A`-`G` with an optional accidental. For example `F` for Horn in F or `Bb` for a B flat clarinet. The accidental may be ASCII `b` (flat) or `#` (sharp), or the Unicode music glyphs `♭` (U+266D) and `♯` (U+266F). Unicode accidentals are normalized to their ASCII equivalent, so `B♭` is stored and returned as `Bb`. ", alias="transposeKey") + midi_program: Optional[Annotated[int, Field(le=127, strict=True, ge=0)]] = Field(default=None, description="Override the instrument with a standard General MIDI program number (0-127), resolved server-side to the matching Flat instrument. Use this when you do not want to map Flat instrument ids. Ignored if `instrumentId` is also set. ", alias="midiProgram") + __properties: ClassVar[List[str]] = ["index", "instrumentId", "partName", "transposeKey", "midiProgram"] + + @field_validator('transpose_key', mode="before") + def transpose_key_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if isinstance(value, str) and not re.match(r"^[A-G][b♭#♯]?$", value): + raise ValueError(r"must validate the regular expression /^[A-G][b♭#♯]?$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrInstrumentOverride from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrInstrumentOverride from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index": obj.get("index"), + "instrumentId": obj.get("instrumentId"), + "partName": obj.get("partName"), + "transposeKey": obj.get("transposeKey"), + "midiProgram": obj.get("midiProgram") + }) + return _obj + + diff --git a/flat_api/aio/models/omr_job.py b/flat_api/aio/models/omr_job.py new file mode 100644 index 0000000..433f716 --- /dev/null +++ b/flat_api/aio/models/omr_job.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.omr_imported_metadata import OmrImportedMetadata +from flat_api.aio.models.omr_job_file_metadata import OmrJobFileMetadata +from flat_api.aio.models.omr_job_output import OmrJobOutput +from flat_api.aio.models.omr_job_progress import OmrJobProgress +from flat_api.aio.models.omr_job_result import OmrJobResult +from flat_api.aio.models.omr_job_retention import OmrJobRetention +from flat_api.aio.models.omr_job_status import OmrJobStatus +from flat_api.aio.models.omr_pending_step import OmrPendingStep +from flat_api.aio.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJob(BaseModel): + """ + OmrJob + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the OMR job.") + status: OmrJobStatus + output: OmrJobOutput + interactive_steps: List[OmrStepName] = Field(description="Steps this job pauses at for client input, echoing the value set at creation.", alias="interactiveSteps") + locales: Optional[List[StrictStr]] = Field(default=None, description="Locale hints (BCP 47) the job was created with, used for OCR and as the default main language at the `details` step. ") + current_step: Optional[OmrStepName] = Field(default=None, description="The pending step when `status` is `awaitingInput`. Omitted otherwise.", alias="currentStep") + pending_step: Optional[OmrPendingStep] = Field(default=None, alias="pendingStep") + estimated_credits: Optional[StrictInt] = Field(default=None, description="Credits that will be or were charged at start (page-based), so a client can show a confirmation before charging.", alias="estimatedCredits") + progress: Optional[OmrJobProgress] = None + original_file_metadata: Optional[OmrJobFileMetadata] = Field(default=None, alias="originalFileMetadata") + imported_metadata: Optional[OmrImportedMetadata] = Field(default=None, alias="importedMetadata") + result: Optional[OmrJobResult] = None + retention: Optional[OmrJobRetention] = None + error_code: Optional[StrictStr] = Field(default=None, description="Stable, engine-agnostic failure code, present when `status` is `error`. Branch on this for custom handling, and render `errorMessage` for the user-facing text. This is an open string: new codes may be added over time, so keep a generic fallback and never hardcode an exhaustive switch. Current values: * `NO_MUSIC_DETECTED`: no musical content found (poor scan, rotated page, or tablature). * `CORRUPTED_FILE`: the input file is corrupted and could not be read. * `UNSUPPORTED_FORMAT`: the file format or notation is not supported yet. * `UNSUPPORTED_TABLATURE`: the file is guitar tablature, not supported yet. * `ENCRYPTED_PDF`: the PDF is password-protected. * `TOO_LARGE`: the document is too large or has an unusual shape to process. * `ENGINE_TIMEOUT`: recognition took longer than expected and was stopped. * `GENERIC`: unspecified failure. ", alias="errorCode") + error_message: Optional[StrictStr] = Field(default=None, description="Localized, user-facing error message, present when `status` is `error`. Rendered in the caller's locale and safe to display as-is. Pair with `errorCode` for branching. ", alias="errorMessage") + creation_date: Optional[datetime] = Field(default=None, description="When the job was created.", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="When the job was last updated.", alias="modificationDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "status", "output", "interactiveSteps", "locales", "currentStep", "pendingStep", "estimatedCredits", "progress", "originalFileMetadata", "importedMetadata", "result", "retention", "errorCode", "errorMessage", "creationDate", "modificationDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJob from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pending_step + if self.pending_step: + _dict['pendingStep'] = self.pending_step.to_dict() + # override the default output from pydantic by calling `to_dict()` of progress + if self.progress: + _dict['progress'] = self.progress.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_file_metadata + if self.original_file_metadata: + _dict['originalFileMetadata'] = self.original_file_metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of imported_metadata + if self.imported_metadata: + _dict['importedMetadata'] = self.imported_metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of result + if self.result: + _dict['result'] = self.result.to_dict() + # override the default output from pydantic by calling `to_dict()` of retention + if self.retention: + _dict['retention'] = self.retention.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJob from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "status": obj.get("status"), + "output": obj.get("output") if obj.get("output") is not None else OmrJobOutput.LIBRARY, + "interactiveSteps": obj.get("interactiveSteps"), + "locales": obj.get("locales"), + "currentStep": obj.get("currentStep"), + "pendingStep": OmrPendingStep.from_dict(obj["pendingStep"]) if obj.get("pendingStep") is not None else None, + "estimatedCredits": obj.get("estimatedCredits"), + "progress": OmrJobProgress.from_dict(obj["progress"]) if obj.get("progress") is not None else None, + "originalFileMetadata": OmrJobFileMetadata.from_dict(obj["originalFileMetadata"]) if obj.get("originalFileMetadata") is not None else None, + "importedMetadata": OmrImportedMetadata.from_dict(obj["importedMetadata"]) if obj.get("importedMetadata") is not None else None, + "result": OmrJobResult.from_dict(obj["result"]) if obj.get("result") is not None else None, + "retention": OmrJobRetention.from_dict(obj["retention"]) if obj.get("retention") is not None else None, + "errorCode": obj.get("errorCode"), + "errorMessage": obj.get("errorMessage"), + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_creation.py b/flat_api/aio/models/omr_job_creation.py new file mode 100644 index 0000000..5c4b6dd --- /dev/null +++ b/flat_api/aio/models/omr_job_creation.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.omr_job_input_file import OmrJobInputFile +from flat_api.aio.models.omr_job_output import OmrJobOutput +from flat_api.aio.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobCreation(BaseModel): + """ + Parameters to create an OMR job. Send without `files` to create a draft (then add files with `addOmrJobFile` and run `startOmrJob`), or include `files` and `autoStart: true` to import in a single request. + """ # noqa: E501 + output: Optional[OmrJobOutput] = OmrJobOutput.LIBRARY + interactive_steps: Optional[List[OmrStepName]] = Field(default=None, description="Steps at which the pipeline should pause for this client. Omit or send `[]` for a fully automatic import. The server only pauses at the steps listed here; declare only steps your client can actually render. ", alias="interactiveSteps") + locales: Optional[List[StrictStr]] = Field(default=None, description="Locale hints (BCP 47) to improve text and lyric detection, for example `[\"ja\", \"en\"]`. The first entry drives the OCR reader. This is the input hint; the detected main language is confirmed later at the `details` step. ") + collection: Optional[StrictStr] = Field(default=None, description="Target collection ID. Only used when `output` is `library`.") + idempotency_key: Optional[StrictStr] = Field(default=None, description="Optional client-supplied key. A retry with the same key returns the existing job instead of creating a duplicate, for safe retries on flaky networks. ", alias="idempotencyKey") + files: Optional[List[OmrJobInputFile]] = Field(default=None, description="Optional inline inputs for a one-shot import. For multi-image or mobile capture, omit this and use `addOmrJobFile`.") + auto_start: Optional[StrictBool] = Field(default=None, description="Start processing immediately. Only valid when `files` is provided.", alias="autoStart") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["output", "interactiveSteps", "locales", "collection", "idempotencyKey", "files", "autoStart"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in files (list) + _items = [] + if self.files: + for _item_files in self.files: + if _item_files: + _items.append(_item_files.to_dict()) + _dict['files'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "output": obj.get("output") if obj.get("output") is not None else OmrJobOutput.LIBRARY, + "interactiveSteps": obj.get("interactiveSteps"), + "locales": obj.get("locales"), + "collection": obj.get("collection"), + "idempotencyKey": obj.get("idempotencyKey"), + "files": [OmrJobInputFile.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None, + "autoStart": obj.get("autoStart") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_file_metadata.py b/flat_api/aio/models/omr_job_file_metadata.py new file mode 100644 index 0000000..5401ef8 --- /dev/null +++ b/flat_api/aio/models/omr_job_file_metadata.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobFileMetadata(BaseModel): + """ + Metadata about the uploaded input. + """ # noqa: E501 + number_of_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages across all input files.", alias="numberOfPages") + file_count: Optional[StrictInt] = Field(default=None, description="Number of input files attached.", alias="fileCount") + filename: Optional[StrictStr] = Field(default=None, description="Original filename of the input as uploaded (of the first file when several were combined).") + file_size: Optional[StrictInt] = Field(default=None, description="Combined size of the input files, in bytes.", alias="fileSize") + mime_type: Optional[StrictStr] = Field(default=None, description="MIME type of the input (of the first file when several were combined).", alias="mimeType") + file_extension: Optional[StrictStr] = Field(default=None, description="File extension of the input, without the leading dot (for example `pdf`).", alias="fileExtension") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["numberOfPages", "fileCount", "filename", "fileSize", "mimeType", "fileExtension"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobFileMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobFileMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "numberOfPages": obj.get("numberOfPages"), + "fileCount": obj.get("fileCount"), + "filename": obj.get("filename"), + "fileSize": obj.get("fileSize"), + "mimeType": obj.get("mimeType"), + "fileExtension": obj.get("fileExtension") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_file_upload.py b/flat_api/aio/models/omr_job_file_upload.py new file mode 100644 index 0000000..cc126d1 --- /dev/null +++ b/flat_api/aio/models/omr_job_file_upload.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobFileUpload(BaseModel): + """ + One image or PDF added to a draft job. + """ # noqa: E501 + file: Union[StrictBytes, StrictStr] = Field(description="File data, base64-encoded. The type is read from the content itself, so no declared MIME type or filename extension is needed. Accepted types are listed by `getOmrCapabilities` in `acceptedMimeTypes`. ") + filename: Optional[StrictStr] = Field(default=None, description="Optional original filename, kept for display.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["file", "filename"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobFileUpload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobFileUpload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file": obj.get("file"), + "filename": obj.get("filename") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_file_upload_result.py b/flat_api/aio/models/omr_job_file_upload_result.py new file mode 100644 index 0000000..a134b66 --- /dev/null +++ b/flat_api/aio/models/omr_job_file_upload_result.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobFileUploadResult(BaseModel): + """ + Result of adding a file to a draft job. + """ # noqa: E501 + file_index: Optional[StrictInt] = Field(default=None, description="0-based index assigned to the uploaded file.", alias="fileIndex") + file_count: Optional[StrictInt] = Field(default=None, description="Total number of files now attached to the job.", alias="fileCount") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["fileIndex", "fileCount"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobFileUploadResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobFileUploadResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fileIndex": obj.get("fileIndex"), + "fileCount": obj.get("fileCount") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_input_file.py b/flat_api/aio/models/omr_job_input_file.py new file mode 100644 index 0000000..9436102 --- /dev/null +++ b/flat_api/aio/models/omr_job_input_file.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobInputFile(BaseModel): + """ + A single image or PDF input, base64-encoded. + """ # noqa: E501 + file: Union[StrictBytes, StrictStr] = Field(description="File data, base64-encoded. The type is read from the content itself, so no declared MIME type or filename extension is needed. Accepted types are listed by `getOmrCapabilities` in `acceptedMimeTypes`. ") + filename: Optional[StrictStr] = Field(default=None, description="Optional original filename, kept for display.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["file", "filename"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobInputFile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobInputFile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file": obj.get("file"), + "filename": obj.get("filename") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_output.py b/flat_api/aio/models/omr_job_output.py new file mode 100644 index 0000000..0c56c06 --- /dev/null +++ b/flat_api/aio/models/omr_job_output.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OmrJobOutput(str, Enum): + """ + Where the result of the job goes. * `library`: import the result into the Flat Library and create a score (default). * `musicxml`: finalize the result only, downloadable via `getOmrJobExport`. No score is created, for third-party integrations that do not use the Library. + """ + + """ + allowed enum values + """ + LIBRARY = 'library' + MUSICXML = 'musicxml' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OmrJobOutput from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/omr_job_progress.py b/flat_api/aio/models/omr_job_progress.py new file mode 100644 index 0000000..7fb0288 --- /dev/null +++ b/flat_api/aio/models/omr_job_progress.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobProgress(BaseModel): + """ + Live progress while the job is processing. + """ # noqa: E501 + percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Completion percentage (0-100).") + text: Optional[StrictStr] = Field(default=None, description="Localized progress message, ready to display.") + key: Optional[StrictStr] = Field(default=None, description="Stable progress key (for example `OMR_QUEUED`, `OMR_PROCESSING_PAGE`, `OMR_CREATING_SCORE`), for matching the current phase in a stepper UI independent of locale. ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["percent", "text", "key"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobProgress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobProgress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "percent": obj.get("percent"), + "text": obj.get("text"), + "key": obj.get("key") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_result.py b/flat_api/aio/models/omr_job_result.py new file mode 100644 index 0000000..d93b0e5 --- /dev/null +++ b/flat_api/aio/models/omr_job_result.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobResult(BaseModel): + """ + The outcome of a finished job. Present when `status` is `done`. + """ # noqa: E501 + score: Optional[StrictStr] = Field(default=None, description="Created score ID, when `output` is `library`.") + exports: Optional[List[StrictStr]] = Field(default=None, description="Formats available via `getOmrJobExport`, for example `[\"musicxml\", \"mxl\", \"midi\"]`.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["score", "exports"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "score": obj.get("score"), + "exports": obj.get("exports") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_retention.py b/flat_api/aio/models/omr_job_retention.py new file mode 100644 index 0000000..edb00b5 --- /dev/null +++ b/flat_api/aio/models/omr_job_retention.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobRetention(BaseModel): + """ + Data-retention state of the job. Present only on jobs whose `output` is `musicxml`. Jobs imported into the Flat library are part of your library content, are not covered by this policy, and omit this object entirely. Erasure is performed by a periodic cleanup pass, so the files are removed shortly after `expiryDate` rather than exactly on it. Plan for the deadline, not the instant. + """ # noqa: E501 + expiry_date: datetime = Field(description="When this job's uploaded files and recognition results become eligible for erasure. Fixed when the job is created: changing the account's retention period does not move the deadline of jobs that already exist. ", alias="expiryDate") + expired_date: Optional[datetime] = Field(default=None, description="When the job's stored files were actually erased. Present only once that happened. An expired job keeps the `status` it finished with and stays listable, but its `result` is no longer served and downloads fail with `OMR_JOB_EXPIRED`. ", alias="expiredDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["expiryDate", "expiredDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobRetention from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobRetention from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expiryDate": obj.get("expiryDate"), + "expiredDate": obj.get("expiredDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_job_status.py b/flat_api/aio/models/omr_job_status.py new file mode 100644 index 0000000..9552bf2 --- /dev/null +++ b/flat_api/aio/models/omr_job_status.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OmrJobStatus(str, Enum): + """ + Public, client-facing status of the job, derived from the internal job and task state. * `draft`: created, files can still be added; not yet started or charged. * `processing`: the pipeline is running. * `awaitingInput`: paused on the `currentStep`, waiting for the client to submit it. * `done`: finished. See `result`. * `error`: failed. See `errorCode`. * `canceled`: canceled by the client. + """ + + """ + allowed enum values + """ + DRAFT = 'draft' + PROCESSING = 'processing' + AWAITINGINPUT = 'awaitingInput' + DONE = 'done' + ERROR = 'error' + CANCELED = 'canceled' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OmrJobStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/omr_locale_details.py b/flat_api/aio/models/omr_locale_details.py new file mode 100644 index 0000000..6541760 --- /dev/null +++ b/flat_api/aio/models/omr_locale_details.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrLocaleDetails(BaseModel): + """ + An OCR-selectable locale with its English name. + """ # noqa: E501 + code: StrictStr = Field(description="BCP 47 locale code. Always one of the codes listed in `locales`.", json_schema_extra={"examples": ["vi"]}) + name: StrictStr = Field(description="English name of the language, for display in a picker.", json_schema_extra={"examples": ["Vietnamese"]}) + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrLocaleDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrLocaleDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "name": obj.get("name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_pending_step.py b/flat_api/aio/models/omr_pending_step.py new file mode 100644 index 0000000..6e3f531 --- /dev/null +++ b/flat_api/aio/models/omr_pending_step.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from flat_api.aio.models.omr_details_step_data import OmrDetailsStepData +from flat_api.aio.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrPendingStep(BaseModel): + """ + The step currently awaiting client input. The `data` shape is keyed by `step`. + """ # noqa: E501 + step: OmrStepName + data: OmrDetailsStepData + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["step", "data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrPendingStep from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrPendingStep from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "step": obj.get("step"), + "data": OmrDetailsStepData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/omr_step_name.py b/flat_api/aio/models/omr_step_name.py new file mode 100644 index 0000000..cdc12c5 --- /dev/null +++ b/flat_api/aio/models/omr_step_name.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OmrStepName(str, Enum): + """ + Interactive pipeline step. Forward-compatible: new values may be added over time. Only steps a client lists in `interactiveSteps` can pause that client's job; any step a client does not list (including future ones) is auto-resolved by the server. * `details`: confirm or adjust the detected title, main language and instruments before assembly. Pauses after note recognition, so resuming re-runs only the cheap assembly and finalize stages. + """ + + """ + allowed enum values + """ + DETAILS = 'details' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OmrStepName from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/organization_invitation.py b/flat_api/aio/models/organization_invitation.py new file mode 100644 index 0000000..a24affd --- /dev/null +++ b/flat_api/aio/models/organization_invitation.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.organization_roles import OrganizationRoles +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OrganizationInvitation(BaseModel): + """ + Details of an invitation to join an organization + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="The invitation unique identifier") + creation_date: Optional[datetime] = Field(default=None, description="The creation date of the invitation", alias="creationDate") + organization: StrictStr = Field(description="The unique identifier of the Organization owning this class") + organization_role: OrganizationRoles = Field(alias="organizationRole") + custom_code: Optional[StrictStr] = Field(description="Enrollment code to use when joining this organization", alias="customCode") + email: Optional[StrictStr] = Field(default=None, description="The email address this invitation was sent to") + invited_by: Optional[StrictStr] = Field(default=None, description="The unique identifier of the User who created this invitation", alias="invitedBy") + html_url: Optional[StrictStr] = Field(default=None, description="URL to join the organization using this invitation", alias="htmlUrl") + allow_multiple_use: StrictBool = Field(description="If true, the invitation can be used multiple times. If false, the invitation can only be used once. ", alias="allowMultipleUse") + used_by: Optional[List[StrictStr]] = Field(default=None, description="List of users who used this invitation", alias="usedBy") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "creationDate", "organization", "organizationRole", "customCode", "email", "invitedBy", "htmlUrl", "allowMultipleUse", "usedBy"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrganizationInvitation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if custom_code (nullable) is None + # and model_fields_set contains the field + if self.custom_code is None and "custom_code" in self.model_fields_set: + _dict['customCode'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationInvitation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "creationDate": obj.get("creationDate"), + "organization": obj.get("organization"), + "organizationRole": obj.get("organizationRole"), + "customCode": obj.get("customCode"), + "email": obj.get("email"), + "invitedBy": obj.get("invitedBy"), + "htmlUrl": obj.get("htmlUrl"), + "allowMultipleUse": obj.get("allowMultipleUse"), + "usedBy": obj.get("usedBy") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/organization_invitation_creation.py b/flat_api/aio/models/organization_invitation_creation.py new file mode 100644 index 0000000..a86e925 --- /dev/null +++ b/flat_api/aio/models/organization_invitation_creation.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OrganizationInvitationCreation(BaseModel): + """ + The parameters to create an organization invitation + """ # noqa: E501 + email: Optional[StrictStr] = Field(default=None, description="The email address you want to send the invitation to") + organization_role: Optional[StrictStr] = Field(default='teacher', description="User's Organization Role", alias="organizationRole") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["email", "organizationRole"] + + @field_validator('organization_role') + def organization_role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['admin', 'teacher', 'accountAdmin']): + raise ValueError("must be one of enum values ('admin', 'teacher', 'accountAdmin')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrganizationInvitationCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationInvitationCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email": obj.get("email"), + "organizationRole": obj.get("organizationRole") if obj.get("organizationRole") is not None else 'teacher' + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/organization_roles.py b/flat_api/aio/models/organization_roles.py new file mode 100644 index 0000000..3b45067 --- /dev/null +++ b/flat_api/aio/models/organization_roles.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OrganizationRoles(str, Enum): + """ + User's Organization Role (for Edu users only) + """ + + """ + allowed enum values + """ + ADMIN = 'admin' + ACCOUNTADMIN = 'accountAdmin' + TEACHER = 'teacher' + USER = 'user' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OrganizationRoles from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/organization_user_access_token_creation.py b/flat_api/aio/models/organization_user_access_token_creation.py new file mode 100644 index 0000000..f31ba11 --- /dev/null +++ b/flat_api/aio/models/organization_user_access_token_creation.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from flat_api.aio.models.app_scopes import AppScopes +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OrganizationUserAccessTokenCreation(BaseModel): + """ + Creation of a delegated API access token for an organization user + """ # noqa: E501 + scopes: List[AppScopes] = Field(description="List of requested scopes for this credential") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["scopes"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OrganizationUserAccessTokenCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OrganizationUserAccessTokenCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scopes": obj.get("scopes") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/rename_group_request.py b/flat_api/aio/models/rename_group_request.py new file mode 100644 index 0000000..5b397fc --- /dev/null +++ b/flat_api/aio/models/rename_group_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RenameGroupRequest(BaseModel): + """ + RenameGroupRequest + """ # noqa: E501 + name: StrictStr = Field(description="New name for the group") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RenameGroupRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RenameGroupRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/resource_collaborator.py b/flat_api/aio/models/resource_collaborator.py new file mode 100644 index 0000000..8a1325f --- /dev/null +++ b/flat_api/aio/models/resource_collaborator.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.group import Group +from flat_api.aio.models.user_public import UserPublic +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ResourceCollaborator(BaseModel): + """ + A collaborator of a score. The `userEmail` and `group` are only available if the requesting user is a collaborator of the related score (in this case these permissions will eventualy not be listed and exposed publicly). + """ # noqa: E501 + acl_read: StrictBool = Field(description="`True` if the current user can read the current document ", alias="aclRead") + acl_write: StrictBool = Field(description="`True` if the current user can modify the current document. If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclWrite") + acl_admin: StrictBool = Field(description="`True` if the current user can manage the current document (i.e. share, delete) If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclAdmin") + is_collaborator: Optional[StrictBool] = Field(default=False, description="`True` if the current user is a collaborator of the current document (direct or via group). ", alias="isCollaborator") + collaborator_type: Optional[StrictStr] = Field(default=None, description="The type of the collaborator for the resource ", alias="collaboratorType") + id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the permission") + var_date: Optional[datetime] = Field(default=None, description="The date when the permission was added", alias="date") + score: Optional[StrictStr] = Field(default=None, description="If this object is a permission of a score, this property will contain the unique identifier of the score") + collection: Optional[StrictStr] = Field(default=None, description="If this object is a permission of a collection, this property will contain the unique identifier of the collection") + user: Optional[UserPublic] = None + group: Optional[Group] = None + user_email: Optional[StrictStr] = Field(default=None, description="If the collaborator is not a user of Flat yet, this field will contain their email. ", alias="userEmail") + invited: Optional[StrictBool] = Field(default=None, description="If this property is `true`, this is still a pending invitation ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["aclRead", "aclWrite", "aclAdmin", "isCollaborator", "collaboratorType", "id", "date", "score", "collection", "user", "group", "userEmail", "invited"] + + @field_validator('collaborator_type') + def collaborator_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['owner', 'user', 'group']): + raise ValueError("must be one of enum values ('owner', 'user', 'group')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceCollaborator from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + # override the default output from pydantic by calling `to_dict()` of group + if self.group: + _dict['group'] = self.group.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceCollaborator from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aclRead": obj.get("aclRead") if obj.get("aclRead") is not None else False, + "aclWrite": obj.get("aclWrite") if obj.get("aclWrite") is not None else False, + "aclAdmin": obj.get("aclAdmin") if obj.get("aclAdmin") is not None else False, + "isCollaborator": obj.get("isCollaborator") if obj.get("isCollaborator") is not None else False, + "collaboratorType": obj.get("collaboratorType"), + "id": obj.get("id"), + "date": obj.get("date"), + "score": obj.get("score"), + "collection": obj.get("collection"), + "user": UserPublic.from_dict(obj["user"]) if obj.get("user") is not None else None, + "group": Group.from_dict(obj["group"]) if obj.get("group") is not None else None, + "userEmail": obj.get("userEmail"), + "invited": obj.get("invited") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/resource_collaborator_creation.py b/flat_api/aio/models/resource_collaborator_creation.py new file mode 100644 index 0000000..ab56cf7 --- /dev/null +++ b/flat_api/aio/models/resource_collaborator_creation.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ResourceCollaboratorCreation(BaseModel): + """ + Add a collaborator to a resource. + """ # noqa: E501 + user: Optional[StrictStr] = Field(default=None, description="The unique identifier of a Flat user") + group: Optional[StrictStr] = Field(default=None, description="The unique identifier of a Flat group") + user_email: Optional[StrictStr] = Field(default=None, description="Fill this field to invite an individual user by email. ", alias="userEmail") + user_token: Optional[StrictStr] = Field(default=None, description="Token received in an invitation to join the score. ", alias="userToken") + acl_read: Optional[StrictBool] = Field(default=True, description="`True` if the related user can read the score. (probably true if the user has a permission on the document). ", alias="aclRead") + acl_write: Optional[StrictBool] = Field(default=False, description="`True` if the related user can modify the score. ", alias="aclWrite") + acl_admin: Optional[StrictBool] = Field(default=False, description="`True` if the related user can can manage the current document, i.e. changing the document permissions and deleting the document ", alias="aclAdmin") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["user", "group", "userEmail", "userToken", "aclRead", "aclWrite", "aclAdmin"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceCollaboratorCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceCollaboratorCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "user": obj.get("user"), + "group": obj.get("group"), + "userEmail": obj.get("userEmail"), + "userToken": obj.get("userToken"), + "aclRead": obj.get("aclRead") if obj.get("aclRead") is not None else True, + "aclWrite": obj.get("aclWrite") if obj.get("aclWrite") is not None else False, + "aclAdmin": obj.get("aclAdmin") if obj.get("aclAdmin") is not None else False + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/resource_rights.py b/flat_api/aio/models/resource_rights.py new file mode 100644 index 0000000..edcaeff --- /dev/null +++ b/flat_api/aio/models/resource_rights.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ResourceRights(BaseModel): + """ + The rights of the current user on a score or collection + """ # noqa: E501 + acl_read: StrictBool = Field(description="`True` if the current user can read the current document ", alias="aclRead") + acl_write: StrictBool = Field(description="`True` if the current user can modify the current document. If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclWrite") + acl_admin: StrictBool = Field(description="`True` if the current user can manage the current document (i.e. share, delete) If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclAdmin") + is_collaborator: Optional[StrictBool] = Field(default=False, description="`True` if the current user is a collaborator of the current document (direct or via group). ", alias="isCollaborator") + collaborator_type: Optional[StrictStr] = Field(default=None, description="The type of the collaborator for the resource ", alias="collaboratorType") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["aclRead", "aclWrite", "aclAdmin", "isCollaborator", "collaboratorType"] + + @field_validator('collaborator_type') + def collaborator_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['owner', 'user', 'group']): + raise ValueError("must be one of enum values ('owner', 'user', 'group')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ResourceRights from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ResourceRights from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "aclRead": obj.get("aclRead") if obj.get("aclRead") is not None else False, + "aclWrite": obj.get("aclWrite") if obj.get("aclWrite") is not None else False, + "aclAdmin": obj.get("aclAdmin") if obj.get("aclAdmin") is not None else False, + "isCollaborator": obj.get("isCollaborator") if obj.get("isCollaborator") is not None else False, + "collaboratorType": obj.get("collaboratorType") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_comment.py b/flat_api/aio/models/score_comment.py new file mode 100644 index 0000000..5dde80f --- /dev/null +++ b/flat_api/aio/models/score_comment.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_comment_context import ScoreCommentContext +from flat_api.aio.models.score_comment_moderation import ScoreCommentModeration +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreComment(BaseModel): + """ + Comment added on a sheet music + """ # noqa: E501 + id: StrictStr = Field(description="The comment unique identifier") + type: StrictStr = Field(description="The type of the comment") + user: StrictStr = Field(description="The author unique identifier") + score: StrictStr = Field(description="The unique identifier of the score where the comment was posted") + revision: Optional[StrictStr] = Field(default=None, description="The unique identifier of revision the comment was posted") + reply_to: Optional[StrictStr] = Field(default=None, description="When the comment is a reply to another comment, the unique identifier of the parent comment ", alias="replyTo") + var_date: datetime = Field(description="The date when the comment was posted", alias="date") + modification_date: Optional[datetime] = Field(default=None, description="The date of the last comment modification", alias="modificationDate") + comment: StrictStr = Field(description="The comment text that can includes mentions using the following format: `@[id:username]`. ") + raw_comment: StrictStr = Field(description="A raw version of the comment, that can be displayed without parsing the mentions. ", alias="rawComment") + context: Optional[ScoreCommentContext] = None + mentions: Optional[List[StrictStr]] = Field(default=None, description="The list of user identifier mentioned on the score") + resolved: Optional[StrictBool] = Field(default=None, description="For inline comments, the comment can be marked as resolved and will be hidden in the future responses ") + resolved_by: Optional[StrictStr] = Field(default=None, description="If the user is marked as resolved, this will contain the unique identifier of the User who marked this comment as resolved ", alias="resolvedBy") + moderation: Optional[ScoreCommentModeration] = None + spam: Optional[StrictBool] = Field(default=None, description="`true if the message has been detected as spam and hidden from other users ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "user", "score", "revision", "replyTo", "date", "modificationDate", "comment", "rawComment", "context", "mentions", "resolved", "resolvedBy", "moderation", "spam"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['document', 'inline']): + raise ValueError("must be one of enum values ('document', 'inline')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreComment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of context + if self.context: + _dict['context'] = self.context.to_dict() + # override the default output from pydantic by calling `to_dict()` of moderation + if self.moderation: + _dict['moderation'] = self.moderation.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreComment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "user": obj.get("user"), + "score": obj.get("score"), + "revision": obj.get("revision"), + "replyTo": obj.get("replyTo"), + "date": obj.get("date"), + "modificationDate": obj.get("modificationDate"), + "comment": obj.get("comment"), + "rawComment": obj.get("rawComment"), + "context": ScoreCommentContext.from_dict(obj["context"]) if obj.get("context") is not None else None, + "mentions": obj.get("mentions"), + "resolved": obj.get("resolved"), + "resolvedBy": obj.get("resolvedBy"), + "moderation": ScoreCommentModeration.from_dict(obj["moderation"]) if obj.get("moderation") is not None else None, + "spam": obj.get("spam") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_comment_context.py b/flat_api/aio/models/score_comment_context.py new file mode 100644 index 0000000..c5a2e64 --- /dev/null +++ b/flat_api/aio/models/score_comment_context.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCommentContext(BaseModel): + """ + The context of the comment (for inline/contextualized comments). A context will include all the information related to the location of the comment (i.e. score parts, range of measure, time position). + """ # noqa: E501 + part_uuid: StrictStr = Field(description="The unique identifier (UUID) of the score part", alias="partUuid") + staff_idx: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="(Deprecated, use `staffUuid`) The identififer of the staff", alias="staffIdx") + staff_uuid: Optional[StrictStr] = Field(default=None, description="The unique identififer (UUID) of the staff", alias="staffUuid") + measure_uuids: List[StrictStr] = Field(description="The list of measure UUIds", alias="measureUuids") + start_time_pos: Union[StrictFloat, StrictInt] = Field(alias="startTimePos") + stop_time_pos: Union[StrictFloat, StrictInt] = Field(alias="stopTimePos") + start_dpq: Union[StrictFloat, StrictInt] = Field(alias="startDpq") + stop_dpq: Union[StrictFloat, StrictInt] = Field(alias="stopDpq") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["partUuid", "staffIdx", "staffUuid", "measureUuids", "startTimePos", "stopTimePos", "startDpq", "stopDpq"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCommentContext from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCommentContext from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "partUuid": obj.get("partUuid"), + "staffIdx": obj.get("staffIdx"), + "staffUuid": obj.get("staffUuid"), + "measureUuids": obj.get("measureUuids"), + "startTimePos": obj.get("startTimePos"), + "stopTimePos": obj.get("stopTimePos"), + "startDpq": obj.get("startDpq"), + "stopDpq": obj.get("stopDpq") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_comment_creation.py b/flat_api/aio/models/score_comment_creation.py new file mode 100644 index 0000000..4a36990 --- /dev/null +++ b/flat_api/aio/models/score_comment_creation.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_comment_context import ScoreCommentContext +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCommentCreation(BaseModel): + """ + Creation of a comment + """ # noqa: E501 + revision: Optional[StrictStr] = Field(default=None, description="The unique identifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. ") + comment: StrictStr = Field(description="The comment text that can includes mentions using the following format: `@[id:username]`. ") + raw_comment: Optional[StrictStr] = Field(default=None, description="A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set. ", alias="rawComment") + mentions: Optional[List[StrictStr]] = Field(default=None, description="The list of user identifiers mentioned in this comment") + reply_to: Optional[StrictStr] = Field(default=None, description="When the comment is a reply to another comment, the unique identifier of the parent comment ", alias="replyTo") + context: Optional[ScoreCommentContext] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["revision", "comment", "rawComment", "mentions", "replyTo", "context"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCommentCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of context + if self.context: + _dict['context'] = self.context.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCommentCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "revision": obj.get("revision"), + "comment": obj.get("comment"), + "rawComment": obj.get("rawComment"), + "mentions": obj.get("mentions"), + "replyTo": obj.get("replyTo"), + "context": ScoreCommentContext.from_dict(obj["context"]) if obj.get("context") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_comment_moderation.py b/flat_api/aio/models/score_comment_moderation.py new file mode 100644 index 0000000..71918c5 --- /dev/null +++ b/flat_api/aio/models/score_comment_moderation.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCommentModeration(BaseModel): + """ + Information about the comment being moderated + """ # noqa: E501 + hidden: Optional[StrictBool] = Field(default=None, description="If true, this comment will be hidden from other users") + reason: Optional[StrictStr] = Field(default=None, description="If the comment is hidden, the reason why this one has been moderated") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["hidden", "reason"] + + @field_validator('reason') + def reason_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['spam', 'inappropriate']): + raise ValueError("must be one of enum values ('spam', 'inappropriate')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCommentModeration from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCommentModeration from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "hidden": obj.get("hidden"), + "reason": obj.get("reason") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_comment_update.py b/flat_api/aio/models/score_comment_update.py new file mode 100644 index 0000000..aca521a --- /dev/null +++ b/flat_api/aio/models/score_comment_update.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.score_comment_context import ScoreCommentContext +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCommentUpdate(BaseModel): + """ + Update of a comment + """ # noqa: E501 + revision: Optional[StrictStr] = Field(default=None, description="The unique identifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. ") + comment: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=10000)]] = Field(default=None, description="The comment text that can includes mentions using the following format: `@[id:username]`. ") + raw_comment: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=10000)]] = Field(default=None, description="A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set. ", alias="rawComment") + context: Optional[ScoreCommentContext] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["revision", "comment", "rawComment", "context"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCommentUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of context + if self.context: + _dict['context'] = self.context.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCommentUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "revision": obj.get("revision"), + "comment": obj.get("comment"), + "rawComment": obj.get("rawComment"), + "context": ScoreCommentContext.from_dict(obj["context"]) if obj.get("context") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_comments_counts.py b/flat_api/aio/models/score_comments_counts.py new file mode 100644 index 0000000..eff64ff --- /dev/null +++ b/flat_api/aio/models/score_comments_counts.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCommentsCounts(BaseModel): + """ + A computed version of the total, unique, weekly, monthly and yearly number of comments added on the documents (this doesn't include inline comments). + """ # noqa: E501 + total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of comments added to the score") + unique: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The unique (1/user) number of comments added to the score") + weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The weekly unique number of comments added to the score") + monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The monthly unique number of comments added to the score") + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The yearly unique number of comments added to the score") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "unique", "weekly", "monthly", "yearly"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCommentsCounts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCommentsCounts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "unique": obj.get("unique"), + "weekly": obj.get("weekly"), + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_creation.py b/flat_api/aio/models/score_creation.py new file mode 100644 index 0000000..0a63be2 --- /dev/null +++ b/flat_api/aio/models/score_creation.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.aio.models.score_creation_builder_data import ScoreCreationBuilderData +from flat_api.aio.models.score_creation_file_import import ScoreCreationFileImport +from flat_api.aio.models.score_creation_google_drive_import import ScoreCreationGoogleDriveImport +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +SCORECREATION_ONE_OF_SCHEMAS = ["ScoreCreationBuilderData", "ScoreCreationFileImport", "ScoreCreationGoogleDriveImport"] + +class ScoreCreation(BaseModel): + """ + ScoreCreation + """ + # data type: ScoreCreationBuilderData + oneof_schema_1_validator: Optional[ScoreCreationBuilderData] = None + # data type: ScoreCreationFileImport + oneof_schema_2_validator: Optional[ScoreCreationFileImport] = None + # data type: ScoreCreationGoogleDriveImport + oneof_schema_3_validator: Optional[ScoreCreationGoogleDriveImport] = None + actual_instance: Optional[Union[ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport]] = None + one_of_schemas: Set[str] = { "ScoreCreationBuilderData", "ScoreCreationFileImport", "ScoreCreationGoogleDriveImport" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ScoreCreation.model_construct() + error_messages = [] + match = 0 + # validate data type: ScoreCreationBuilderData + if not isinstance(v, ScoreCreationBuilderData): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScoreCreationBuilderData`") + else: + match += 1 + # validate data type: ScoreCreationFileImport + if not isinstance(v, ScoreCreationFileImport): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScoreCreationFileImport`") + else: + match += 1 + # validate data type: ScoreCreationGoogleDriveImport + if not isinstance(v, ScoreCreationGoogleDriveImport): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScoreCreationGoogleDriveImport`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into ScoreCreationBuilderData + try: + instance.actual_instance = ScoreCreationBuilderData.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScoreCreationFileImport + try: + instance.actual_instance = ScoreCreationFileImport.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScoreCreationGoogleDriveImport + try: + instance.actual_instance = ScoreCreationGoogleDriveImport.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 ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/aio/models/score_creation_builder_data.py b/flat_api/aio/models/score_creation_builder_data.py new file mode 100644 index 0000000..eba36b1 --- /dev/null +++ b/flat_api/aio/models/score_creation_builder_data.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data import ScoreCreationBuilderDataAllOfBuilderData +from flat_api.aio.models.score_privacy import ScorePrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationBuilderData(BaseModel): + """ + ScoreCreationBuilderData + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + builder_data: ScoreCreationBuilderDataAllOfBuilderData = Field(alias="builderData") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder", "builderData"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of builder_data + if self.builder_data: + _dict['builderData'] = self.builder_data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder"), + "builderData": ScoreCreationBuilderDataAllOfBuilderData.from_dict(obj["builderData"]) if obj.get("builderData") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_creation_builder_data_all_of_builder_data.py b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data.py new file mode 100644 index 0000000..36ae53d --- /dev/null +++ b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_layout_data import ScoreCreationBuilderDataAllOfBuilderDataLayoutData +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_score_data import ScoreCreationBuilderDataAllOfBuilderDataScoreData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationBuilderDataAllOfBuilderData(BaseModel): + """ + ScoreCreationBuilderDataAllOfBuilderData + """ # noqa: E501 + score_data: ScoreCreationBuilderDataAllOfBuilderDataScoreData = Field(alias="scoreData") + layout_data: Optional[ScoreCreationBuilderDataAllOfBuilderDataLayoutData] = Field(default=None, alias="layoutData") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["scoreData", "layoutData"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of score_data + if self.score_data: + _dict['scoreData'] = self.score_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of layout_data + if self.layout_data: + _dict['layoutData'] = self.layout_data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scoreData": ScoreCreationBuilderDataAllOfBuilderDataScoreData.from_dict(obj["scoreData"]) if obj.get("scoreData") is not None else None, + "layoutData": ScoreCreationBuilderDataAllOfBuilderDataLayoutData.from_dict(obj["layoutData"]) if obj.get("layoutData") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_builder_data_layout_data.py b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data_layout_data.py similarity index 61% rename from flat_api/models/score_creation_builder_data_layout_data.py rename to flat_api/aio/models/score_creation_builder_data_all_of_builder_data_layout_data.py index a69f749..8c1a30e 100644 --- a/flat_api/models/score_creation_builder_data_layout_data.py +++ b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data_layout_data.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python -class ScoreCreationBuilderDataLayoutData(BaseModel): +class ScoreCreationBuilderDataAllOfBuilderDataLayoutData(BaseModel): """ Control the appearance of the score. If missing, default values are used. """ # noqa: E501 @@ -35,6 +36,7 @@ class ScoreCreationBuilderDataLayoutData(BaseModel): page_margin_bottom: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The bottom margin of the page in chosen unit (`lengthUnit`).", alias="pageMarginBottom") page_margin_left: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The left margin of the page in chosen unit (`lengthUnit`).", alias="pageMarginLeft") page_margin_right: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The right margin of the page in chosen unit (`lengthUnit`).", alias="pageMarginRight") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["notesSpacingCoeff", "lengthUnit", "pageHeight", "pageWidth", "pageMarginTop", "pageMarginBottom", "pageMarginLeft", "pageMarginRight"] @field_validator('length_unit') @@ -47,11 +49,12 @@ def length_unit_validate_enum(cls, value): raise ValueError("must be one of enum values ('cm', 'inch')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,12 +63,11 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ScoreCreationBuilderDataLayoutData from a JSON string""" + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -77,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,11 +90,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScoreCreationBuilderDataLayoutData from a dict""" + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData from a dict""" if obj is None: return None @@ -107,6 +116,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "pageMarginLeft": obj.get("pageMarginLeft"), "pageMarginRight": obj.get("pageMarginRight") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/aio/models/score_creation_builder_data_all_of_builder_data_score_data.py b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data_score_data.py new file mode 100644 index 0000000..0a7ff65 --- /dev/null +++ b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data_score_data.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.aio.models.score_creation_builder_data_all_of_builder_data_score_data_instruments import ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationBuilderDataAllOfBuilderDataScoreData(BaseModel): + """ + ScoreCreationBuilderDataAllOfBuilderDataScoreData + """ # noqa: E501 + use_tab_staff: Optional[StrictBool] = Field(default=None, description="true if the TAB staff is displayed with fretted instruments", alias="useTabStaff") + use_chord_grid: Optional[StrictBool] = Field(default=None, description="true if the chord grid must be displayed with fretted instruments", alias="useChordGrid") + fifths: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The key signature of the score (expressed between -7 and 7). Major C is used when the value is not provided.") + nb_beats: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of beats in the measure", alias="nbBeats") + beat_type: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The duration of a beat in the measure", alias="beatType") + instruments: List[ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments] = Field(description="The list of instruments to add to the score. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments) for the possible values for `group` and `instrument` (also available as the [`@flat/instruments`](https://www.npmjs.com/package/@flat/instruments) package). ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["useTabStaff", "useChordGrid", "fifths", "nbBeats", "beatType", "instruments"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instruments (list) + _items = [] + if self.instruments: + for _item_instruments in self.instruments: + if _item_instruments: + _items.append(_item_instruments.to_dict()) + _dict['instruments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "useTabStaff": obj.get("useTabStaff"), + "useChordGrid": obj.get("useChordGrid"), + "fifths": obj.get("fifths"), + "nbBeats": obj.get("nbBeats"), + "beatType": obj.get("beatType"), + "instruments": [ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_builder_data_score_data_instruments_inner.py b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py similarity index 50% rename from flat_api/models/score_creation_builder_data_score_data_instruments_inner.py rename to flat_api/aio/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py index 7ea8959..f60153a 100644 --- a/flat_api/models/score_creation_builder_data_score_data_instruments_inner.py +++ b/flat_api/aio/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,27 +18,30 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python -class ScoreCreationBuilderDataScoreDataInstrumentsInner(BaseModel): +class ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments(BaseModel): """ - ScoreCreationBuilderDataScoreDataInstrumentsInner + ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments """ # noqa: E501 group: StrictStr = Field(description="The of the instrument group (e.g. `keyboards`, `brass`)") instrument: StrictStr = Field(description="The identifier of the instrument (e.g. `piano`, `trumpet`)") long_name: Optional[StrictStr] = Field(default=None, description="The full name of the instrument", alias="longName") short_name: Optional[StrictStr] = Field(default=None, description="The abbreviation of the name of the instrument", alias="shortName") has_quarter_tone: Optional[StrictBool] = Field(default=None, description="True if the part can use quarter tone (prevent the part to have a TAB/chord grid)", alias="hasQuarterTone") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["group", "instrument", "longName", "shortName", "hasQuarterTone"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -47,12 +50,11 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ScoreCreationBuilderDataScoreDataInstrumentsInner from a JSON string""" + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -64,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,11 +77,16 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScoreCreationBuilderDataScoreDataInstrumentsInner from a dict""" + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments from a dict""" if obj is None: return None @@ -91,6 +100,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "shortName": obj.get("shortName"), "hasQuarterTone": obj.get("hasQuarterTone") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/aio/models/score_creation_common.py b/flat_api/aio/models/score_creation_common.py new file mode 100644 index 0000000..5073550 --- /dev/null +++ b/flat_api/aio/models/score_creation_common.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_privacy import ScorePrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationCommon(BaseModel): + """ + ScoreCreationCommon + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationCommon from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationCommon from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_creation_file_import.py b/flat_api/aio/models/score_creation_file_import.py new file mode 100644 index 0000000..2a7d925 --- /dev/null +++ b/flat_api/aio/models/score_creation_file_import.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_privacy import ScorePrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationFileImport(BaseModel): + """ + ScoreCreationFileImport + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + filename: Optional[StrictStr] = Field(default=None, description="If this is an imported file, its filename") + data: StrictStr = Field(description="The data of the score file. See the `POST /scores` endpoint description for the full list of supported formats. Binary payloads (e.g. compressed MusicXML, MIDI, Guitar Pro) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. ") + data_encoding: Optional[StrictStr] = Field(default=None, description="The optional encoding of the score data. This property must match the encoding used for the `data` property.", alias="dataEncoding") + supports_tasks: Optional[StrictBool] = Field(default=None, description="Set this to `true` if the client supports asynchronous task flows. When importing a score that requires OMR processing (a PDF or a page image), the API will return a 202 Accepted response along with a task reference. The client can then check the task status using the endpoint `GET /v2/tasks/{task}`. ", alias="supportsTasks") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder", "filename", "data", "dataEncoding", "supportsTasks"] + + @field_validator('data_encoding') + def data_encoding_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['base64']): + raise ValueError("must be one of enum values ('base64')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationFileImport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationFileImport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder"), + "filename": obj.get("filename"), + "data": obj.get("data"), + "dataEncoding": obj.get("dataEncoding"), + "supportsTasks": obj.get("supportsTasks") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_creation_google_drive_import.py b/flat_api/aio/models/score_creation_google_drive_import.py new file mode 100644 index 0000000..296a1d0 --- /dev/null +++ b/flat_api/aio/models/score_creation_google_drive_import.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_privacy import ScorePrivacy +from flat_api.aio.models.score_source import ScoreSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationGoogleDriveImport(BaseModel): + """ + ScoreCreationGoogleDriveImport + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + source: ScoreSource + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder", "source"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationGoogleDriveImport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationGoogleDriveImport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder"), + "source": ScoreSource.from_dict(obj["source"]) if obj.get("source") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_creation_type.py b/flat_api/aio/models/score_creation_type.py new file mode 100644 index 0000000..27d1340 --- /dev/null +++ b/flat_api/aio/models/score_creation_type.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ScoreCreationType(str, Enum): + """ + The type of creation (an orginal, an arrangement) + """ + + """ + allowed enum values + """ + ORIGINAL = 'original' + ARRANGEMENT = 'arrangement' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ScoreCreationType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/score_details.py b/flat_api/aio/models/score_details.py new file mode 100644 index 0000000..3a9ea62 --- /dev/null +++ b/flat_api/aio/models/score_details.py @@ -0,0 +1,229 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from flat_api.aio.models.resource_collaborator import ResourceCollaborator +from flat_api.aio.models.resource_rights import ResourceRights +from flat_api.aio.models.score_comments_counts import ScoreCommentsCounts +from flat_api.aio.models.score_creation_type import ScoreCreationType +from flat_api.aio.models.score_details_all_of_me import ScoreDetailsAllOfMe +from flat_api.aio.models.score_license import ScoreLicense +from flat_api.aio.models.score_likes_counts import ScoreLikesCounts +from flat_api.aio.models.score_plays_counts import ScorePlaysCounts +from flat_api.aio.models.score_privacy import ScorePrivacy +from flat_api.aio.models.score_views_counts import ScoreViewsCounts +from flat_api.aio.models.user_public import UserPublic +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreDetails(BaseModel): + """ + The score and all its details + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the score") + sharing_key: Optional[StrictStr] = Field(default=None, description="The private sharing key of the score (available when the `privacy` mode is set to `privateLink`)", alias="sharingKey") + title: StrictStr = Field(description="The title of the score") + privacy: ScorePrivacy + user: UserPublic + html_url: StrictStr = Field(description="The url where the score can be viewed in a web browser", alias="htmlUrl") + edit_html_url: StrictStr = Field(description="The url where the score can be edited in a web browser", alias="editHtmlUrl") + subtitle: Optional[StrictStr] = Field(default=None, description="Subtitle of the score") + lyricist: Optional[StrictStr] = Field(default=None, description="Lyricist of the score") + arranger: Optional[StrictStr] = Field(default=None, description="Arranger of the score") + composer: Optional[StrictStr] = Field(default=None, description="Composer of the score") + description: Optional[StrictStr] = Field(default=None, description="Description of the creation") + tags: Optional[List[Annotated[str, Field(strict=True)]]] = Field(default=None, description="Tags describing the score") + creation_type: Optional[ScoreCreationType] = Field(default=None, alias="creationType") + license: Optional[ScoreLicense] = None + license_text: Optional[StrictStr] = Field(default=None, description="Additional license text written on the exported/printed score", alias="licenseText") + duration_time: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="In seconds, an approximative duration of the score", alias="durationTime") + number_measures: Optional[StrictInt] = Field(default=None, description="The number of measures in the score", alias="numberMeasures") + main_tempo_qpm: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The main tempo of the score (in QPM)", alias="mainTempoQpm") + main_key_signature: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The main key signature of the score (expressed between -7 and 7).", alias="mainKeySignature") + rights: Optional[ResourceRights] = None + collaborators: List[ResourceCollaborator] = Field(description="The list of the collaborators of the score") + creation_date: datetime = Field(description="The date when the score was created", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="The date of the last revision of the score", alias="modificationDate") + publication_date: Optional[datetime] = Field(default=None, description="The date when the score was published on Flat", alias="publicationDate") + scheduled_deletion_date: Optional[datetime] = Field(default=None, description="The date when the score will be definitively deleted. This date can be in the past if the score will be deleted at the next deletion batch, in this case you can display something like \"Deleted shortly\". Schedule: * For all paying users, the scores will be definitively deleted after 90 days. * For free users, the scores are no longer available after 24 hours, an can be restored with a paying account up to 90 days. ", alias="scheduledDeletionDate") + highlighted_date: Optional[datetime] = Field(default=None, description="The date when the score was highlighted (featured) on our community", alias="highlightedDate") + organization: Optional[StrictStr] = Field(default=None, description="If the score has been created in an organization, the identifier of this organization. This property is especially used with the score privacy `organizationPublic`. ") + parent_score: Optional[StrictStr] = Field(default=None, description="If the score has been forked, the unique identifier of the parent score. ", alias="parentScore") + instruments: List[StrictStr] = Field(description="An array of the instrument identifiers used in the last version of the score. This is mainly used to display a list of the instruments in the Flat's UI or instruments icons. The format of the strings is `{instrument-group}.{instrument-id}`. ") + instruments_names: List[StrictStr] = Field(description="An array of the instrument names used in the last version of the score. This list is localized and ready-to-display and will match the indexes from the `instruments` list. ", alias="instrumentsNames") + samples: List[StrictStr] = Field(description="An array of the audio samples identifiers used the different score parts. The format of the strings is `{instrument-group}.{sample-id}`. ") + google_drive_file_id: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and the score exists on Google Drive, this field will contain the unique identifier of the Flat score on Google Drive. You can access the document using the url: `https://drive.google.com/open?id={googleDriveFileId}` ", alias="googleDriveFileId") + likes: Optional[ScoreLikesCounts] = None + comments: Optional[ScoreCommentsCounts] = None + views: Optional[ScoreViewsCounts] = None + plays: Optional[ScorePlaysCounts] = None + collections: Optional[List[StrictStr]] = Field(default=None, description="The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them.") + me: Optional[ScoreDetailsAllOfMe] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "sharingKey", "title", "privacy", "user", "htmlUrl", "editHtmlUrl", "subtitle", "lyricist", "arranger", "composer", "description", "tags", "creationType", "license", "licenseText", "durationTime", "numberMeasures", "mainTempoQpm", "mainKeySignature", "rights", "collaborators", "creationDate", "modificationDate", "publicationDate", "scheduledDeletionDate", "highlightedDate", "organization", "parentScore", "instruments", "instrumentsNames", "samples", "googleDriveFileId", "likes", "comments", "views", "plays", "collections", "me"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + # override the default output from pydantic by calling `to_dict()` of rights + if self.rights: + _dict['rights'] = self.rights.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in collaborators (list) + _items = [] + if self.collaborators: + for _item_collaborators in self.collaborators: + if _item_collaborators: + _items.append(_item_collaborators.to_dict()) + _dict['collaborators'] = _items + # override the default output from pydantic by calling `to_dict()` of likes + if self.likes: + _dict['likes'] = self.likes.to_dict() + # override the default output from pydantic by calling `to_dict()` of comments + if self.comments: + _dict['comments'] = self.comments.to_dict() + # override the default output from pydantic by calling `to_dict()` of views + if self.views: + _dict['views'] = self.views.to_dict() + # override the default output from pydantic by calling `to_dict()` of plays + if self.plays: + _dict['plays'] = self.plays.to_dict() + # override the default output from pydantic by calling `to_dict()` of me + if self.me: + _dict['me'] = self.me.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if creation_type (nullable) is None + # and model_fields_set contains the field + if self.creation_type is None and "creation_type" in self.model_fields_set: + _dict['creationType'] = None + + # set to None if license (nullable) is None + # and model_fields_set contains the field + if self.license is None and "license" in self.model_fields_set: + _dict['license'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "sharingKey": obj.get("sharingKey"), + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "user": UserPublic.from_dict(obj["user"]) if obj.get("user") is not None else None, + "htmlUrl": obj.get("htmlUrl"), + "editHtmlUrl": obj.get("editHtmlUrl"), + "subtitle": obj.get("subtitle"), + "lyricist": obj.get("lyricist"), + "arranger": obj.get("arranger"), + "composer": obj.get("composer"), + "description": obj.get("description"), + "tags": obj.get("tags"), + "creationType": obj.get("creationType"), + "license": obj.get("license"), + "licenseText": obj.get("licenseText"), + "durationTime": obj.get("durationTime"), + "numberMeasures": obj.get("numberMeasures"), + "mainTempoQpm": obj.get("mainTempoQpm"), + "mainKeySignature": obj.get("mainKeySignature"), + "rights": ResourceRights.from_dict(obj["rights"]) if obj.get("rights") is not None else None, + "collaborators": [ResourceCollaborator.from_dict(_item) for _item in obj["collaborators"]] if obj.get("collaborators") is not None else None, + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), + "publicationDate": obj.get("publicationDate"), + "scheduledDeletionDate": obj.get("scheduledDeletionDate"), + "highlightedDate": obj.get("highlightedDate"), + "organization": obj.get("organization"), + "parentScore": obj.get("parentScore"), + "instruments": obj.get("instruments"), + "instrumentsNames": obj.get("instrumentsNames"), + "samples": obj.get("samples"), + "googleDriveFileId": obj.get("googleDriveFileId"), + "likes": ScoreLikesCounts.from_dict(obj["likes"]) if obj.get("likes") is not None else None, + "comments": ScoreCommentsCounts.from_dict(obj["comments"]) if obj.get("comments") is not None else None, + "views": ScoreViewsCounts.from_dict(obj["views"]) if obj.get("views") is not None else None, + "plays": ScorePlaysCounts.from_dict(obj["plays"]) if obj.get("plays") is not None else None, + "collections": obj.get("collections"), + "me": ScoreDetailsAllOfMe.from_dict(obj["me"]) if obj.get("me") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_details_all_of_me.py b/flat_api/aio/models/score_details_all_of_me.py new file mode 100644 index 0000000..8899e4c --- /dev/null +++ b/flat_api/aio/models/score_details_all_of_me.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreDetailsAllOfMe(BaseModel): + """ + Information about the authenticated user and this score + """ # noqa: E501 + is_liked: StrictBool = Field(description="True if the current user likes this score", alias="isLiked") + is_in_library: StrictBool = Field(description="True if the score is stored in one of the user's collections", alias="isInLibrary") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["isLiked", "isInLibrary"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreDetailsAllOfMe from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreDetailsAllOfMe from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "isLiked": obj.get("isLiked"), + "isInLibrary": obj.get("isInLibrary") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_fork.py b/flat_api/aio/models/score_fork.py new file mode 100644 index 0000000..1ef11e3 --- /dev/null +++ b/flat_api/aio/models/score_fork.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreFork(BaseModel): + """ + Options to fork the score + """ # noqa: E501 + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be copied. If no collection identifier is provided, a virtual collection is used, or `null` is provided, the score won't be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_disabled: Optional[StrictBool] = Field(default=False, description="If set to `true`, the API won't create the score on Google Drive ", alias="googleDriveDisabled") + keep_original_title: Optional[StrictBool] = Field(default=None, description="Option to keep the original title of the score (i.e. don't prepend it with \"Copy of \", or add the student name in assignment usage). ", alias="keepOriginalTitle") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["collection", "googleDriveDisabled", "keepOriginalTitle"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreFork from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if collection (nullable) is None + # and model_fields_set contains the field + if self.collection is None and "collection" in self.model_fields_set: + _dict['collection'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreFork from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "collection": obj.get("collection"), + "googleDriveDisabled": obj.get("googleDriveDisabled") if obj.get("googleDriveDisabled") is not None else False, + "keepOriginalTitle": obj.get("keepOriginalTitle") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_license.py b/flat_api/aio/models/score_license.py new file mode 100644 index 0000000..3295c4b --- /dev/null +++ b/flat_api/aio/models/score_license.py @@ -0,0 +1,44 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ScoreLicense(str, Enum): + """ + License of the creation. Read more about the Creative Commons licenses on https://creativecommons.org/licenses/ + """ + + """ + allowed enum values + """ + COPYRIGHT = 'copyright' + CC0 = 'cc0' + CC_MINUS_BY = 'cc-by' + CC_MINUS_BY_MINUS_SA = 'cc-by-sa' + CC_MINUS_BY_MINUS_ND = 'cc-by-nd' + CC_MINUS_BY_MINUS_NC = 'cc-by-nc' + CC_MINUS_BY_MINUS_NC_MINUS_SA = 'cc-by-nc-sa' + CC_MINUS_BY_MINUS_NC_MINUS_ND = 'cc-by-nc-nd' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ScoreLicense from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/score_likes_counts.py b/flat_api/aio/models/score_likes_counts.py new file mode 100644 index 0000000..37d2d3a --- /dev/null +++ b/flat_api/aio/models/score_likes_counts.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreLikesCounts(BaseModel): + """ + A computed version of the weekly, monthly, yearly and total number of likes for a score + """ # noqa: E501 + total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of likes of the score") + weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of new likes during the last week") + monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of new likes during the last month") + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of new likes during the last year") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "weekly", "monthly", "yearly"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreLikesCounts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreLikesCounts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "weekly": obj.get("weekly"), + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_modification.py b/flat_api/aio/models/score_modification.py new file mode 100644 index 0000000..2ab9d9b --- /dev/null +++ b/flat_api/aio/models/score_modification.py @@ -0,0 +1,178 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.score_creation_type import ScoreCreationType +from flat_api.aio.models.score_license import ScoreLicense +from flat_api.aio.models.score_privacy import ScorePrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreModification(BaseModel): + """ + Edit the score metadata + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the score") + subtitle: Optional[StrictStr] = Field(default=None, description="The subtitle of the score") + composer: Optional[StrictStr] = Field(default=None, description="The composer of the score") + lyricist: Optional[StrictStr] = Field(default=None, description="The lyricist of the score") + arranger: Optional[StrictStr] = Field(default=None, description="The arranger of the score") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + sharing_key: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="When using the `privacy` mode `privateLink`, this property can be used to set a custom sharing key, otherwise a new key will be generated.", alias="sharingKey") + description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field(default=None, description="Description of the creation") + tags: Optional[List[StrictStr]] = Field(default=None, description="Tags describing the score") + creation_type: Optional[ScoreCreationType] = Field(default=None, alias="creationType") + license: Optional[ScoreLicense] = None + license_text: Optional[StrictStr] = Field(default=None, description="The rights info written on the score", alias="licenseText") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "subtitle", "composer", "lyricist", "arranger", "privacy", "sharingKey", "description", "tags", "creationType", "license", "licenseText"] + + @field_validator('sharing_key', mode="before") + def sharing_key_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if isinstance(value, str) and not re.match(r"^[a-f0-9]{128}$", value): + raise ValueError(r"must validate the regular expression /^[a-f0-9]{128}$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreModification from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if subtitle (nullable) is None + # and model_fields_set contains the field + if self.subtitle is None and "subtitle" in self.model_fields_set: + _dict['subtitle'] = None + + # set to None if composer (nullable) is None + # and model_fields_set contains the field + if self.composer is None and "composer" in self.model_fields_set: + _dict['composer'] = None + + # set to None if lyricist (nullable) is None + # and model_fields_set contains the field + if self.lyricist is None and "lyricist" in self.model_fields_set: + _dict['lyricist'] = None + + # set to None if arranger (nullable) is None + # and model_fields_set contains the field + if self.arranger is None and "arranger" in self.model_fields_set: + _dict['arranger'] = None + + # set to None if description (nullable) is None + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: + _dict['description'] = None + + # set to None if creation_type (nullable) is None + # and model_fields_set contains the field + if self.creation_type is None and "creation_type" in self.model_fields_set: + _dict['creationType'] = None + + # set to None if license (nullable) is None + # and model_fields_set contains the field + if self.license is None and "license" in self.model_fields_set: + _dict['license'] = None + + # set to None if license_text (nullable) is None + # and model_fields_set contains the field + if self.license_text is None and "license_text" in self.model_fields_set: + _dict['licenseText'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreModification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "subtitle": obj.get("subtitle"), + "composer": obj.get("composer"), + "lyricist": obj.get("lyricist"), + "arranger": obj.get("arranger"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "sharingKey": obj.get("sharingKey"), + "description": obj.get("description"), + "tags": obj.get("tags"), + "creationType": obj.get("creationType"), + "license": obj.get("license"), + "licenseText": obj.get("licenseText") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_plays_counts.py b/flat_api/aio/models/score_plays_counts.py new file mode 100644 index 0000000..9ddca5e --- /dev/null +++ b/flat_api/aio/models/score_plays_counts.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScorePlaysCounts(BaseModel): + """ + A computed version of the total, weekly, monthly, and yearly number of plays of the score + """ # noqa: E501 + total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of plays of the score") + weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The weekly number of plays of the score") + monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The monthly number of plays of the score") + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The yearly number of plays of the score") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "weekly", "monthly", "yearly"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScorePlaysCounts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScorePlaysCounts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "weekly": obj.get("weekly"), + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_privacy.py b/flat_api/aio/models/score_privacy.py new file mode 100644 index 0000000..83b6f76 --- /dev/null +++ b/flat_api/aio/models/score_privacy.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ScorePrivacy(str, Enum): + """ + The score main privacy mode. - `public`: The score is public on the Internet. This one can be accessible at the url `https://flat.io/score/{score}` and can be modified and administred by specified collaborators users. - `private`: The score is private and can be only accessed, modified and administred by specified collaborators users. - `privateLink`: The score is private but can be accessed using a private link `htmlUrl` or the private key in the property `sharingKey`. - `organizationPublic`: _Available only with [Flat for Education](https://flat.io/edu)._ The score is public in the organization: users of the same organization can access to this one. The score can be modified and administred by specified collaborators users. The score can also be individually shared to a set of users or groups using the different collaborators API methods. When a file is synchronized from an external source (e.g. Google Drive) and the sharing options are changed on the source, Flat will chose the best privacy mode for the file. When using a [Flat for Education](https://flat.io/edu) account, some of the modes may not be available if disabled by an administrator of the organization (e.g. by default the `public` mode is not available). + """ + + """ + allowed enum values + """ + PUBLIC = 'public' + PRIVATE = 'private' + ORGANIZATIONPUBLIC = 'organizationPublic' + PRIVATELINK = 'privateLink' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ScorePrivacy from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/score_revision.py b/flat_api/aio/models/score_revision.py new file mode 100644 index 0000000..12c63c4 --- /dev/null +++ b/flat_api/aio/models/score_revision.py @@ -0,0 +1,123 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_revision_statistics import ScoreRevisionStatistics +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreRevision(BaseModel): + """ + A score revision metadata + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the revision.") + user: Optional[StrictStr] = Field(default=None, description="The user identifier who created the revision") + score: StrictStr = Field(description="The score identifier") + collaborators: Optional[List[StrictStr]] = None + var_date: datetime = Field(description="The date when this revision was created", alias="date") + event: Optional[StrictStr] = Field(default=None, description="The last event (action id) of the revision") + description: Optional[StrictStr] = Field(default=None, description="A description associated to the revision") + autosave: Optional[StrictBool] = Field(default=None, description="True if this revision was automatically generated by Flat and not on purpose by the user. ") + statistics: Optional[ScoreRevisionStatistics] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "user", "score", "collaborators", "date", "event", "description", "autosave", "statistics"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreRevision from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of statistics + if self.statistics: + _dict['statistics'] = self.statistics.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreRevision from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "user": obj.get("user"), + "score": obj.get("score"), + "collaborators": obj.get("collaborators"), + "date": obj.get("date"), + "event": obj.get("event"), + "description": obj.get("description"), + "autosave": obj.get("autosave"), + "statistics": ScoreRevisionStatistics.from_dict(obj["statistics"]) if obj.get("statistics") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_revision_creation.py b/flat_api/aio/models/score_revision_creation.py new file mode 100644 index 0000000..7fecfd3 --- /dev/null +++ b/flat_api/aio/models/score_revision_creation.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreRevisionCreation(BaseModel): + """ + A new created revision + """ # noqa: E501 + data: StrictStr = Field(description="The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file. Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. ", json_schema_extra={"examples": [""]}) + data_encoding: Optional[StrictStr] = Field(default=None, description="The optional encoding of the score data. This property must match the encoding used for the `data` property.", alias="dataEncoding") + autosave: Optional[StrictBool] = Field(default=None, description="Must be set to `true` if the revision was created automatically. ") + description: Optional[StrictStr] = Field(default=None, description="A description associated to the revision") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["data", "dataEncoding", "autosave", "description"] + + @field_validator('data_encoding') + def data_encoding_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['base64']): + raise ValueError("must be one of enum values ('base64')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreRevisionCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreRevisionCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": obj.get("data"), + "dataEncoding": obj.get("dataEncoding"), + "autosave": obj.get("autosave"), + "description": obj.get("description") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_revision_statistics.py b/flat_api/aio/models/score_revision_statistics.py new file mode 100644 index 0000000..88a907e --- /dev/null +++ b/flat_api/aio/models/score_revision_statistics.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreRevisionStatistics(BaseModel): + """ + The statistics related to the score revision (additions and deletions) + """ # noqa: E501 + additions: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of additions operations in the last revision") + deletions: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of deletions operations in the last revision") + start_date: Optional[datetime] = Field(default=None, description="The date of the first action included in this revision", alias="startDate") + end_date: Optional[datetime] = Field(default=None, description="The date of the latest action included in this revision", alias="endDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["additions", "deletions", "startDate", "endDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreRevisionStatistics from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreRevisionStatistics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "additions": obj.get("additions"), + "deletions": obj.get("deletions"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_source.py b/flat_api/aio/models/score_source.py new file mode 100644 index 0000000..d119658 --- /dev/null +++ b/flat_api/aio/models/score_source.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreSource(BaseModel): + """ + ScoreSource + """ # noqa: E501 + google_drive: Optional[StrictStr] = Field(default=None, description="If the score is a file on Google Drive, this field property must contain its identifier. To use this method, the Drive file must be public or the Flat Drive App must have access to the file. ", alias="googleDrive") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["googleDrive"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreSource from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreSource from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "googleDrive": obj.get("googleDrive") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_summary.py b/flat_api/aio/models/score_summary.py new file mode 100644 index 0000000..e0fe765 --- /dev/null +++ b/flat_api/aio/models/score_summary.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_privacy import ScorePrivacy +from flat_api.aio.models.user_public import UserPublic +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreSummary(BaseModel): + """ + A summary of the score details + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the score") + sharing_key: Optional[StrictStr] = Field(default=None, description="The private sharing key of the score (available when the `privacy` mode is set to `privateLink`)", alias="sharingKey") + title: StrictStr = Field(description="The title of the score") + privacy: ScorePrivacy + user: UserPublic + html_url: StrictStr = Field(description="The url where the score can be viewed in a web browser", alias="htmlUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "sharingKey", "title", "privacy", "user", "htmlUrl"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "sharingKey": obj.get("sharingKey"), + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "user": UserPublic.from_dict(obj["user"]) if obj.get("user") is not None else None, + "htmlUrl": obj.get("htmlUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_track.py b/flat_api/aio/models/score_track.py new file mode 100644 index 0000000..0c14288 --- /dev/null +++ b/flat_api/aio/models/score_track.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_track_point import ScoreTrackPoint +from flat_api.aio.models.score_track_purpose import ScoreTrackPurpose +from flat_api.aio.models.score_track_state import ScoreTrackState +from flat_api.aio.models.score_track_type import ScoreTrackType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreTrack(BaseModel): + """ + An audio track for a score + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the score track") + title: Optional[StrictStr] = Field(default=None, description="Title of the track") + score: Optional[StrictStr] = Field(default=None, description="The unique identifier of the score. Absent for Free Record performance submissions, which are recorded without an attached score. ") + creator: StrictStr = Field(description="The unique identifier of the track creator") + creation_date: datetime = Field(description="The creation date of the track", alias="creationDate") + modification_date: datetime = Field(description="The modification date of the track", alias="modificationDate") + default: StrictBool = Field(description="True if the track should be used as default audio source") + state: ScoreTrackState + type: ScoreTrackType + purpose: ScoreTrackPurpose + url: Optional[StrictStr] = Field(default=None, description="The URL of the track") + media_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the track when hosted on an external service. For example, if the url is `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, `mediaId` will be `dQw4w9WgXcQ` ", alias="mediaId") + synchronization_points: Optional[List[ScoreTrackPoint]] = Field(default=None, alias="synchronizationPoints") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "title", "score", "creator", "creationDate", "modificationDate", "default", "state", "type", "purpose", "url", "mediaId", "synchronizationPoints"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreTrack from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in synchronization_points (list) + _items = [] + if self.synchronization_points: + for _item_synchronization_points in self.synchronization_points: + if _item_synchronization_points: + _items.append(_item_synchronization_points.to_dict()) + _dict['synchronizationPoints'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreTrack from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "title": obj.get("title"), + "score": obj.get("score"), + "creator": obj.get("creator"), + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), + "default": obj.get("default"), + "state": obj.get("state") if obj.get("state") is not None else ScoreTrackState.DRAFT, + "type": obj.get("type"), + "purpose": obj.get("purpose") if obj.get("purpose") is not None else ScoreTrackPurpose.COMMON, + "url": obj.get("url"), + "mediaId": obj.get("mediaId"), + "synchronizationPoints": [ScoreTrackPoint.from_dict(_item) for _item in obj["synchronizationPoints"]] if obj.get("synchronizationPoints") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_track_creation.py b/flat_api/aio/models/score_track_creation.py new file mode 100644 index 0000000..7f20282 --- /dev/null +++ b/flat_api/aio/models/score_track_creation.py @@ -0,0 +1,122 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_track_point import ScoreTrackPoint +from flat_api.aio.models.score_track_purpose import ScoreTrackPurpose +from flat_api.aio.models.score_track_state import ScoreTrackState +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreTrackCreation(BaseModel): + """ + Creation of a new track. This one must contain the URL of the track or the corresponding file + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="Title of the track") + default: Optional[StrictBool] = Field(default=None, description="True if the track should be used as default audio source") + state: Optional[ScoreTrackState] = ScoreTrackState.DRAFT + purpose: Optional[ScoreTrackPurpose] = ScoreTrackPurpose.COMMON + url: Optional[StrictStr] = Field(default=None, description="The URL of the track") + synchronization_points: Optional[List[ScoreTrackPoint]] = Field(default=None, alias="synchronizationPoints") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "default", "state", "purpose", "url", "synchronizationPoints"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreTrackCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in synchronization_points (list) + _items = [] + if self.synchronization_points: + for _item_synchronization_points in self.synchronization_points: + if _item_synchronization_points: + _items.append(_item_synchronization_points.to_dict()) + _dict['synchronizationPoints'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreTrackCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "default": obj.get("default"), + "state": obj.get("state") if obj.get("state") is not None else ScoreTrackState.DRAFT, + "purpose": obj.get("purpose") if obj.get("purpose") is not None else ScoreTrackPurpose.COMMON, + "url": obj.get("url"), + "synchronizationPoints": [ScoreTrackPoint.from_dict(_item) for _item in obj["synchronizationPoints"]] if obj.get("synchronizationPoints") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_track_creation_response.py b/flat_api/aio/models/score_track_creation_response.py new file mode 100644 index 0000000..35acbd4 --- /dev/null +++ b/flat_api/aio/models/score_track_creation_response.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from flat_api.aio.models.score_track import ScoreTrack +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreTrackCreationResponse(BaseModel): + """ + Response for track creation including optional upload information + """ # noqa: E501 + track: ScoreTrack + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["track"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreTrackCreationResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of track + if self.track: + _dict['track'] = self.track.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreTrackCreationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "track": ScoreTrack.from_dict(obj["track"]) if obj.get("track") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_track_point.py b/flat_api/aio/models/score_track_point.py new file mode 100644 index 0000000..d3f9ed9 --- /dev/null +++ b/flat_api/aio/models/score_track_point.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from uuid import UUID +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreTrackPoint(BaseModel): + """ + A track synchronization point + """ # noqa: E501 + type: StrictStr = Field(description="The type of the synchronization point. If the type is `measure`, the measure uuid must be present in `measureUuid`") + measure_uuid: Optional[UUID] = Field(default=None, description="The measure unique identifier", alias="measureUuid") + time: Union[StrictFloat, StrictInt] = Field(description="The corresponding time in seconds") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "measureUuid", "time"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['measure', 'end']): + raise ValueError("must be one of enum values ('measure', 'end')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreTrackPoint from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreTrackPoint from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "measureUuid": obj.get("measureUuid"), + "time": obj.get("time") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_track_purpose.py b/flat_api/aio/models/score_track_purpose.py new file mode 100644 index 0000000..cd5341e --- /dev/null +++ b/flat_api/aio/models/score_track_purpose.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ScoreTrackPurpose(str, Enum): + """ + The purpose of the audio track + """ + + """ + allowed enum values + """ + COMMON = 'common' + PERFORMANCESUBMISSION = 'performanceSubmission' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ScoreTrackPurpose from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/score_track_state.py b/flat_api/aio/models/score_track_state.py new file mode 100644 index 0000000..e5d3200 --- /dev/null +++ b/flat_api/aio/models/score_track_state.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ScoreTrackState(str, Enum): + """ + State of the track + """ + + """ + allowed enum values + """ + DRAFT = 'draft' + COMPLETED = 'completed' + DELETED = 'deleted' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ScoreTrackState from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/score_track_type.py b/flat_api/aio/models/score_track_type.py new file mode 100644 index 0000000..33e083d --- /dev/null +++ b/flat_api/aio/models/score_track_type.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class ScoreTrackType(str, Enum): + """ + The type of an audio track + """ + + """ + allowed enum values + """ + AUDIO = 'audio' + SOUNDCLOUD = 'soundcloud' + YOUTUBE = 'youtube' + VIMEO = 'vimeo' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ScoreTrackType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/score_track_update.py b/flat_api/aio/models/score_track_update.py new file mode 100644 index 0000000..2867486 --- /dev/null +++ b/flat_api/aio/models/score_track_update.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.score_track_point import ScoreTrackPoint +from flat_api.aio.models.score_track_purpose import ScoreTrackPurpose +from flat_api.aio.models.score_track_state import ScoreTrackState +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreTrackUpdate(BaseModel): + """ + Update an existing track. + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="Title of the track") + default: Optional[StrictBool] = Field(default=None, description="True if the track should be used as default audio source") + state: Optional[ScoreTrackState] = ScoreTrackState.DRAFT + purpose: Optional[ScoreTrackPurpose] = ScoreTrackPurpose.COMMON + synchronization_points: Optional[List[ScoreTrackPoint]] = Field(default=None, alias="synchronizationPoints") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "default", "state", "purpose", "synchronizationPoints"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreTrackUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in synchronization_points (list) + _items = [] + if self.synchronization_points: + for _item_synchronization_points in self.synchronization_points: + if _item_synchronization_points: + _items.append(_item_synchronization_points.to_dict()) + _dict['synchronizationPoints'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreTrackUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "default": obj.get("default"), + "state": obj.get("state") if obj.get("state") is not None else ScoreTrackState.DRAFT, + "purpose": obj.get("purpose") if obj.get("purpose") is not None else ScoreTrackPurpose.COMMON, + "synchronizationPoints": [ScoreTrackPoint.from_dict(_item) for _item in obj["synchronizationPoints"]] if obj.get("synchronizationPoints") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/score_views_counts.py b/flat_api/aio/models/score_views_counts.py new file mode 100644 index 0000000..b20f9e1 --- /dev/null +++ b/flat_api/aio/models/score_views_counts.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreViewsCounts(BaseModel): + """ + A computed version of the total, weekly, monthly, and yearly number of views of the score + """ # noqa: E501 + total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of views of the score") + weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The weekly number of views of the score") + monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The monthly number of views of the score") + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The yearly number of views of the score") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "weekly", "monthly", "yearly"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreViewsCounts from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreViewsCounts from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "total": obj.get("total"), + "weekly": obj.get("weekly"), + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/task.py b/flat_api/aio/models/task.py new file mode 100644 index 0000000..9d22101 --- /dev/null +++ b/flat_api/aio/models/task.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.task_progress import TaskProgress +from flat_api.aio.models.task_result import TaskResult +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class Task(BaseModel): + """ + An asynchronous task + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the task") + type: Optional[StrictStr] = Field(default=None, description="Type of the task: * `audio-export`: Exports a score to audio format (MP3, WAV) * `score-save`: Saves or updates a score document * `import-omr`: Processes a PDF through OMR (Optical Music Recognition) and imports it as a score ") + state: StrictStr = Field(description="State of the Task") + format: Optional[StrictStr] = Field(default=None, description="For files processing, the file format (e.g. `mp3`, `wav`)") + score: Optional[StrictStr] = Field(default=None, description="The score unique identifier for tasks related to scores") + revision: Optional[StrictStr] = Field(default=None, description="The score revision identifier for tasks related to scores") + progress: Optional[TaskProgress] = None + creation_date: Optional[datetime] = Field(default=None, description="The creation date of the task", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="The last modification date of the task", alias="modificationDate") + done_date: Optional[datetime] = Field(default=None, description="The date when the task has been completed", alias="doneDate") + result: Optional[TaskResult] = None + error_history: Optional[List[StrictStr]] = Field(default=None, description="If any errors happened when processing this task, the list of errors identifiers", alias="errorHistory") + is_cancellable: Optional[StrictBool] = Field(default=None, description="Whether the task can be canceled by the user. Only `true` when the task is in `created` state (waiting to be processed). ", alias="isCancellable") + children: Optional[List[Task]] = Field(default=None, description="Child tasks for hierarchical task structures (e.g., conversion subtasks)") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "state", "format", "score", "revision", "progress", "creationDate", "modificationDate", "doneDate", "result", "errorHistory", "isCancellable", "children"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['created', 'blocked', 'doing', 'done', 'canceled', 'error']): + raise ValueError("must be one of enum values ('created', 'blocked', 'doing', 'done', 'canceled', 'error')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Task from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "is_cancellable", + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of progress + if self.progress: + _dict['progress'] = self.progress.to_dict() + # override the default output from pydantic by calling `to_dict()` of result + if self.result: + _dict['result'] = self.result.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in children (list) + _items = [] + if self.children: + for _item_children in self.children: + if _item_children: + _items.append(_item_children.to_dict()) + _dict['children'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Task from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "state": obj.get("state"), + "format": obj.get("format"), + "score": obj.get("score"), + "revision": obj.get("revision"), + "progress": TaskProgress.from_dict(obj["progress"]) if obj.get("progress") is not None else None, + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), + "doneDate": obj.get("doneDate"), + "result": TaskResult.from_dict(obj["result"]) if obj.get("result") is not None else None, + "errorHistory": obj.get("errorHistory"), + "isCancellable": obj.get("isCancellable"), + "children": [Task.from_dict(_item) for _item in obj["children"]] if obj.get("children") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + +# TODO: Rewrite to not use raise_errors +Task.model_rebuild(raise_errors=False) + diff --git a/flat_api/aio/models/task_export_options.py b/flat_api/aio/models/task_export_options.py new file mode 100644 index 0000000..6123a4c --- /dev/null +++ b/flat_api/aio/models/task_export_options.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskExportOptions(BaseModel): + """ + Options for the requested export + """ # noqa: E501 + parts: Optional[List[StrictStr]] = Field(default=None, description="A list of parts to specifically export") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["parts"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskExportOptions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskExportOptions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "parts": obj.get("parts") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/task_progress.py b/flat_api/aio/models/task_progress.py new file mode 100644 index 0000000..31f88f5 --- /dev/null +++ b/flat_api/aio/models/task_progress.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskProgress(BaseModel): + """ + Details about the task progression + """ # noqa: E501 + percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percent of the task progression") + text: Optional[StrictStr] = Field(default=None, description="Text details of the task progress") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["percent", "text"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskProgress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskProgress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "percent": obj.get("percent"), + "text": obj.get("text") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/task_result.py b/flat_api/aio/models/task_result.py new file mode 100644 index 0000000..99fca4b --- /dev/null +++ b/flat_api/aio/models/task_result.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class TaskResult(BaseModel): + """ + Optional result information about this task + """ # noqa: E501 + url: Optional[StrictStr] = Field(default=None, description="URL returned by the task worker") + error: Optional[StrictStr] = Field(default=None, description="Error returned by task worker") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["url", "error"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TaskResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TaskResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url"), + "error": obj.get("error") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/teaching_theme.py b/flat_api/aio/models/teaching_theme.py new file mode 100644 index 0000000..5f15cc9 --- /dev/null +++ b/flat_api/aio/models/teaching_theme.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TeachingTheme(str, Enum): + """ + Teaching theme + """ + + """ + allowed enum values + """ + COMPOSITION = 'composition' + MUSIC_MINUS_THEORY = 'music-theory' + GENERAL_MINUS_MUSIC = 'general-music' + BAND = 'band' + CHOIR = 'choir' + ORCHESTRA = 'orchestra' + JAZZ_MINUS_ENSEMBLE = 'jazz-ensemble' + MUSIC_MINUS_TECHNOLOGY = 'music-technology' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TeachingTheme from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/tutteo_product.py b/flat_api/aio/models/tutteo_product.py new file mode 100644 index 0000000..b40d500 --- /dev/null +++ b/flat_api/aio/models/tutteo_product.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TutteoProduct(str, Enum): + """ + A Tutteo product. * `flat`: [Flat](https://flat.io) - Music notation software for individual users * `flatEdu`: [Flat for Education](https://flat.io/edu) - Music notation software for schools and educators * `msnippet`: [Music Snippet](https://musicsnippet.com) - Embeddable music snippets for websites * `embed`: [Flat Embed](https://flat.io/developers/embed) - Embeddable music notation editor + """ + + """ + allowed enum values + """ + FLAT = 'flat' + FLATEDU = 'flatEdu' + MSNIPPET = 'msnippet' + EMBED = 'embed' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TutteoProduct from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/aio/models/user_admin_update.py b/flat_api/aio/models/user_admin_update.py new file mode 100644 index 0000000..01ee625 --- /dev/null +++ b/flat_api/aio/models/user_admin_update.py @@ -0,0 +1,114 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.aio.models.organization_roles import OrganizationRoles +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserAdminUpdate(BaseModel): + """ + User update as an organization admin + """ # noqa: E501 + password: Optional[Annotated[str, Field(min_length=6, strict=True, max_length=1000)]] = Field(default=None, description="Password of the account") + organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") + username: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=30)]] = Field(default=None, description="Username of the account") + firstname: Optional[Annotated[str, Field(strict=True, max_length=60)]] = Field(default=None, description="First name of the user") + lastname: Optional[Annotated[str, Field(strict=True, max_length=60)]] = Field(default=None, description="Last name of the user") + email: Optional[StrictStr] = Field(default=None, description="Email of the account") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["password", "organizationRole", "username", "firstname", "lastname", "email"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserAdminUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserAdminUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "password": obj.get("password"), + "organizationRole": obj.get("organizationRole"), + "username": obj.get("username"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "email": obj.get("email") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_azure_details.py b/flat_api/aio/models/user_azure_details.py new file mode 100644 index 0000000..abb6bfc --- /dev/null +++ b/flat_api/aio/models/user_azure_details.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserAzureDetails(BaseModel): + """ + UserAzureDetails + """ # noqa: E501 + oid: Optional[StrictStr] = Field(default=None, description="User object identifier on Azure AD") + hd: Optional[StrictStr] = Field(default=None, description="User tenant (domain name)") + preferred_username: Optional[StrictStr] = Field(default=None, description="User Preferred Username (UPN), i.e. the main email of the user", alias="preferredUsername") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["oid", "hd", "preferredUsername"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserAzureDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserAzureDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "oid": obj.get("oid"), + "hd": obj.get("hd"), + "preferredUsername": obj.get("preferredUsername") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_basics.py b/flat_api/aio/models/user_basics.py new file mode 100644 index 0000000..41735c6 --- /dev/null +++ b/flat_api/aio/models/user_basics.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.tutteo_product import TutteoProduct +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserBasics(BaseModel): + """ + UserBasics + """ # noqa: E501 + id: StrictStr = Field(description="The user unique identifier") + type: StrictStr = Field(description="The type of user account") + product: TutteoProduct + username: StrictStr = Field(description="The user name (unique for the organization)") + printable_name: Optional[StrictStr] = Field(default=None, description="The name that can be directly printed (name, firstname & lastname, or username)", alias="printableName") + firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") + lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") + name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") + picture: Optional[StrictStr] = Field(description="The URL of the picture to display") + badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['user', 'guest']): + raise ValueError("must be one of enum values ('user', 'guest')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserBasics from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if picture (nullable) is None + # and model_fields_set contains the field + if self.picture is None and "picture" in self.model_fields_set: + _dict['picture'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserBasics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, + "username": obj.get("username"), + "printableName": obj.get("printableName"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "name": obj.get("name"), + "picture": obj.get("picture"), + "badges": obj.get("badges") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_community_profile_links.py b/flat_api/aio/models/user_community_profile_links.py new file mode 100644 index 0000000..c281a56 --- /dev/null +++ b/flat_api/aio/models/user_community_profile_links.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserCommunityProfileLinks(BaseModel): + """ + Social networks links + """ # noqa: E501 + spotify_url: Optional[StrictStr] = Field(default=None, description="Spotify Profile URL", alias="spotifyUrl") + youtube_url: Optional[StrictStr] = Field(default=None, description="YouTube channel URL", alias="youtubeUrl") + soundcloud_url: Optional[StrictStr] = Field(default=None, description="SoundCloud Profile URL", alias="soundcloudUrl") + tiktok_url: Optional[StrictStr] = Field(default=None, description="TikTok profile URL. For updates, also accepts TikTok usernames", alias="tiktokUrl") + instagram_url: Optional[StrictStr] = Field(default=None, description="Instagram profile URL. For updates, also accepts Instagram usernames", alias="instagramUrl") + website_url: Optional[StrictStr] = Field(default=None, description="Personnal website URL", alias="websiteUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["spotifyUrl", "youtubeUrl", "soundcloudUrl", "tiktokUrl", "instagramUrl", "websiteUrl"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserCommunityProfileLinks from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if spotify_url (nullable) is None + # and model_fields_set contains the field + if self.spotify_url is None and "spotify_url" in self.model_fields_set: + _dict['spotifyUrl'] = None + + # set to None if youtube_url (nullable) is None + # and model_fields_set contains the field + if self.youtube_url is None and "youtube_url" in self.model_fields_set: + _dict['youtubeUrl'] = None + + # set to None if soundcloud_url (nullable) is None + # and model_fields_set contains the field + if self.soundcloud_url is None and "soundcloud_url" in self.model_fields_set: + _dict['soundcloudUrl'] = None + + # set to None if tiktok_url (nullable) is None + # and model_fields_set contains the field + if self.tiktok_url is None and "tiktok_url" in self.model_fields_set: + _dict['tiktokUrl'] = None + + # set to None if instagram_url (nullable) is None + # and model_fields_set contains the field + if self.instagram_url is None and "instagram_url" in self.model_fields_set: + _dict['instagramUrl'] = None + + # set to None if website_url (nullable) is None + # and model_fields_set contains the field + if self.website_url is None and "website_url" in self.model_fields_set: + _dict['websiteUrl'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserCommunityProfileLinks from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "spotifyUrl": obj.get("spotifyUrl"), + "youtubeUrl": obj.get("youtubeUrl"), + "soundcloudUrl": obj.get("soundcloudUrl"), + "tiktokUrl": obj.get("tiktokUrl"), + "instagramUrl": obj.get("instagramUrl"), + "websiteUrl": obj.get("websiteUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_creation.py b/flat_api/aio/models/user_creation.py new file mode 100644 index 0000000..fa407a7 --- /dev/null +++ b/flat_api/aio/models/user_creation.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserCreation(BaseModel): + """ + User creation + """ # noqa: E501 + username: Annotated[str, Field(min_length=1, strict=True, max_length=30)] = Field(description="Username of the new account") + firstname: Optional[Annotated[str, Field(strict=True, max_length=60)]] = Field(default=None, description="First name of the user") + lastname: Optional[Annotated[str, Field(strict=True, max_length=60)]] = Field(default=None, description="Last name of the user") + email: Optional[StrictStr] = Field(default=None, description="Email of the new account") + password: Annotated[str, Field(min_length=6, strict=True, max_length=1000)] = Field(description="Password of the new account") + locale: Optional[StrictStr] = Field(default='en', description="User language. Input values will be automatically normalized to a supported locale code.") + role: Optional[StrictStr] = Field(default='user', description="Role of the new account") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["username", "firstname", "lastname", "email", "password", "locale", "role"] + + @field_validator('role') + def role_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['user', 'teacher', 'admin', 'accountAdmin']): + raise ValueError("must be one of enum values ('user', 'teacher', 'admin', 'accountAdmin')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "username": obj.get("username"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "email": obj.get("email"), + "password": obj.get("password"), + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "role": obj.get("role") if obj.get("role") is not None else 'user' + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_details.py b/flat_api/aio/models/user_details.py new file mode 100644 index 0000000..5659c0e --- /dev/null +++ b/flat_api/aio/models/user_details.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.class_roles import ClassRoles +from flat_api.aio.models.organization_roles import OrganizationRoles +from flat_api.aio.models.tutteo_product import TutteoProduct +from flat_api.aio.models.user_azure_details import UserAzureDetails +from flat_api.aio.models.user_community_profile_links import UserCommunityProfileLinks +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserDetails(BaseModel): + """ + User details + """ # noqa: E501 + id: StrictStr = Field(description="The user unique identifier") + type: StrictStr = Field(description="The type of user account") + product: TutteoProduct + username: StrictStr = Field(description="The user name (unique for the organization)") + printable_name: Optional[StrictStr] = Field(default=None, description="The name that can be directly printed (name, firstname & lastname, or username)", alias="printableName") + firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") + lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") + name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") + picture: StrictStr = Field(description="The URL of the picture to display") + badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") + organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") + organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") + class_role: Optional[ClassRoles] = Field(default=None, alias="classRole") + html_url: Optional[StrictStr] = Field(default=None, description="Link to user profile (for Indiv. users only)", alias="htmlUrl") + bio: Optional[StrictStr] = Field(default=None, description="User's biography") + registration_date: Optional[datetime] = Field(default=None, description="Date the user signed up", alias="registrationDate") + liked_scores_count: Optional[StrictInt] = Field(default=None, description="Number of the scores liked by the user", alias="likedScoresCount") + followers_count: Optional[StrictInt] = Field(default=None, description="Number of followers the user have", alias="followersCount") + following_count: Optional[StrictInt] = Field(default=None, description="Number of people the user follow", alias="followingCount") + owned_public_scores_count: Optional[StrictInt] = Field(default=None, description="Number of public scores the user have", alias="ownedPublicScoresCount") + all_public_scores_count: Optional[StrictInt] = Field(default=None, description="Total number of public scores the user participates in (owned + joined)", alias="allPublicScoresCount") + likes_count: Optional[StrictInt] = Field(default=None, description="Number of likes on the user published scores", alias="likesCount") + plays_count: Optional[StrictInt] = Field(default=None, description="Number of plays on the user published scores", alias="playsCount") + cover_picture: Optional[StrictStr] = Field(default=None, description="Cover picture (backgroud) for the profile", alias="coverPicture") + profile_theme: Optional[StrictStr] = Field(default=None, description="Theme (background) for the profile", alias="profileTheme") + links: Optional[UserCommunityProfileLinks] = None + is_email_verified: Optional[StrictBool] = Field(default=None, description="Whether the user's email address has been verified", alias="isEmailVerified") + azure_details: Optional[UserAzureDetails] = Field(default=None, alias="azureDetails") + private_profile: Optional[StrictBool] = Field(default=None, description="Tell either this user profile is private or not (individual accounts only)", alias="privateProfile") + locale: Optional[StrictStr] = Field(default='en', description="The user language. Input values will be automatically normalized to a supported locale code. Unknown locales will default to `en`. Current supported locales include: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ja-HIRA`, `ko`, `ms`, `nb`, `nl`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW` ") + groups: Optional[List[StrictStr]] = Field(default=None, description="For Flat for Education accounts, list of Group identifiers the user is part of.") + picture_file: Optional[StrictStr] = Field(default=None, description="The ID of the user profile picture", alias="pictureFile") + cover_picture_file: Optional[StrictStr] = Field(default=None, description="The ID of the user profile cover picture", alias="coverPictureFile") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "bio", "registrationDate", "likedScoresCount", "followersCount", "followingCount", "ownedPublicScoresCount", "allPublicScoresCount", "likesCount", "playsCount", "coverPicture", "profileTheme", "links", "isEmailVerified", "azureDetails", "privateProfile", "locale", "groups", "pictureFile", "coverPictureFile"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['user', 'guest']): + raise ValueError("must be one of enum values ('user', 'guest')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['links'] = self.links.to_dict() + # override the default output from pydantic by calling `to_dict()` of azure_details + if self.azure_details: + _dict['azureDetails'] = self.azure_details.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if picture_file (nullable) is None + # and model_fields_set contains the field + if self.picture_file is None and "picture_file" in self.model_fields_set: + _dict['pictureFile'] = None + + # set to None if cover_picture_file (nullable) is None + # and model_fields_set contains the field + if self.cover_picture_file is None and "cover_picture_file" in self.model_fields_set: + _dict['coverPictureFile'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, + "username": obj.get("username"), + "printableName": obj.get("printableName"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "name": obj.get("name"), + "picture": obj.get("picture"), + "badges": obj.get("badges"), + "organization": obj.get("organization"), + "organizationRole": obj.get("organizationRole"), + "classRole": obj.get("classRole"), + "htmlUrl": obj.get("htmlUrl"), + "bio": obj.get("bio"), + "registrationDate": obj.get("registrationDate"), + "likedScoresCount": obj.get("likedScoresCount"), + "followersCount": obj.get("followersCount"), + "followingCount": obj.get("followingCount"), + "ownedPublicScoresCount": obj.get("ownedPublicScoresCount"), + "allPublicScoresCount": obj.get("allPublicScoresCount"), + "likesCount": obj.get("likesCount"), + "playsCount": obj.get("playsCount"), + "coverPicture": obj.get("coverPicture"), + "profileTheme": obj.get("profileTheme"), + "links": UserCommunityProfileLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, + "isEmailVerified": obj.get("isEmailVerified"), + "azureDetails": UserAzureDetails.from_dict(obj["azureDetails"]) if obj.get("azureDetails") is not None else None, + "privateProfile": obj.get("privateProfile"), + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', + "groups": obj.get("groups"), + "pictureFile": obj.get("pictureFile"), + "coverPictureFile": obj.get("coverPictureFile") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_details_admin.py b/flat_api/aio/models/user_details_admin.py new file mode 100644 index 0000000..92e5b8e --- /dev/null +++ b/flat_api/aio/models/user_details_admin.py @@ -0,0 +1,153 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.class_roles import ClassRoles +from flat_api.aio.models.organization_roles import OrganizationRoles +from flat_api.aio.models.tutteo_product import TutteoProduct +from flat_api.aio.models.user_details_admin_all_of_license import UserDetailsAdminAllOfLicense +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserDetailsAdmin(BaseModel): + """ + User details (view for organization teacher / admin) + """ # noqa: E501 + id: StrictStr = Field(description="The user unique identifier") + type: StrictStr = Field(description="The type of user account") + product: TutteoProduct + username: StrictStr = Field(description="The user name (unique for the organization)") + printable_name: Optional[StrictStr] = Field(default=None, description="The name that can be directly printed (name, firstname & lastname, or username)", alias="printableName") + firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") + lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") + name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") + picture: StrictStr = Field(description="The URL of the picture to display") + badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") + organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") + organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") + class_role: Optional[ClassRoles] = Field(default=None, alias="classRole") + html_url: Optional[StrictStr] = Field(default=None, description="Link to user profile (for Indiv. users only)", alias="htmlUrl") + email: Optional[StrictStr] = Field(default=None, description="Email of the user") + last_activity_date: Optional[datetime] = Field(default=None, description="Date of the last user activity", alias="lastActivityDate") + license: Optional[UserDetailsAdminAllOfLicense] = None + groups: Optional[List[StrictStr]] = Field(default=None, description="For Flat for Education accounts, list of Group identifiers the user is part of.") + is_edu_testing_student: Optional[StrictBool] = Field(default=None, description="Indicates if the user account is marked as a testing student account. Testing students are typically excluded from certain educational integrations and workflows. This field helps API clients distinguish between regular students and testing accounts. ", alias="isEduTestingStudent") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "email", "lastActivityDate", "license", "groups", "isEduTestingStudent"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['user', 'guest']): + raise ValueError("must be one of enum values ('user', 'guest')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserDetailsAdmin from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of license + if self.license: + _dict['license'] = self.license.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserDetailsAdmin from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, + "username": obj.get("username"), + "printableName": obj.get("printableName"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "name": obj.get("name"), + "picture": obj.get("picture"), + "badges": obj.get("badges"), + "organization": obj.get("organization"), + "organizationRole": obj.get("organizationRole"), + "classRole": obj.get("classRole"), + "htmlUrl": obj.get("htmlUrl"), + "email": obj.get("email"), + "lastActivityDate": obj.get("lastActivityDate"), + "license": UserDetailsAdminAllOfLicense.from_dict(obj["license"]) if obj.get("license") is not None else None, + "groups": obj.get("groups"), + "isEduTestingStudent": obj.get("isEduTestingStudent") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_details_admin_all_of_license.py b/flat_api/aio/models/user_details_admin_all_of_license.py new file mode 100644 index 0000000..ccc7e77 --- /dev/null +++ b/flat_api/aio/models/user_details_admin_all_of_license.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.license_mode import LicenseMode +from flat_api.aio.models.license_sources import LicenseSources +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserDetailsAdminAllOfLicense(BaseModel): + """ + Current active license of the user + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="ID of the current license") + expiration_date: Optional[datetime] = Field(default=None, description="Date when the license expires", alias="expirationDate") + source: Optional[LicenseSources] = LicenseSources.ORDER + mode: Optional[LicenseMode] = None + active: Optional[StrictBool] = Field(default=None, description="ID of the current license") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "expirationDate", "source", "mode", "active"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserDetailsAdminAllOfLicense from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserDetailsAdminAllOfLicense from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "expirationDate": obj.get("expirationDate"), + "source": obj.get("source") if obj.get("source") is not None else LicenseSources.ORDER, + "mode": obj.get("mode"), + "active": obj.get("active") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_public.py b/flat_api/aio/models/user_public.py new file mode 100644 index 0000000..a9c96a0 --- /dev/null +++ b/flat_api/aio/models/user_public.py @@ -0,0 +1,172 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.class_roles import ClassRoles +from flat_api.aio.models.organization_roles import OrganizationRoles +from flat_api.aio.models.tutteo_product import TutteoProduct +from flat_api.aio.models.user_community_profile_links import UserCommunityProfileLinks +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserPublic(BaseModel): + """ + Public User details + """ # noqa: E501 + id: StrictStr = Field(description="The user unique identifier") + type: StrictStr = Field(description="The type of user account") + product: TutteoProduct + username: StrictStr = Field(description="The user name (unique for the organization)") + printable_name: Optional[StrictStr] = Field(default=None, description="The name that can be directly printed (name, firstname & lastname, or username)", alias="printableName") + firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") + lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") + name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") + picture: StrictStr = Field(description="The URL of the picture to display") + badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") + organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") + organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") + class_role: Optional[ClassRoles] = Field(default=None, alias="classRole") + html_url: Optional[StrictStr] = Field(default=None, description="Link to user profile (for Indiv. users only)", alias="htmlUrl") + bio: Optional[StrictStr] = Field(default=None, description="User's biography") + registration_date: Optional[datetime] = Field(default=None, description="Date the user signed up", alias="registrationDate") + liked_scores_count: Optional[StrictInt] = Field(default=None, description="Number of the scores liked by the user", alias="likedScoresCount") + followers_count: Optional[StrictInt] = Field(default=None, description="Number of followers the user have", alias="followersCount") + following_count: Optional[StrictInt] = Field(default=None, description="Number of people the user follow", alias="followingCount") + owned_public_scores_count: Optional[StrictInt] = Field(default=None, description="Number of public scores the user have", alias="ownedPublicScoresCount") + all_public_scores_count: Optional[StrictInt] = Field(default=None, description="Total number of public scores the user participates in (owned + joined)", alias="allPublicScoresCount") + likes_count: Optional[StrictInt] = Field(default=None, description="Number of likes on the user published scores", alias="likesCount") + plays_count: Optional[StrictInt] = Field(default=None, description="Number of plays on the user published scores", alias="playsCount") + cover_picture: Optional[StrictStr] = Field(default=None, description="Cover picture (backgroud) for the profile", alias="coverPicture") + profile_theme: Optional[StrictStr] = Field(default=None, description="Theme (background) for the profile", alias="profileTheme") + links: Optional[UserCommunityProfileLinks] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "bio", "registrationDate", "likedScoresCount", "followersCount", "followingCount", "ownedPublicScoresCount", "allPublicScoresCount", "likesCount", "playsCount", "coverPicture", "profileTheme", "links"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['user', 'guest']): + raise ValueError("must be one of enum values ('user', 'guest')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserPublic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of links + if self.links: + _dict['links'] = self.links.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if cover_picture (nullable) is None + # and model_fields_set contains the field + if self.cover_picture is None and "cover_picture" in self.model_fields_set: + _dict['coverPicture'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserPublic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, + "username": obj.get("username"), + "printableName": obj.get("printableName"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "name": obj.get("name"), + "picture": obj.get("picture"), + "badges": obj.get("badges"), + "organization": obj.get("organization"), + "organizationRole": obj.get("organizationRole"), + "classRole": obj.get("classRole"), + "htmlUrl": obj.get("htmlUrl"), + "bio": obj.get("bio"), + "registrationDate": obj.get("registrationDate"), + "likedScoresCount": obj.get("likedScoresCount"), + "followersCount": obj.get("followersCount"), + "followingCount": obj.get("followingCount"), + "ownedPublicScoresCount": obj.get("ownedPublicScoresCount"), + "allPublicScoresCount": obj.get("allPublicScoresCount"), + "likesCount": obj.get("likesCount"), + "playsCount": obj.get("playsCount"), + "coverPicture": obj.get("coverPicture"), + "profileTheme": obj.get("profileTheme"), + "links": UserCommunityProfileLinks.from_dict(obj["links"]) if obj.get("links") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_public_summary.py b/flat_api/aio/models/user_public_summary.py new file mode 100644 index 0000000..684fd74 --- /dev/null +++ b/flat_api/aio/models/user_public_summary.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.aio.models.class_roles import ClassRoles +from flat_api.aio.models.organization_roles import OrganizationRoles +from flat_api.aio.models.tutteo_product import TutteoProduct +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserPublicSummary(BaseModel): + """ + Public User details summary + """ # noqa: E501 + id: StrictStr = Field(description="The user unique identifier") + type: StrictStr = Field(description="The type of user account") + product: TutteoProduct + username: StrictStr = Field(description="The user name (unique for the organization)") + printable_name: Optional[StrictStr] = Field(default=None, description="The name that can be directly printed (name, firstname & lastname, or username)", alias="printableName") + firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") + lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") + name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") + picture: StrictStr = Field(description="The URL of the picture to display") + badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") + organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") + organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") + class_role: Optional[ClassRoles] = Field(default=None, alias="classRole") + html_url: Optional[StrictStr] = Field(default=None, description="Link to user profile (for Indiv. users only)", alias="htmlUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['user', 'guest']): + raise ValueError("must be one of enum values ('user', 'guest')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserPublicSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserPublicSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, + "username": obj.get("username"), + "printableName": obj.get("printableName"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "name": obj.get("name"), + "picture": obj.get("picture"), + "badges": obj.get("badges"), + "organization": obj.get("organization"), + "organizationRole": obj.get("organizationRole"), + "classRole": obj.get("classRole"), + "htmlUrl": obj.get("htmlUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_signin_link.py b/flat_api/aio/models/user_signin_link.py new file mode 100644 index 0000000..72e0254 --- /dev/null +++ b/flat_api/aio/models/user_signin_link.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserSigninLink(BaseModel): + """ + UserSigninLink + """ # noqa: E501 + url: Optional[StrictStr] = Field(default=None, description="URL to use to sign in to this account") + token: Optional[StrictStr] = Field(default=None, description="Raw sign-in token, can be used to build custom URLs (e.g. deep links)") + expiration_date: Optional[datetime] = Field(default=None, description="Date when the link expires", alias="expirationDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["url", "token", "expirationDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserSigninLink from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserSigninLink from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "url": obj.get("url"), + "token": obj.get("token"), + "expirationDate": obj.get("expirationDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/models/user_signin_link_creation.py b/flat_api/aio/models/user_signin_link_creation.py new file mode 100644 index 0000000..2fbeb9d --- /dev/null +++ b/flat_api/aio/models/user_signin_link_creation.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserSigninLinkCreation(BaseModel): + """ + UserSigninLinkCreation + """ # noqa: E501 + destination_path: Optional[StrictStr] = Field(default='/', description="Path to redirect to after signin", alias="destinationPath") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["destinationPath"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserSigninLinkCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserSigninLinkCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "destinationPath": obj.get("destinationPath") if obj.get("destinationPath") is not None else '/' + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/aio/rest.py b/flat_api/aio/rest.py new file mode 100644 index 0000000..34e99a1 --- /dev/null +++ b/flat_api/aio/rest.py @@ -0,0 +1,264 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import io +import json +import re +import ssl +from typing import Any, Dict, Optional, Union + +import aiohttp +import aiohttp_retry + +from flat_api.aio.exceptions import ApiException, ApiValueError + +RESTResponseType = aiohttp.ClientResponse + +ALLOW_RETRY_METHODS = frozenset({'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PUT', 'TRACE'}) + +class RESTResponse(io.IOBase): + + def __init__(self, resp) -> None: + self.response = resp + self.status = resp.status + self.reason = resp.reason + self.data = None + + async def read(self): + if self.data is None: + self.data = await self.response.read() + return self.data + + @property + def headers(self): + """Returns a CIMultiDictProxy of response headers.""" + return self.response.headers + + def getheaders(self): + """Returns a CIMultiDictProxy of the response headers; use ``headers`` instead.""" + return self.response.headers + + def getheader(self, name, default=None): + """Returns a given response header; use ``headers.get()`` instead.""" + return self.response.headers.get(name, default) + + +class RESTClientObject: + + def __init__(self, configuration) -> None: + + # Keep a reference so factory methods (_create_pool_manager / _create_connector) + # and subclasses can read extension fields like trace_configs. + self.configuration = configuration + + # maxsize is number of requests to host that are allowed in parallel + self.maxsize = configuration.connection_pool_maxsize + + self.ssl_context = ssl.create_default_context( + cafile=configuration.ssl_ca_cert, + cadata=configuration.ca_cert_data, + ) + if configuration.cert_file: + self.ssl_context.load_cert_chain( + configuration.cert_file, keyfile=configuration.key_file + ) + + if not configuration.verify_ssl: + self.ssl_context.check_hostname = False + self.ssl_context.verify_mode = ssl.CERT_NONE + + self.proxy = configuration.proxy + self.proxy_headers = configuration.proxy_headers + + retries = configuration.retries + if retries is None: + self._effective_retry_options = None + elif isinstance(retries, aiohttp_retry.RetryOptionsBase): + self._effective_retry_options = retries + elif isinstance(retries, int): + self._effective_retry_options = aiohttp_retry.ExponentialRetry( + attempts=retries, + factor=2.0, + start_timeout=0.1, + max_timeout=120.0 + ) + else: + self._effective_retry_options = None + + self.pool_manager: Optional[aiohttp.ClientSession] = None + self.retry_client: Optional[aiohttp_retry.RetryClient] = None + + async def close(self) -> None: + if self.pool_manager: + await self.pool_manager.close() + if self.retry_client is not None: + await self.retry_client.close() + + def _create_connector(self) -> aiohttp.TCPConnector: + """Build the TCPConnector used by the ClientSession. + + Override in a subclass to customize DNS resolver, keepalive, etc. + """ + kwargs: Dict[str, Any] = { + "limit": self.maxsize, + "ssl": self.ssl_context, + } + limit_per_host = getattr(self.configuration, "tcp_connector_limit_per_host", None) + if limit_per_host is not None: + kwargs["limit_per_host"] = limit_per_host + return aiohttp.TCPConnector(**kwargs) + + def _create_pool_manager(self) -> aiohttp.ClientSession: + """Build the aiohttp.ClientSession used as the connection pool. + + Override in a subclass to fully customize the session (e.g. attach + aiohttp.TraceConfig, swap json_serialize, etc.). Typed Configuration + fields (trace_configs / client_session_kwargs) are read via getattr + so older Configuration objects remain compatible. + """ + extra = getattr(self.configuration, "client_session_kwargs", None) + kwargs: Dict[str, Any] = { + "connector": self._create_connector(), + "trust_env": True, + } + trace_configs = getattr(self.configuration, "trace_configs", None) + if trace_configs is not None: + kwargs["trace_configs"] = trace_configs + if extra: + kwargs.update(extra) + return aiohttp.ClientSession(**kwargs) + + async def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): + """Execute request + + :param method: http request method + :param url: http request url + :param headers: http request headers + :param body: request json body, for `application/json` + :param post_params: request post parameters, + `application/x-www-form-urlencoded` + and `multipart/form-data` + :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. + """ + method = method.upper() + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] + + if post_params and body: + raise ApiValueError( + "body parameter cannot be used with post_params parameter." + ) + + post_params = post_params or {} + headers = headers or {} + # url already contains the URL query string + timeout = _request_timeout or 5 * 60 + + if 'Content-Type' not in headers: + headers['Content-Type'] = 'application/json' + + args = { + "method": method, + "url": url, + "timeout": timeout, + "headers": headers + } + + if self.proxy: + args["proxy"] = self.proxy + if self.proxy_headers: + args["proxy_headers"] = self.proxy_headers + + # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` + if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: + if re.search('json', headers['Content-Type'], re.IGNORECASE): + if body is not None: + body = json.dumps(body) + if body is None and post_params: + body = json.dumps(dict(post_params)) + args["data"] = body + elif headers['Content-Type'] == 'application/x-www-form-urlencoded': + args["data"] = aiohttp.FormData(post_params) + elif headers['Content-Type'] == 'multipart/form-data': + # must del headers['Content-Type'], or the correct + # Content-Type which generated by aiohttp + del headers['Content-Type'] + data = aiohttp.FormData() + for param in post_params: + k, v = param + if isinstance(v, tuple) and len(v) == 3: + data.add_field( + k, + value=v[1], + filename=v[0], + content_type=v[2] + ) + else: + # Ensures that dict objects are serialized + if isinstance(v, dict): + v = json.dumps(v) + elif isinstance(v, int): + v = str(v) + data.add_field(k, v) + args["data"] = data + + # Pass a `bytes` or `str` parameter directly in the body to support + # other content types than Json when `body` argument is provided + # in serialized form + elif isinstance(body, str) or isinstance(body, bytes): + args["data"] = body + else: + # Cannot generate the request from given parameters + msg = """Cannot prepare a request message for provided + arguments. Please check that your arguments match + declared content type.""" + raise ApiException(status=0, reason=msg) + + pool_manager: Union[aiohttp.ClientSession, aiohttp_retry.RetryClient] + + # https pool manager + if self.pool_manager is None: + self.pool_manager = self._create_pool_manager() + pool_manager = self.pool_manager + + if self._effective_retry_options is not None and method in ALLOW_RETRY_METHODS: + if self.retry_client is None: + self.retry_client = aiohttp_retry.RetryClient( + client_session=self.pool_manager, + retry_options=self._effective_retry_options + ) + pool_manager = self.retry_client + + r = await pool_manager.request(**args) + + return RESTResponse(r) diff --git a/flat_api/api/__init__.py b/flat_api/api/__init__.py index 7255250..c244aae 100644 --- a/flat_api/api/__init__.py +++ b/flat_api/api/__init__.py @@ -6,6 +6,7 @@ from flat_api.api.collection_api import CollectionApi from flat_api.api.edu_resources_api import EduResourcesApi from flat_api.api.group_api import GroupApi +from flat_api.api.omr_api import OMRApi from flat_api.api.organization_api import OrganizationApi from flat_api.api.score_api import ScoreApi from flat_api.api.task_api import TaskApi diff --git a/flat_api/api/account_api.py b/flat_api/api/account_api.py index e7219d7..a604311 100644 --- a/flat_api/api/account_api.py +++ b/flat_api/api/account_api.py @@ -1,17 +1,16 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -95,6 +94,7 @@ def get_authenticated_user( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -162,6 +162,7 @@ def get_authenticated_user_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -229,6 +230,7 @@ def get_authenticated_user_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -255,7 +257,9 @@ def _get_authenticated_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -270,11 +274,12 @@ def _get_authenticated_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/flat_api/api/class_api.py b/flat_api/api/class_api.py index b8cc018..5221273 100644 --- a/flat_api/api/class_api.py +++ b/flat_api/api/class_api.py @@ -1,24 +1,23 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, field_validator -from typing import Optional +from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator +from typing import List, Optional, Tuple, Union from typing_extensions import Annotated from flat_api.models.assignment import Assignment from flat_api.models.assignment_copy import AssignmentCopy @@ -108,6 +107,7 @@ def activate_class( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -175,6 +175,7 @@ def activate_class_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -242,6 +243,7 @@ def activate_class_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -268,7 +270,9 @@ def _activate_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -281,11 +285,12 @@ def _activate_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -370,6 +375,7 @@ def add_class_user( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -441,6 +447,7 @@ def add_class_user_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -512,6 +519,7 @@ def add_class_user_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -539,7 +547,9 @@ def _add_class_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -554,11 +564,12 @@ def _add_class_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -643,6 +654,7 @@ def archive_assignment( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -714,6 +726,7 @@ def archive_assignment_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -785,6 +798,7 @@ def archive_assignment_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -812,7 +826,9 @@ def _archive_assignment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -827,11 +843,12 @@ def _archive_assignment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -912,6 +929,7 @@ def archive_class( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -979,6 +997,7 @@ def archive_class_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1046,6 +1065,7 @@ def archive_class_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1072,7 +1092,9 @@ def _archive_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1085,11 +1107,12 @@ def _archive_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1178,6 +1201,7 @@ def copy_assignment( _response_types_map: Dict[str, Optional[str]] = { '200': "AssignmentCopyResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1253,6 +1277,7 @@ def copy_assignment_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "AssignmentCopyResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1328,6 +1353,7 @@ def copy_assignment_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "AssignmentCopyResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1356,7 +1382,9 @@ def _copy_assignment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1373,11 +1401,12 @@ def _copy_assignment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1472,6 +1501,7 @@ def create_class( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1540,6 +1570,7 @@ def create_class_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1608,6 +1639,7 @@ def create_class_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1634,7 +1666,9 @@ def _create_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1647,11 +1681,12 @@ def _create_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1749,6 +1784,7 @@ def create_class_assignment( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1820,6 +1856,7 @@ def create_class_assignment_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1891,6 +1928,7 @@ def create_class_assignment_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1918,7 +1956,9 @@ def _create_class_assignment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1933,11 +1973,12 @@ def _create_class_assignment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2039,6 +2080,7 @@ def create_submission( _response_types_map: Dict[str, Optional[str]] = { '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2114,6 +2156,7 @@ def create_submission_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2189,6 +2232,7 @@ def create_submission_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2217,7 +2261,9 @@ def _create_submission_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2234,11 +2280,12 @@ def _create_submission_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2336,6 +2383,7 @@ def create_test_student_account( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2407,6 +2455,7 @@ def create_test_student_account_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2478,6 +2527,7 @@ def create_test_student_account_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2505,7 +2555,9 @@ def _create_test_student_account_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2522,11 +2574,12 @@ def _create_test_student_account_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2553,10 +2606,10 @@ def _create_test_student_account_serialize( @validate_call - def delete_class_user( + def delete_assignment( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2570,14 +2623,14 @@ def delete_class_user( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Remove a user from the class + """Delete an assignment - This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. `archiveAssignment` is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades. :param var_class: Unique identifier of the class (required) :type var_class: str - :param user: Unique identifier of the user (required) - :type user: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str :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 @@ -2600,9 +2653,9 @@ def delete_class_user( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_class_user_serialize( + _param = self._delete_assignment_serialize( var_class=var_class, - user=user, + assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2611,6 +2664,7 @@ def delete_class_user( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2624,10 +2678,10 @@ def delete_class_user( @validate_call - def delete_class_user_with_http_info( + def delete_assignment_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2641,14 +2695,14 @@ def delete_class_user_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Remove a user from the class + """Delete an assignment - This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. `archiveAssignment` is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades. :param var_class: Unique identifier of the class (required) :type var_class: str - :param user: Unique identifier of the user (required) - :type user: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str :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 @@ -2671,9 +2725,9 @@ def delete_class_user_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_class_user_serialize( + _param = self._delete_assignment_serialize( var_class=var_class, - user=user, + assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2682,6 +2736,7 @@ def delete_class_user_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2695,10 +2750,10 @@ def delete_class_user_with_http_info( @validate_call - def delete_class_user_without_preload_content( + def delete_assignment_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2712,14 +2767,14 @@ def delete_class_user_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Remove a user from the class + """Delete an assignment - This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. + Delete an assignment. This cannot be undone, and it removes a good deal more than the assignment itself: every submission made against it, the students' dedicated copies of the attached scores, the related class stream posts and notifications, and the editor toolset. When the class is synchronized with Google Classroom or Microsoft Teams, the assignment is deleted there too. Requires the teacher role on the class, and the class must not be archived. `archiveAssignment` is almost always what you want instead: it takes the assignment out of the class stream and keeps the submissions and their grades. :param var_class: Unique identifier of the class (required) :type var_class: str - :param user: Unique identifier of the user (required) - :type user: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str :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 @@ -2742,9 +2797,9 @@ def delete_class_user_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_class_user_serialize( + _param = self._delete_assignment_serialize( var_class=var_class, - user=user, + assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2753,6 +2808,7 @@ def delete_class_user_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2761,10 +2817,10 @@ def delete_class_user_without_preload_content( return response_data.response - def _delete_class_user_serialize( + def _delete_assignment_serialize( self, var_class, - user, + assignment, _request_auth, _content_type, _headers, @@ -2780,14 +2836,16 @@ def _delete_class_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if var_class is not None: _path_params['class'] = var_class - if user is not None: - _path_params['user'] = user + if assignment is not None: + _path_params['assignment'] = assignment # process the query parameters # process the header parameters # process the form parameters @@ -2795,11 +2853,12 @@ def _delete_class_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2809,7 +2868,7 @@ def _delete_class_user_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/classes/{class}/users/{user}', + resource_path='/classes/{class}/assignments/{assignment}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -2826,11 +2885,10 @@ def _delete_class_user_serialize( @validate_call - def delete_submission( + def delete_class_user( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2843,17 +2901,15 @@ def delete_submission( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AssignmentSubmission: - """Reset a submission + ) -> None: + """Remove a user from the class - Use this method as a teacher to reset a submission and allow student to start over the assignment + This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str + :param user: Unique identifier of the user (required) + :type user: str :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 @@ -2876,10 +2932,9 @@ def delete_submission( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_submission_serialize( + _param = self._delete_class_user_serialize( var_class=var_class, - assignment=assignment, - submission=submission, + user=user, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2887,7 +2942,8 @@ def delete_submission( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2901,11 +2957,10 @@ def delete_submission( @validate_call - def delete_submission_with_http_info( + def delete_class_user_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2918,17 +2973,15 @@ def delete_submission_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AssignmentSubmission]: - """Reset a submission + ) -> ApiResponse[None]: + """Remove a user from the class - Use this method as a teacher to reset a submission and allow student to start over the assignment + This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str + :param user: Unique identifier of the user (required) + :type user: str :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 @@ -2951,10 +3004,9 @@ def delete_submission_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_submission_serialize( + _param = self._delete_class_user_serialize( var_class=var_class, - assignment=assignment, - submission=submission, + user=user, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2962,7 +3014,8 @@ def delete_submission_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2976,11 +3029,10 @@ def delete_submission_with_http_info( @validate_call - def delete_submission_without_preload_content( + def delete_class_user_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2994,16 +3046,14 @@ def delete_submission_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Reset a submission + """Remove a user from the class - Use this method as a teacher to reset a submission and allow student to start over the assignment + This method can be used by a teacher to remove a user from the class, or by a student to leave the classroom. Warning: Removing a user from the class will remove the associated resources, including the submissions and feedback related to these submissions. :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str + :param user: Unique identifier of the user (required) + :type user: str :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 @@ -3026,10 +3076,9 @@ def delete_submission_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_submission_serialize( + _param = self._delete_class_user_serialize( var_class=var_class, - assignment=assignment, - submission=submission, + user=user, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3037,7 +3086,8 @@ def delete_submission_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3046,11 +3096,10 @@ def delete_submission_without_preload_content( return response_data.response - def _delete_submission_serialize( + def _delete_class_user_serialize( self, var_class, - assignment, - submission, + user, _request_auth, _content_type, _headers, @@ -3066,16 +3115,16 @@ def _delete_submission_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if var_class is not None: _path_params['class'] = var_class - if assignment is not None: - _path_params['assignment'] = assignment - if submission is not None: - _path_params['submission'] = submission + if user is not None: + _path_params['user'] = user # process the query parameters # process the header parameters # process the form parameters @@ -3083,11 +3132,12 @@ def _delete_submission_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3097,7 +3147,7 @@ def _delete_submission_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', + resource_path='/classes/{class}/users/{user}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3114,12 +3164,11 @@ def _delete_submission_serialize( @validate_call - def delete_submission_comment( + def delete_submission( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3132,9 +3181,10 @@ def delete_submission_comment( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Delete a feedback comment to a submission + ) -> AssignmentSubmission: + """Reset a submission + Use this method as a teacher to reset a submission and allow student to start over the assignment :param var_class: Unique identifier of the class (required) :type var_class: str @@ -3142,8 +3192,6 @@ def delete_submission_comment( :type assignment: str :param submission: Unique identifier of the submission (required) :type submission: str - :param comment: Unique identifier of the comment (required) - :type comment: str :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 @@ -3166,11 +3214,10 @@ def delete_submission_comment( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_submission_comment_serialize( + _param = self._delete_submission_serialize( var_class=var_class, assignment=assignment, submission=submission, - comment=comment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3178,7 +3225,8 @@ def delete_submission_comment( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3192,12 +3240,11 @@ def delete_submission_comment( @validate_call - def delete_submission_comment_with_http_info( + def delete_submission_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3210,9 +3257,10 @@ def delete_submission_comment_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Delete a feedback comment to a submission + ) -> ApiResponse[AssignmentSubmission]: + """Reset a submission + Use this method as a teacher to reset a submission and allow student to start over the assignment :param var_class: Unique identifier of the class (required) :type var_class: str @@ -3220,8 +3268,6 @@ def delete_submission_comment_with_http_info( :type assignment: str :param submission: Unique identifier of the submission (required) :type submission: str - :param comment: Unique identifier of the comment (required) - :type comment: str :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 @@ -3244,11 +3290,10 @@ def delete_submission_comment_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_submission_comment_serialize( + _param = self._delete_submission_serialize( var_class=var_class, assignment=assignment, submission=submission, - comment=comment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3256,7 +3301,8 @@ def delete_submission_comment_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3270,12 +3316,11 @@ def delete_submission_comment_with_http_info( @validate_call - def delete_submission_comment_without_preload_content( + def delete_submission_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3289,8 +3334,9 @@ def delete_submission_comment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Delete a feedback comment to a submission + """Reset a submission + Use this method as a teacher to reset a submission and allow student to start over the assignment :param var_class: Unique identifier of the class (required) :type var_class: str @@ -3298,8 +3344,6 @@ def delete_submission_comment_without_preload_content( :type assignment: str :param submission: Unique identifier of the submission (required) :type submission: str - :param comment: Unique identifier of the comment (required) - :type comment: str :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 @@ -3322,11 +3366,10 @@ def delete_submission_comment_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._delete_submission_comment_serialize( + _param = self._delete_submission_serialize( var_class=var_class, assignment=assignment, submission=submission, - comment=comment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3334,7 +3377,8 @@ def delete_submission_comment_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3343,12 +3387,11 @@ def delete_submission_comment_without_preload_content( return response_data.response - def _delete_submission_comment_serialize( + def _delete_submission_serialize( self, var_class, assignment, submission, - comment, _request_auth, _content_type, _headers, @@ -3364,7 +3407,9 @@ def _delete_submission_comment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3374,8 +3419,6 @@ def _delete_submission_comment_serialize( _path_params['assignment'] = assignment if submission is not None: _path_params['submission'] = submission - if comment is not None: - _path_params['comment'] = comment # process the query parameters # process the header parameters # process the form parameters @@ -3383,11 +3426,12 @@ def _delete_submission_comment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3397,7 +3441,7 @@ def _delete_submission_comment_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3414,12 +3458,12 @@ def _delete_submission_comment_serialize( @validate_call - def edit_submission( + def delete_submission_comment( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - body: AssignmentSubmissionUpdate, + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3432,10 +3476,9 @@ def edit_submission( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AssignmentSubmission: - """Edit a submission + ) -> None: + """Delete a feedback comment to a submission - Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` :param var_class: Unique identifier of the class (required) :type var_class: str @@ -3443,8 +3486,8 @@ def edit_submission( :type assignment: str :param submission: Unique identifier of the submission (required) :type submission: str - :param body: (required) - :type body: AssignmentSubmissionUpdate + :param comment: Unique identifier of the comment (required) + :type comment: str :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 @@ -3467,11 +3510,11 @@ def edit_submission( :return: Returns the result object. """ # noqa: E501 - _param = self._edit_submission_serialize( + _param = self._delete_submission_comment_serialize( var_class=var_class, assignment=assignment, submission=submission, - body=body, + comment=comment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3479,7 +3522,8 @@ def edit_submission( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3493,12 +3537,12 @@ def edit_submission( @validate_call - def edit_submission_with_http_info( + def delete_submission_comment_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - body: AssignmentSubmissionUpdate, + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3511,10 +3555,9 @@ def edit_submission_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AssignmentSubmission]: - """Edit a submission + ) -> ApiResponse[None]: + """Delete a feedback comment to a submission - Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` :param var_class: Unique identifier of the class (required) :type var_class: str @@ -3522,8 +3565,8 @@ def edit_submission_with_http_info( :type assignment: str :param submission: Unique identifier of the submission (required) :type submission: str - :param body: (required) - :type body: AssignmentSubmissionUpdate + :param comment: Unique identifier of the comment (required) + :type comment: str :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 @@ -3546,11 +3589,11 @@ def edit_submission_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._edit_submission_serialize( + _param = self._delete_submission_comment_serialize( var_class=var_class, assignment=assignment, submission=submission, - body=body, + comment=comment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3558,7 +3601,8 @@ def edit_submission_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3572,12 +3616,12 @@ def edit_submission_with_http_info( @validate_call - def edit_submission_without_preload_content( + def delete_submission_comment_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - body: AssignmentSubmissionUpdate, + comment: Annotated[StrictStr, Field(description="Unique identifier of the comment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3591,9 +3635,8 @@ def edit_submission_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Edit a submission + """Delete a feedback comment to a submission - Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` :param var_class: Unique identifier of the class (required) :type var_class: str @@ -3601,8 +3644,8 @@ def edit_submission_without_preload_content( :type assignment: str :param submission: Unique identifier of the submission (required) :type submission: str - :param body: (required) - :type body: AssignmentSubmissionUpdate + :param comment: Unique identifier of the comment (required) + :type comment: str :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 @@ -3625,11 +3668,11 @@ def edit_submission_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._edit_submission_serialize( + _param = self._delete_submission_comment_serialize( var_class=var_class, assignment=assignment, submission=submission, - body=body, + comment=comment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3637,7 +3680,8 @@ def edit_submission_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3646,12 +3690,12 @@ def edit_submission_without_preload_content( return response_data.response - def _edit_submission_serialize( + def _delete_submission_comment_serialize( self, var_class, assignment, submission, - body, + comment, _request_auth, _content_type, _headers, @@ -3667,7 +3711,9 @@ def _edit_submission_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3677,34 +3723,22 @@ def _edit_submission_serialize( _path_params['assignment'] = assignment if submission is not None: _path_params['submission'] = submission + if comment is not None: + _path_params['comment'] = comment # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if body is not None: - _body_params = body # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + # authentication setting _auth_settings: List[str] = [ @@ -3712,8 +3746,8 @@ def _edit_submission_serialize( ] return self.api_client.param_serialize( - method='PUT', - resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', + method='DELETE', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments/{comment}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3730,9 +3764,12 @@ def _edit_submission_serialize( @validate_call - def enroll_class( + def edit_submission( self, - enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + body: AssignmentSubmissionUpdate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3745,13 +3782,19 @@ def enroll_class( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ClassDetails: - """Join a class + ) -> AssignmentSubmission: + """Edit a submission - Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` - :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) - :type enrollment_code: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param body: (required) + :type body: AssignmentSubmissionUpdate :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 @@ -3774,8 +3817,11 @@ def enroll_class( :return: Returns the result object. """ # noqa: E501 - _param = self._enroll_class_serialize( - enrollment_code=enrollment_code, + _param = self._edit_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3783,7 +3829,8 @@ def enroll_class( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3797,9 +3844,867 @@ def enroll_class( @validate_call - def enroll_class_with_http_info( + def edit_submission_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[AssignmentSubmission]: + """Edit a submission + + Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def edit_submission_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + body: AssignmentSubmissionUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Edit a submission + + Use this method as a teacher to update the different submission and give feedback. Teachers can only set `return`, `draftGrade` and `grade` + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param body: (required) + :type body: AssignmentSubmissionUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._edit_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + body=body, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _edit_submission_serialize( + self, + var_class, + assignment, + submission, + body, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def enroll_class( + self, + enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ClassDetails: + """Join a class + + Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + + :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) + :type enrollment_code: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enroll_class_serialize( + enrollment_code=enrollment_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def enroll_class_with_http_info( + self, + enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ClassDetails]: + """Join a class + + Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + + :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) + :type enrollment_code: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enroll_class_serialize( + enrollment_code=enrollment_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def enroll_class_without_preload_content( + self, + enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Join a class + + Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + + :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) + :type enrollment_code: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._enroll_class_serialize( + enrollment_code=enrollment_code, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ClassDetails", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _enroll_class_serialize( + self, + enrollment_code, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if enrollment_code is not None: + _path_params['enrollmentCode'] = enrollment_code + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/classes/enroll/{enrollmentCode}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def export_submissions_reviews_as_csv( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """CSV Grades exports + + Export list of submissions grades to a CSV file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_csv_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def export_submissions_reviews_as_csv_with_http_info( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """CSV Grades exports + + Export list of submissions grades to a CSV file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_csv_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def export_submissions_reviews_as_csv_without_preload_content( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """CSV Grades exports + + Export list of submissions grades to a CSV file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_csv_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _export_submissions_reviews_as_csv_serialize( + self, + var_class, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'text/csv' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions/csv', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def export_submissions_reviews_as_excel( + self, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Excel Grades exports + + Export list of submissions grades to an Excel file + + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._export_submissions_reviews_as_excel_serialize( + var_class=var_class, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def export_submissions_reviews_as_excel_with_http_info( self, - enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3812,13 +4717,15 @@ def enroll_class_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ClassDetails]: - """Join a class + ) -> ApiResponse[bytes]: + """Excel Grades exports - Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + Export list of submissions grades to an Excel file - :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) - :type enrollment_code: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str :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 @@ -3841,8 +4748,9 @@ def enroll_class_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._enroll_class_serialize( - enrollment_code=enrollment_code, + _param = self._export_submissions_reviews_as_excel_serialize( + var_class=var_class, + assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3850,7 +4758,8 @@ def enroll_class_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "bytes", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3864,9 +4773,10 @@ def enroll_class_with_http_info( @validate_call - def enroll_class_without_preload_content( + def export_submissions_reviews_as_excel_without_preload_content( self, - enrollment_code: Annotated[StrictStr, Field(description="The enrollment code, available to the teacher in `ClassDetails` ")], + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -3880,12 +4790,14 @@ def enroll_class_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Join a class + """Excel Grades exports - Use this method to join a class using an enrollment code given one of the teacher of this class. This code is also available in the `ClassDetails` returned to the teachers when creating the class or listing / fetching a specific class. Flat will automatically add the user to the corresponding class group based on this role in the organization. + Export list of submissions grades to an Excel file - :param enrollment_code: The enrollment code, available to the teacher in `ClassDetails` (required) - :type enrollment_code: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str :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 @@ -3908,8 +4820,9 @@ def enroll_class_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._enroll_class_serialize( - enrollment_code=enrollment_code, + _param = self._export_submissions_reviews_as_excel_serialize( + var_class=var_class, + assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -3917,7 +4830,8 @@ def enroll_class_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "bytes", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3926,9 +4840,10 @@ def enroll_class_without_preload_content( return response_data.response - def _enroll_class_serialize( + def _export_submissions_reviews_as_excel_serialize( self, - enrollment_code, + var_class, + assignment, _request_auth, _content_type, _headers, @@ -3944,12 +4859,16 @@ def _enroll_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters - if enrollment_code is not None: - _path_params['enrollmentCode'] = enrollment_code + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment # process the query parameters # process the header parameters # process the form parameters @@ -3957,11 +4876,12 @@ def _enroll_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' + ] + ) # authentication setting @@ -3970,8 +4890,8 @@ def _enroll_class_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/classes/enroll/{enrollmentCode}', + method='GET', + resource_path='/classes/{class}/assignments/{assignment}/submissions/excel', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -3988,7 +4908,7 @@ def _enroll_class_serialize( @validate_call - def export_submissions_reviews_as_csv( + def get_assignment( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -4004,10 +4924,10 @@ def export_submissions_reviews_as_csv( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> bytearray: - """CSV Grades exports + ) -> Assignment: + """Get an assignment - Export list of submissions grades to a CSV file + Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use `listAssignments` to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, `teacherInstructions` among them. :param var_class: Unique identifier of the class (required) :type var_class: str @@ -4035,7 +4955,7 @@ def export_submissions_reviews_as_csv( :return: Returns the result object. """ # noqa: E501 - _param = self._export_submissions_reviews_as_csv_serialize( + _param = self._get_assignment_serialize( var_class=var_class, assignment=assignment, _request_auth=_request_auth, @@ -4045,7 +4965,8 @@ def export_submissions_reviews_as_csv( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4059,7 +4980,7 @@ def export_submissions_reviews_as_csv( @validate_call - def export_submissions_reviews_as_csv_with_http_info( + def get_assignment_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -4075,10 +4996,10 @@ def export_submissions_reviews_as_csv_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[bytearray]: - """CSV Grades exports + ) -> ApiResponse[Assignment]: + """Get an assignment - Export list of submissions grades to a CSV file + Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use `listAssignments` to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, `teacherInstructions` among them. :param var_class: Unique identifier of the class (required) :type var_class: str @@ -4106,7 +5027,7 @@ def export_submissions_reviews_as_csv_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._export_submissions_reviews_as_csv_serialize( + _param = self._get_assignment_serialize( var_class=var_class, assignment=assignment, _request_auth=_request_auth, @@ -4116,7 +5037,8 @@ def export_submissions_reviews_as_csv_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4130,7 +5052,7 @@ def export_submissions_reviews_as_csv_with_http_info( @validate_call - def export_submissions_reviews_as_csv_without_preload_content( + def get_assignment_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -4147,9 +5069,9 @@ def export_submissions_reviews_as_csv_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """CSV Grades exports + """Get an assignment - Export list of submissions grades to a CSV file + Retrieve a single assignment, including its attachments, its toolset and its grading settings. Use `listAssignments` to enumerate the assignments of a class. A teacher of the class sees the assignment as authored. A student sees the same document with the teacher-only fields omitted, `teacherInstructions` among them. :param var_class: Unique identifier of the class (required) :type var_class: str @@ -4177,7 +5099,7 @@ def export_submissions_reviews_as_csv_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._export_submissions_reviews_as_csv_serialize( + _param = self._get_assignment_serialize( var_class=var_class, assignment=assignment, _request_auth=_request_auth, @@ -4187,7 +5109,8 @@ def export_submissions_reviews_as_csv_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4196,7 +5119,7 @@ def export_submissions_reviews_as_csv_without_preload_content( return response_data.response - def _export_submissions_reviews_as_csv_serialize( + def _get_assignment_serialize( self, var_class, assignment, @@ -4215,7 +5138,9 @@ def _export_submissions_reviews_as_csv_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4230,11 +5155,12 @@ def _export_submissions_reviews_as_csv_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'text/csv' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4244,7 +5170,7 @@ def _export_submissions_reviews_as_csv_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/assignments/{assignment}/submissions/csv', + resource_path='/classes/{class}/assignments/{assignment}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4261,10 +5187,9 @@ def _export_submissions_reviews_as_csv_serialize( @validate_call - def export_submissions_reviews_as_excel( + def get_class( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4277,15 +5202,12 @@ def export_submissions_reviews_as_excel( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> bytearray: - """Excel Grades exports + ) -> ClassDetails: + """Get the details of a single class - Export list of submissions grades to an Excel file :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -4308,9 +5230,8 @@ def export_submissions_reviews_as_excel( :return: Returns the result object. """ # noqa: E501 - _param = self._export_submissions_reviews_as_excel_serialize( + _param = self._get_class_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4318,7 +5239,8 @@ def export_submissions_reviews_as_excel( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4332,10 +5254,9 @@ def export_submissions_reviews_as_excel( @validate_call - def export_submissions_reviews_as_excel_with_http_info( + def get_class_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4348,15 +5269,12 @@ def export_submissions_reviews_as_excel_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[bytearray]: - """Excel Grades exports + ) -> ApiResponse[ClassDetails]: + """Get the details of a single class - Export list of submissions grades to an Excel file :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -4379,9 +5297,8 @@ def export_submissions_reviews_as_excel_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._export_submissions_reviews_as_excel_serialize( + _param = self._get_class_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4389,7 +5306,8 @@ def export_submissions_reviews_as_excel_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4403,10 +5321,9 @@ def export_submissions_reviews_as_excel_with_http_info( @validate_call - def export_submissions_reviews_as_excel_without_preload_content( + def get_class_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4420,14 +5337,11 @@ def export_submissions_reviews_as_excel_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Excel Grades exports + """Get the details of a single class - Export list of submissions grades to an Excel file :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -4450,9 +5364,8 @@ def export_submissions_reviews_as_excel_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._export_submissions_reviews_as_excel_serialize( + _param = self._get_class_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4460,7 +5373,8 @@ def export_submissions_reviews_as_excel_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4469,10 +5383,9 @@ def export_submissions_reviews_as_excel_without_preload_content( return response_data.response - def _export_submissions_reviews_as_excel_serialize( + def _get_class_serialize( self, var_class, - assignment, _request_auth, _content_type, _headers, @@ -4488,14 +5401,14 @@ def _export_submissions_reviews_as_excel_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if var_class is not None: _path_params['class'] = var_class - if assignment is not None: - _path_params['assignment'] = assignment # process the query parameters # process the header parameters # process the form parameters @@ -4503,11 +5416,12 @@ def _export_submissions_reviews_as_excel_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4517,7 +5431,7 @@ def _export_submissions_reviews_as_excel_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/assignments/{assignment}/submissions/excel', + resource_path='/classes/{class}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4534,9 +5448,9 @@ def _export_submissions_reviews_as_excel_serialize( @validate_call - def get_class( + def get_score_submissions( self, - var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4549,12 +5463,13 @@ def get_class( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ClassDetails: - """Get the details of a single class + ) -> List[AssignmentSubmission]: + """List submissions related to the score + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. - :param var_class: Unique identifier of the class (required) - :type var_class: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str :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 @@ -4577,8 +5492,8 @@ def get_class( :return: Returns the result object. """ # noqa: E501 - _param = self._get_class_serialize( - var_class=var_class, + _param = self._get_score_submissions_serialize( + score=score, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4586,7 +5501,8 @@ def get_class( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4600,9 +5516,9 @@ def get_class( @validate_call - def get_class_with_http_info( + def get_score_submissions_with_http_info( self, - var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4615,12 +5531,13 @@ def get_class_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ClassDetails]: - """Get the details of a single class + ) -> ApiResponse[List[AssignmentSubmission]]: + """List submissions related to the score + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. - :param var_class: Unique identifier of the class (required) - :type var_class: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str :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 @@ -4643,8 +5560,8 @@ def get_class_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_class_serialize( - var_class=var_class, + _param = self._get_score_submissions_serialize( + score=score, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4652,7 +5569,8 @@ def get_class_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4666,9 +5584,9 @@ def get_class_with_http_info( @validate_call - def get_class_without_preload_content( + def get_score_submissions_without_preload_content( self, - var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4682,11 +5600,12 @@ def get_class_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get the details of a single class + """List submissions related to the score + This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. - :param var_class: Unique identifier of the class (required) - :type var_class: str + :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) + :type score: str :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 @@ -4709,8 +5628,8 @@ def get_class_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_class_serialize( - var_class=var_class, + _param = self._get_score_submissions_serialize( + score=score, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4718,7 +5637,8 @@ def get_class_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4727,9 +5647,9 @@ def get_class_without_preload_content( return response_data.response - def _get_class_serialize( + def _get_score_submissions_serialize( self, - var_class, + score, _request_auth, _content_type, _headers, @@ -4745,12 +5665,14 @@ def _get_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters - if var_class is not None: - _path_params['class'] = var_class + if score is not None: + _path_params['score'] = score # process the query parameters # process the header parameters # process the form parameters @@ -4758,11 +5680,12 @@ def _get_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4772,7 +5695,7 @@ def _get_class_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}', + resource_path='/scores/{score}/submissions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -4789,9 +5712,11 @@ def _get_class_serialize( @validate_call - def get_score_submissions( + def get_submission( self, - score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4804,13 +5729,16 @@ def get_score_submissions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AssignmentSubmission]: - """List submissions related to the score + ) -> AssignmentSubmission: + """Get a student submission - This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. - :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) - :type score: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str :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 @@ -4833,8 +5761,10 @@ def get_score_submissions( :return: Returns the result object. """ # noqa: E501 - _param = self._get_score_submissions_serialize( - score=score, + _param = self._get_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4842,7 +5772,8 @@ def get_score_submissions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4856,9 +5787,11 @@ def get_score_submissions( @validate_call - def get_score_submissions_with_http_info( + def get_submission_with_http_info( self, - score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4871,13 +5804,16 @@ def get_score_submissions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AssignmentSubmission]]: - """List submissions related to the score + ) -> ApiResponse[AssignmentSubmission]: + """Get a student submission - This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. - :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) - :type score: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str :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 @@ -4900,8 +5836,10 @@ def get_score_submissions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_score_submissions_serialize( - score=score, + _param = self._get_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4909,7 +5847,8 @@ def get_score_submissions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4923,9 +5862,11 @@ def get_score_submissions_with_http_info( @validate_call - def get_score_submissions_without_preload_content( + def get_submission_without_preload_content( self, - score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4939,12 +5880,15 @@ def get_score_submissions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List submissions related to the score + """Get a student submission - This API call will list the different assignments submissions where the score is attached. This method can be used by anyone that are part of the organization and have at least read access to the document. - :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) - :type score: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str :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 @@ -4967,8 +5911,10 @@ def get_score_submissions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_score_submissions_serialize( - score=score, + _param = self._get_submission_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4976,7 +5922,8 @@ def get_score_submissions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "AssignmentSubmission", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4985,9 +5932,11 @@ def get_score_submissions_without_preload_content( return response_data.response - def _get_score_submissions_serialize( + def _get_submission_serialize( self, - score, + var_class, + assignment, + submission, _request_auth, _content_type, _headers, @@ -5003,12 +5952,18 @@ def _get_score_submissions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters - if score is not None: - _path_params['score'] = score + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission # process the query parameters # process the header parameters # process the form parameters @@ -5016,11 +5971,12 @@ def _get_score_submissions_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -5030,7 +5986,7 @@ def _get_score_submissions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/scores/{score}/submissions', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5047,7 +6003,7 @@ def _get_score_submissions_serialize( @validate_call - def get_submission( + def get_submission_comments( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -5064,8 +6020,8 @@ def get_submission( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AssignmentSubmission: - """Get a student submission + ) -> List[AssignmentSubmissionComment]: + """List the feedback comments of a submission :param var_class: Unique identifier of the class (required) @@ -5096,7 +6052,7 @@ def get_submission( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_serialize( + _param = self._get_submission_comments_serialize( var_class=var_class, assignment=assignment, submission=submission, @@ -5107,7 +6063,10 @@ def get_submission( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '200': "List[AssignmentSubmissionComment]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5121,7 +6080,7 @@ def get_submission( @validate_call - def get_submission_with_http_info( + def get_submission_comments_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -5138,8 +6097,8 @@ def get_submission_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AssignmentSubmission]: - """Get a student submission + ) -> ApiResponse[List[AssignmentSubmissionComment]]: + """List the feedback comments of a submission :param var_class: Unique identifier of the class (required) @@ -5170,7 +6129,7 @@ def get_submission_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_serialize( + _param = self._get_submission_comments_serialize( var_class=var_class, assignment=assignment, submission=submission, @@ -5181,7 +6140,10 @@ def get_submission_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '200': "List[AssignmentSubmissionComment]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5195,7 +6157,7 @@ def get_submission_with_http_info( @validate_call - def get_submission_without_preload_content( + def get_submission_comments_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -5213,7 +6175,7 @@ def get_submission_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get a student submission + """List the feedback comments of a submission :param var_class: Unique identifier of the class (required) @@ -5244,7 +6206,7 @@ def get_submission_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_serialize( + _param = self._get_submission_comments_serialize( var_class=var_class, assignment=assignment, submission=submission, @@ -5255,7 +6217,10 @@ def get_submission_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmission", + '200': "List[AssignmentSubmissionComment]", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5264,7 +6229,7 @@ def get_submission_without_preload_content( return response_data.response - def _get_submission_serialize( + def _get_submission_comments_serialize( self, var_class, assignment, @@ -5284,7 +6249,9 @@ def _get_submission_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5301,11 +6268,12 @@ def _get_submission_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -5315,7 +6283,7 @@ def _get_submission_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5332,7 +6300,7 @@ def _get_submission_serialize( @validate_call - def get_submission_comments( + def get_submission_history( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -5349,9 +6317,10 @@ def get_submission_comments( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AssignmentSubmissionComment]: - """List the feedback comments of a submission + ) -> List[AssignmentSubmissionHistory]: + """Get the history of the submission + For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. :param var_class: Unique identifier of the class (required) :type var_class: str @@ -5381,7 +6350,7 @@ def get_submission_comments( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_comments_serialize( + _param = self._get_submission_history_serialize( var_class=var_class, assignment=assignment, submission=submission, @@ -5392,9 +6361,10 @@ def get_submission_comments( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmissionComment]", + '200': "List[AssignmentSubmissionHistory]", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5408,7 +6378,7 @@ def get_submission_comments( @validate_call - def get_submission_comments_with_http_info( + def get_submission_history_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -5425,9 +6395,10 @@ def get_submission_comments_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AssignmentSubmissionComment]]: - """List the feedback comments of a submission + ) -> ApiResponse[List[AssignmentSubmissionHistory]]: + """Get the history of the submission + For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. :param var_class: Unique identifier of the class (required) :type var_class: str @@ -5457,7 +6428,7 @@ def get_submission_comments_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_comments_serialize( + _param = self._get_submission_history_serialize( var_class=var_class, assignment=assignment, submission=submission, @@ -5468,9 +6439,10 @@ def get_submission_comments_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmissionComment]", + '200': "List[AssignmentSubmissionHistory]", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5484,7 +6456,7 @@ def get_submission_comments_with_http_info( @validate_call - def get_submission_comments_without_preload_content( + def get_submission_history_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], @@ -5502,8 +6474,9 @@ def get_submission_comments_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List the feedback comments of a submission + """Get the history of the submission + For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. :param var_class: Unique identifier of the class (required) :type var_class: str @@ -5533,7 +6506,7 @@ def get_submission_comments_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_comments_serialize( + _param = self._get_submission_history_serialize( var_class=var_class, assignment=assignment, submission=submission, @@ -5544,9 +6517,10 @@ def get_submission_comments_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmissionComment]", + '200': "List[AssignmentSubmissionHistory]", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5555,7 +6529,7 @@ def get_submission_comments_without_preload_content( return response_data.response - def _get_submission_comments_serialize( + def _get_submission_history_serialize( self, var_class, assignment, @@ -5575,7 +6549,9 @@ def _get_submission_comments_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5592,11 +6568,12 @@ def _get_submission_comments_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -5606,7 +6583,7 @@ def _get_submission_comments_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/history', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5623,11 +6600,10 @@ def _get_submission_comments_serialize( @validate_call - def get_submission_history( + def get_submissions( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5640,17 +6616,14 @@ def get_submission_history( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AssignmentSubmissionHistory]: - """Get the history of the submission + ) -> List[AssignmentSubmission]: + """List the students' submissions - For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. :param var_class: Unique identifier of the class (required) :type var_class: str :param assignment: Unique identifier of the assignment (required) :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str :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 @@ -5673,10 +6646,9 @@ def get_submission_history( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_history_serialize( + _param = self._get_submissions_serialize( var_class=var_class, assignment=assignment, - submission=submission, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5684,9 +6656,8 @@ def get_submission_history( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmissionHistory]", - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5700,11 +6671,10 @@ def get_submission_history( @validate_call - def get_submission_history_with_http_info( + def get_submissions_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5717,17 +6687,14 @@ def get_submission_history_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AssignmentSubmissionHistory]]: - """Get the history of the submission + ) -> ApiResponse[List[AssignmentSubmission]]: + """List the students' submissions - For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. :param var_class: Unique identifier of the class (required) :type var_class: str :param assignment: Unique identifier of the assignment (required) :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str :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 @@ -5750,10 +6717,9 @@ def get_submission_history_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_history_serialize( + _param = self._get_submissions_serialize( var_class=var_class, assignment=assignment, - submission=submission, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5761,9 +6727,8 @@ def get_submission_history_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmissionHistory]", - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5777,11 +6742,10 @@ def get_submission_history_with_http_info( @validate_call - def get_submission_history_without_preload_content( + def get_submissions_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5795,16 +6759,13 @@ def get_submission_history_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get the history of the submission + """List the students' submissions - For teachers only. Returns a detailed history of the submission. This currently includes state and grade histories. :param var_class: Unique identifier of the class (required) :type var_class: str :param assignment: Unique identifier of the assignment (required) :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str :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 @@ -5827,10 +6788,9 @@ def get_submission_history_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submission_history_serialize( + _param = self._get_submissions_serialize( var_class=var_class, assignment=assignment, - submission=submission, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5838,9 +6798,8 @@ def get_submission_history_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmissionHistory]", - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5849,11 +6808,10 @@ def get_submission_history_without_preload_content( return response_data.response - def _get_submission_history_serialize( + def _get_submissions_serialize( self, var_class, assignment, - submission, _request_auth, _content_type, _headers, @@ -5869,7 +6827,9 @@ def _get_submission_history_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5877,8 +6837,6 @@ def _get_submission_history_serialize( _path_params['class'] = var_class if assignment is not None: _path_params['assignment'] = assignment - if submission is not None: - _path_params['submission'] = submission # process the query parameters # process the header parameters # process the form parameters @@ -5886,11 +6844,12 @@ def _get_submission_history_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -5900,7 +6859,7 @@ def _get_submission_history_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/history', + resource_path='/classes/{class}/assignments/{assignment}/submissions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -5917,10 +6876,9 @@ def _get_submission_history_serialize( @validate_call - def get_submissions( + def list_assignments( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -5933,14 +6891,12 @@ def get_submissions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AssignmentSubmission]: - """List the students' submissions + ) -> List[ClassAssignment]: + """Assignments listing :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -5963,9 +6919,8 @@ def get_submissions( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submissions_serialize( + _param = self._list_assignments_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -5973,7 +6928,8 @@ def get_submissions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "List[ClassAssignment]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5987,10 +6943,9 @@ def get_submissions( @validate_call - def get_submissions_with_http_info( + def list_assignments_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6003,14 +6958,12 @@ def get_submissions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AssignmentSubmission]]: - """List the students' submissions + ) -> ApiResponse[List[ClassAssignment]]: + """Assignments listing :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -6033,9 +6986,8 @@ def get_submissions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submissions_serialize( + _param = self._list_assignments_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6043,7 +6995,8 @@ def get_submissions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "List[ClassAssignment]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6057,10 +7010,9 @@ def get_submissions_with_http_info( @validate_call - def get_submissions_without_preload_content( + def list_assignments_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6074,13 +7026,11 @@ def get_submissions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List the students' submissions + """Assignments listing :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -6103,9 +7053,8 @@ def get_submissions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_submissions_serialize( + _param = self._list_assignments_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6113,7 +7062,8 @@ def get_submissions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "List[ClassAssignment]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6122,10 +7072,9 @@ def get_submissions_without_preload_content( return response_data.response - def _get_submissions_serialize( + def _list_assignments_serialize( self, var_class, - assignment, _request_auth, _content_type, _headers, @@ -6141,14 +7090,14 @@ def _get_submissions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if var_class is not None: _path_params['class'] = var_class - if assignment is not None: - _path_params['assignment'] = assignment # process the query parameters # process the header parameters # process the form parameters @@ -6156,11 +7105,12 @@ def _get_submissions_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6170,7 +7120,7 @@ def _get_submissions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/assignments/{assignment}/submissions', + resource_path='/classes/{class}/assignments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6187,9 +7137,10 @@ def _get_submissions_serialize( @validate_call - def list_assignments( + def list_class_student_submissions( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6202,12 +7153,15 @@ def list_assignments( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ClassAssignment]: - """Assignments listing + ) -> List[AssignmentSubmission]: + """List the submissions for a student + Use this method as a teacher to list all the assignment submissions sent by a student of the class :param var_class: Unique identifier of the class (required) :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str :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 @@ -6230,8 +7184,9 @@ def list_assignments( :return: Returns the result object. """ # noqa: E501 - _param = self._list_assignments_serialize( + _param = self._list_class_student_submissions_serialize( var_class=var_class, + user=user, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6239,7 +7194,8 @@ def list_assignments( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ClassAssignment]", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6253,9 +7209,10 @@ def list_assignments( @validate_call - def list_assignments_with_http_info( + def list_class_student_submissions_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6268,12 +7225,15 @@ def list_assignments_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[ClassAssignment]]: - """Assignments listing + ) -> ApiResponse[List[AssignmentSubmission]]: + """List the submissions for a student + Use this method as a teacher to list all the assignment submissions sent by a student of the class :param var_class: Unique identifier of the class (required) :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str :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 @@ -6296,8 +7256,9 @@ def list_assignments_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_assignments_serialize( + _param = self._list_class_student_submissions_serialize( var_class=var_class, + user=user, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6305,7 +7266,8 @@ def list_assignments_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ClassAssignment]", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6319,9 +7281,10 @@ def list_assignments_with_http_info( @validate_call - def list_assignments_without_preload_content( + def list_class_student_submissions_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + user: Annotated[StrictStr, Field(description="Unique identifier of the user")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6335,11 +7298,14 @@ def list_assignments_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Assignments listing + """List the submissions for a student + Use this method as a teacher to list all the assignment submissions sent by a student of the class :param var_class: Unique identifier of the class (required) :type var_class: str + :param user: Unique identifier of the user (required) + :type user: str :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 @@ -6362,8 +7328,9 @@ def list_assignments_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_assignments_serialize( + _param = self._list_class_student_submissions_serialize( var_class=var_class, + user=user, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6371,7 +7338,8 @@ def list_assignments_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ClassAssignment]", + '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6380,9 +7348,10 @@ def list_assignments_without_preload_content( return response_data.response - def _list_assignments_serialize( + def _list_class_student_submissions_serialize( self, var_class, + user, _request_auth, _content_type, _headers, @@ -6398,12 +7367,16 @@ def _list_assignments_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if var_class is not None: _path_params['class'] = var_class + if user is not None: + _path_params['user'] = user # process the query parameters # process the header parameters # process the form parameters @@ -6411,11 +7384,12 @@ def _list_assignments_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6425,7 +7399,7 @@ def _list_assignments_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/assignments', + resource_path='/classes/{class}/students/{user}/submissions', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6442,10 +7416,9 @@ def _list_assignments_serialize( @validate_call - def list_class_student_submissions( + def list_classes( self, - var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6458,15 +7431,12 @@ def list_class_student_submissions( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[AssignmentSubmission]: - """List the submissions for a student + ) -> List[ClassDetails]: + """List the classes available for the current user - Use this method as a teacher to list all the assignment submissions sent by a student of the class - :param var_class: Unique identifier of the class (required) - :type var_class: str - :param user: Unique identifier of the user (required) - :type user: str + :param state: Filter the classes by state + :type state: str :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 @@ -6489,9 +7459,8 @@ def list_class_student_submissions( :return: Returns the result object. """ # noqa: E501 - _param = self._list_class_student_submissions_serialize( - var_class=var_class, - user=user, + _param = self._list_classes_serialize( + state=state, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6499,7 +7468,8 @@ def list_class_student_submissions( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "List[ClassDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6513,10 +7483,9 @@ def list_class_student_submissions( @validate_call - def list_class_student_submissions_with_http_info( + def list_classes_with_http_info( self, - var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6529,15 +7498,12 @@ def list_class_student_submissions_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[AssignmentSubmission]]: - """List the submissions for a student + ) -> ApiResponse[List[ClassDetails]]: + """List the classes available for the current user - Use this method as a teacher to list all the assignment submissions sent by a student of the class - :param var_class: Unique identifier of the class (required) - :type var_class: str - :param user: Unique identifier of the user (required) - :type user: str + :param state: Filter the classes by state + :type state: str :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 @@ -6560,9 +7526,8 @@ def list_class_student_submissions_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_class_student_submissions_serialize( - var_class=var_class, - user=user, + _param = self._list_classes_serialize( + state=state, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6570,7 +7535,8 @@ def list_class_student_submissions_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "List[ClassDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6584,10 +7550,9 @@ def list_class_student_submissions_with_http_info( @validate_call - def list_class_student_submissions_without_preload_content( + def list_classes_without_preload_content( self, - var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - user: Annotated[StrictStr, Field(description="Unique identifier of the user")], + state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6601,14 +7566,11 @@ def list_class_student_submissions_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List the submissions for a student + """List the classes available for the current user - Use this method as a teacher to list all the assignment submissions sent by a student of the class - :param var_class: Unique identifier of the class (required) - :type var_class: str - :param user: Unique identifier of the user (required) - :type user: str + :param state: Filter the classes by state + :type state: str :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 @@ -6631,9 +7593,8 @@ def list_class_student_submissions_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_class_student_submissions_serialize( - var_class=var_class, - user=user, + _param = self._list_classes_serialize( + state=state, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6641,7 +7602,8 @@ def list_class_student_submissions_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[AssignmentSubmission]", + '200': "List[ClassDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6650,10 +7612,9 @@ def list_class_student_submissions_without_preload_content( return response_data.response - def _list_class_student_submissions_serialize( + def _list_classes_serialize( self, - var_class, - user, + state, _request_auth, _content_type, _headers, @@ -6669,26 +7630,29 @@ def _list_class_student_submissions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters - if var_class is not None: - _path_params['class'] = var_class - if user is not None: - _path_params['user'] = user # process the query parameters + if state is not None: + + _query_params.append(('state', state)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6698,7 +7662,7 @@ def _list_class_student_submissions_serialize( return self.api_client.param_serialize( method='GET', - resource_path='/classes/{class}/students/{user}/submissions', + resource_path='/classes', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6715,9 +7679,12 @@ def _list_class_student_submissions_serialize( @validate_call - def list_classes( + def post_submission_comment( self, - state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6730,12 +7697,18 @@ def list_classes( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ClassDetails]: - """List the classes available for the current user + ) -> AssignmentSubmissionComment: + """Add a feedback comment to a submission - :param state: Filter the classes by state - :type state: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation :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 @@ -6758,8 +7731,11 @@ def list_classes( :return: Returns the result object. """ # noqa: E501 - _param = self._list_classes_serialize( - state=state, + _param = self._post_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + assignment_submission_comment_creation=assignment_submission_comment_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6767,7 +7743,10 @@ def list_classes( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ClassDetails]", + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6781,9 +7760,12 @@ def list_classes( @validate_call - def list_classes_with_http_info( + def post_submission_comment_with_http_info( self, - state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6796,12 +7778,18 @@ def list_classes_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[ClassDetails]]: - """List the classes available for the current user + ) -> ApiResponse[AssignmentSubmissionComment]: + """Add a feedback comment to a submission - :param state: Filter the classes by state - :type state: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation :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 @@ -6824,8 +7812,11 @@ def list_classes_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_classes_serialize( - state=state, + _param = self._post_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + assignment_submission_comment_creation=assignment_submission_comment_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6833,7 +7824,10 @@ def list_classes_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ClassDetails]", + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6847,9 +7841,12 @@ def list_classes_with_http_info( @validate_call - def list_classes_without_preload_content( + def post_submission_comment_without_preload_content( self, - state: Annotated[Optional[StrictStr], Field(description="Filter the classes by state")] = None, + var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], + assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6863,11 +7860,17 @@ def list_classes_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List the classes available for the current user + """Add a feedback comment to a submission - :param state: Filter the classes by state - :type state: str + :param var_class: Unique identifier of the class (required) + :type var_class: str + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param submission: Unique identifier of the submission (required) + :type submission: str + :param assignment_submission_comment_creation: (required) + :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation :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 @@ -6890,8 +7893,11 @@ def list_classes_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_classes_serialize( - state=state, + _param = self._post_submission_comment_serialize( + var_class=var_class, + assignment=assignment, + submission=submission, + assignment_submission_comment_creation=assignment_submission_comment_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6899,7 +7905,10 @@ def list_classes_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ClassDetails]", + '200': "AssignmentSubmissionComment", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6908,9 +7917,12 @@ def list_classes_without_preload_content( return response_data.response - def _list_classes_serialize( + def _post_submission_comment_serialize( self, - state, + var_class, + assignment, + submission, + assignment_submission_comment_creation, _request_auth, _content_type, _headers, @@ -6926,27 +7938,47 @@ def _list_classes_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters + if var_class is not None: + _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment + if submission is not None: + _path_params['submission'] = submission # process the query parameters - if state is not None: - - _query_params.append(('state', state)) - # process the header parameters # process the form parameters # process the body parameter + if assignment_submission_comment_creation is not None: + _body_params = assignment_submission_comment_creation # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -6954,8 +7986,8 @@ def _list_classes_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/classes', + method='POST', + resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -6972,12 +8004,10 @@ def _list_classes_serialize( @validate_call - def post_submission_comment( + def unarchive_assignment( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6990,18 +8020,15 @@ def post_submission_comment( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> AssignmentSubmissionComment: - """Add a feedback comment to a submission + ) -> Assignment: + """Unarchive the assignment. + Mark the assignment as `active`. :param var_class: Unique identifier of the class (required) :type var_class: str :param assignment: Unique identifier of the assignment (required) :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str - :param assignment_submission_comment_creation: (required) - :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation :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 @@ -7024,11 +8051,9 @@ def post_submission_comment( :return: Returns the result object. """ # noqa: E501 - _param = self._post_submission_comment_serialize( + _param = self._unarchive_assignment_serialize( var_class=var_class, assignment=assignment, - submission=submission, - assignment_submission_comment_creation=assignment_submission_comment_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7036,9 +8061,8 @@ def post_submission_comment( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmissionComment", - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7052,12 +8076,10 @@ def post_submission_comment( @validate_call - def post_submission_comment_with_http_info( + def unarchive_assignment_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7070,18 +8092,15 @@ def post_submission_comment_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[AssignmentSubmissionComment]: - """Add a feedback comment to a submission + ) -> ApiResponse[Assignment]: + """Unarchive the assignment. + Mark the assignment as `active`. :param var_class: Unique identifier of the class (required) :type var_class: str :param assignment: Unique identifier of the assignment (required) :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str - :param assignment_submission_comment_creation: (required) - :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation :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 @@ -7104,11 +8123,9 @@ def post_submission_comment_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._post_submission_comment_serialize( + _param = self._unarchive_assignment_serialize( var_class=var_class, assignment=assignment, - submission=submission, - assignment_submission_comment_creation=assignment_submission_comment_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7116,9 +8133,8 @@ def post_submission_comment_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmissionComment", - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7132,12 +8148,10 @@ def post_submission_comment_with_http_info( @validate_call - def post_submission_comment_without_preload_content( + def unarchive_assignment_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], - submission: Annotated[StrictStr, Field(description="Unique identifier of the submission")], - assignment_submission_comment_creation: AssignmentSubmissionCommentCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7151,17 +8165,14 @@ def post_submission_comment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Add a feedback comment to a submission + """Unarchive the assignment. + Mark the assignment as `active`. :param var_class: Unique identifier of the class (required) :type var_class: str :param assignment: Unique identifier of the assignment (required) :type assignment: str - :param submission: Unique identifier of the submission (required) - :type submission: str - :param assignment_submission_comment_creation: (required) - :type assignment_submission_comment_creation: AssignmentSubmissionCommentCreation :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 @@ -7184,11 +8195,9 @@ def post_submission_comment_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._post_submission_comment_serialize( + _param = self._unarchive_assignment_serialize( var_class=var_class, assignment=assignment, - submission=submission, - assignment_submission_comment_creation=assignment_submission_comment_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7196,9 +8205,8 @@ def post_submission_comment_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "AssignmentSubmissionComment", - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7207,12 +8215,10 @@ def post_submission_comment_without_preload_content( return response_data.response - def _post_submission_comment_serialize( + def _unarchive_assignment_serialize( self, var_class, assignment, - submission, - assignment_submission_comment_creation, _request_auth, _content_type, _headers, @@ -7228,7 +8234,9 @@ def _post_submission_comment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7236,36 +8244,20 @@ def _post_submission_comment_serialize( _path_params['class'] = var_class if assignment is not None: _path_params['assignment'] = assignment - if submission is not None: - _path_params['submission'] = submission # process the query parameters # process the header parameters # process the form parameters # process the body parameter - if assignment_submission_comment_creation is not None: - _body_params = assignment_submission_comment_creation # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - - # set the HTTP header `Content-Type` - if _content_type: - _header_params['Content-Type'] = _content_type - else: - _default_content_type = ( - self.api_client.select_header_content_type( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] ) - if _default_content_type is not None: - _header_params['Content-Type'] = _default_content_type + # authentication setting _auth_settings: List[str] = [ @@ -7273,8 +8265,8 @@ def _post_submission_comment_serialize( ] return self.api_client.param_serialize( - method='POST', - resource_path='/classes/{class}/assignments/{assignment}/submissions/{submission}/comments', + method='DELETE', + resource_path='/classes/{class}/assignments/{assignment}/archive', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7291,10 +8283,9 @@ def _post_submission_comment_serialize( @validate_call - def unarchive_assignment( + def unarchive_class( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7307,15 +8298,13 @@ def unarchive_assignment( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> Assignment: - """Unarchive the assignment. + ) -> ClassDetails: + """Unarchive the class - Mark the assignment as `active`. + Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -7338,9 +8327,8 @@ def unarchive_assignment( :return: Returns the result object. """ # noqa: E501 - _param = self._unarchive_assignment_serialize( + _param = self._unarchive_class_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7348,7 +8336,8 @@ def unarchive_assignment( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Assignment", + '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7362,10 +8351,9 @@ def unarchive_assignment( @validate_call - def unarchive_assignment_with_http_info( + def unarchive_class_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7378,15 +8366,13 @@ def unarchive_assignment_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[Assignment]: - """Unarchive the assignment. + ) -> ApiResponse[ClassDetails]: + """Unarchive the class - Mark the assignment as `active`. + Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -7409,9 +8395,8 @@ def unarchive_assignment_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._unarchive_assignment_serialize( + _param = self._unarchive_class_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7419,7 +8404,8 @@ def unarchive_assignment_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Assignment", + '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7433,10 +8419,9 @@ def unarchive_assignment_with_http_info( @validate_call - def unarchive_assignment_without_preload_content( + def unarchive_class_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7450,14 +8435,12 @@ def unarchive_assignment_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Unarchive the assignment. + """Unarchive the class - Mark the assignment as `active`. + Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. :param var_class: Unique identifier of the class (required) :type var_class: str - :param assignment: Unique identifier of the assignment (required) - :type assignment: str :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 @@ -7480,9 +8463,8 @@ def unarchive_assignment_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._unarchive_assignment_serialize( + _param = self._unarchive_class_serialize( var_class=var_class, - assignment=assignment, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7490,7 +8472,8 @@ def unarchive_assignment_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "Assignment", + '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7499,10 +8482,9 @@ def unarchive_assignment_without_preload_content( return response_data.response - def _unarchive_assignment_serialize( + def _unarchive_class_serialize( self, var_class, - assignment, _request_auth, _content_type, _headers, @@ -7518,14 +8500,14 @@ def _unarchive_assignment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if var_class is not None: _path_params['class'] = var_class - if assignment is not None: - _path_params['assignment'] = assignment # process the query parameters # process the header parameters # process the form parameters @@ -7533,11 +8515,12 @@ def _unarchive_assignment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -7547,7 +8530,7 @@ def _unarchive_assignment_serialize( return self.api_client.param_serialize( method='DELETE', - resource_path='/classes/{class}/assignments/{assignment}/archive', + resource_path='/classes/{class}/archive', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7564,9 +8547,10 @@ def _unarchive_assignment_serialize( @validate_call - def unarchive_class( + def update_class( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: Annotated[ClassUpdate, Field(description="Details of the Class")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7580,12 +8564,14 @@ def unarchive_class( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ClassDetails: - """Unarchive the class + """Update the class - Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + Update the meta information of the class :param var_class: Unique identifier of the class (required) :type var_class: str + :param body: Details of the Class (required) + :type body: ClassUpdate :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 @@ -7608,8 +8594,9 @@ def unarchive_class( :return: Returns the result object. """ # noqa: E501 - _param = self._unarchive_class_serialize( + _param = self._update_class_serialize( var_class=var_class, + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7618,6 +8605,7 @@ def unarchive_class( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7631,9 +8619,10 @@ def unarchive_class( @validate_call - def unarchive_class_with_http_info( + def update_class_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: Annotated[ClassUpdate, Field(description="Details of the Class")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7647,12 +8636,14 @@ def unarchive_class_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[ClassDetails]: - """Unarchive the class + """Update the class - Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + Update the meta information of the class :param var_class: Unique identifier of the class (required) :type var_class: str + :param body: Details of the Class (required) + :type body: ClassUpdate :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 @@ -7675,8 +8666,9 @@ def unarchive_class_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._unarchive_class_serialize( + _param = self._update_class_serialize( var_class=var_class, + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7685,6 +8677,7 @@ def unarchive_class_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7698,9 +8691,10 @@ def unarchive_class_with_http_info( @validate_call - def unarchive_class_without_preload_content( + def update_class_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], + body: Annotated[ClassUpdate, Field(description="Details of the Class")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7714,12 +8708,14 @@ def unarchive_class_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Unarchive the class + """Update the class - Mark the class as `active`. When this course is synchronized with another app, like Google Classroom, this state will be automatically be updated. + Update the meta information of the class :param var_class: Unique identifier of the class (required) :type var_class: str + :param body: Details of the Class (required) + :type body: ClassUpdate :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 @@ -7742,8 +8738,9 @@ def unarchive_class_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._unarchive_class_serialize( + _param = self._update_class_serialize( var_class=var_class, + body=body, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7752,6 +8749,7 @@ def unarchive_class_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassDetails", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7760,9 +8758,10 @@ def unarchive_class_without_preload_content( return response_data.response - def _unarchive_class_serialize( + def _update_class_serialize( self, var_class, + body, _request_auth, _content_type, _headers, @@ -7778,7 +8777,9 @@ def _unarchive_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7788,15 +8789,31 @@ def _unarchive_class_serialize( # process the header parameters # process the form parameters # process the body parameter + if body is not None: + _body_params = body # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -7804,8 +8821,8 @@ def _unarchive_class_serialize( ] return self.api_client.param_serialize( - method='DELETE', - resource_path='/classes/{class}/archive', + method='PUT', + resource_path='/classes/{class}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -7822,10 +8839,11 @@ def _unarchive_class_serialize( @validate_call - def update_class( + def update_class_assignment( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - body: Annotated[ClassUpdate, Field(description="Details of the Class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: ClassAssignmentUpdate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7838,15 +8856,17 @@ def update_class( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ClassDetails: - """Update the class + ) -> Assignment: + """Update an assignment - Update the meta information of the class + Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. `attachments` is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already `active` cannot be moved back to `draft`. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use `archiveAssignment`. :param var_class: Unique identifier of the class (required) :type var_class: str - :param body: Details of the Class (required) - :type body: ClassUpdate + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: ClassAssignmentUpdate :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 @@ -7869,8 +8889,9 @@ def update_class( :return: Returns the result object. """ # noqa: E501 - _param = self._update_class_serialize( + _param = self._update_class_assignment_serialize( var_class=var_class, + assignment=assignment, body=body, _request_auth=_request_auth, _content_type=_content_type, @@ -7879,7 +8900,8 @@ def update_class( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7893,10 +8915,11 @@ def update_class( @validate_call - def update_class_with_http_info( + def update_class_assignment_with_http_info( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - body: Annotated[ClassUpdate, Field(description="Details of the Class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: ClassAssignmentUpdate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7909,15 +8932,17 @@ def update_class_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ClassDetails]: - """Update the class + ) -> ApiResponse[Assignment]: + """Update an assignment - Update the meta information of the class + Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. `attachments` is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already `active` cannot be moved back to `draft`. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use `archiveAssignment`. :param var_class: Unique identifier of the class (required) :type var_class: str - :param body: Details of the Class (required) - :type body: ClassUpdate + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: ClassAssignmentUpdate :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 @@ -7940,8 +8965,9 @@ def update_class_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._update_class_serialize( + _param = self._update_class_assignment_serialize( var_class=var_class, + assignment=assignment, body=body, _request_auth=_request_auth, _content_type=_content_type, @@ -7950,7 +8976,8 @@ def update_class_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7964,10 +8991,11 @@ def update_class_with_http_info( @validate_call - def update_class_without_preload_content( + def update_class_assignment_without_preload_content( self, var_class: Annotated[StrictStr, Field(description="Unique identifier of the class")], - body: Annotated[ClassUpdate, Field(description="Details of the Class")], + assignment: Annotated[StrictStr, Field(description="Unique identifier of the assignment")], + body: ClassAssignmentUpdate, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7981,14 +9009,16 @@ def update_class_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Update the class + """Update an assignment - Update the meta information of the class + Update an assignment. Only the properties present in the request body are modified, so a partial body leaves everything else as it was. `attachments` is the exception: when present it replaces the whole list. Requires the teacher role on the class. The class must not be archived, and an assignment that is already `active` cannot be moved back to `draft`. Editing an assignment that students have already started does not reset their submissions. To take an assignment out of circulation while keeping the work, use `archiveAssignment`. :param var_class: Unique identifier of the class (required) :type var_class: str - :param body: Details of the Class (required) - :type body: ClassUpdate + :param assignment: Unique identifier of the assignment (required) + :type assignment: str + :param body: (required) + :type body: ClassAssignmentUpdate :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 @@ -8011,8 +9041,9 @@ def update_class_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._update_class_serialize( + _param = self._update_class_assignment_serialize( var_class=var_class, + assignment=assignment, body=body, _request_auth=_request_auth, _content_type=_content_type, @@ -8021,7 +9052,8 @@ def update_class_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ClassDetails", + '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8030,9 +9062,10 @@ def update_class_without_preload_content( return response_data.response - def _update_class_serialize( + def _update_class_assignment_serialize( self, var_class, + assignment, body, _request_auth, _content_type, @@ -8049,12 +9082,16 @@ def _update_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if var_class is not None: _path_params['class'] = var_class + if assignment is not None: + _path_params['assignment'] = assignment # process the query parameters # process the header parameters # process the form parameters @@ -8064,11 +9101,12 @@ def _update_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -8091,7 +9129,7 @@ def _update_class_serialize( return self.api_client.param_serialize( method='PUT', - resource_path='/classes/{class}', + resource_path='/classes/{class}/assignments/{assignment}', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -8179,6 +9217,7 @@ def update_submission_comment( '200': "AssignmentSubmissionComment", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8263,6 +9302,7 @@ def update_submission_comment_with_http_info( '200': "AssignmentSubmissionComment", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8347,6 +9387,7 @@ def update_submission_comment_without_preload_content( '200': "AssignmentSubmissionComment", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8377,7 +9418,9 @@ def _update_submission_comment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8398,11 +9441,12 @@ def _update_submission_comment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/flat_api/api/collection_api.py b/flat_api/api/collection_api.py index 40be3c7..1889bb3 100644 --- a/flat_api/api/collection_api.py +++ b/flat_api/api/collection_api.py @@ -1,28 +1,28 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from pydantic import Field, StrictStr, field_validator -from typing import Optional +from typing import List, Optional from typing_extensions import Annotated from flat_api.models.collection import Collection from flat_api.models.collection_creation import CollectionCreation from flat_api.models.collection_modification import CollectionModification +from flat_api.models.flat_error_response import FlatErrorResponse from flat_api.models.score_details import ScoreDetails from flat_api.api_client import ApiClient, RequestSerialized @@ -46,7 +46,7 @@ def __init__(self, api_client=None) -> None: @validate_call def add_score_to_collection( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ @@ -66,7 +66,7 @@ def add_score_to_collection( This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) :type collection: str :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -108,6 +108,7 @@ def add_score_to_collection( '200': "ScoreDetails", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -123,7 +124,7 @@ def add_score_to_collection( @validate_call def add_score_to_collection_with_http_info( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ @@ -143,7 +144,7 @@ def add_score_to_collection_with_http_info( This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) :type collection: str :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -185,6 +186,7 @@ def add_score_to_collection_with_http_info( '200': "ScoreDetails", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -200,7 +202,7 @@ def add_score_to_collection_with_http_info( @validate_call def add_score_to_collection_without_preload_content( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ @@ -220,7 +222,7 @@ def add_score_to_collection_without_preload_content( This operation will add a score to a collection. The default behavior will make the score available across multiple collections. You must have the capability `canAddScores` on the provided `collection` to perform the action. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) :type collection: str :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -262,6 +264,7 @@ def add_score_to_collection_without_preload_content( '200': "ScoreDetails", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -290,7 +293,9 @@ def _add_score_to_collection_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -309,12 +314,26 @@ def _add_score_to_collection_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -358,7 +377,7 @@ def create_collection( ) -> Collection: """Create a new collection - This method will create a new collection and add it to your `root` collection. + This method will create a new collection in your account. :param body: (required) :type body: CollectionCreation @@ -395,6 +414,7 @@ def create_collection( _response_types_map: Dict[str, Optional[str]] = { '200': "Collection", '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -426,7 +446,7 @@ def create_collection_with_http_info( ) -> ApiResponse[Collection]: """Create a new collection - This method will create a new collection and add it to your `root` collection. + This method will create a new collection in your account. :param body: (required) :type body: CollectionCreation @@ -463,6 +483,7 @@ def create_collection_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Collection", '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -494,7 +515,7 @@ def create_collection_without_preload_content( ) -> RESTResponseType: """Create a new collection - This method will create a new collection and add it to your `root` collection. + This method will create a new collection in your account. :param body: (required) :type body: CollectionCreation @@ -531,6 +552,7 @@ def create_collection_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Collection", '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -557,7 +579,9 @@ def _create_collection_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -570,11 +594,12 @@ def _create_collection_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -616,7 +641,7 @@ def _create_collection_serialize( @validate_call def delete_collection( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -634,7 +659,7 @@ def delete_collection( This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -670,6 +695,7 @@ def delete_collection( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -685,7 +711,7 @@ def delete_collection( @validate_call def delete_collection_with_http_info( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -703,7 +729,7 @@ def delete_collection_with_http_info( This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -739,6 +765,7 @@ def delete_collection_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -754,7 +781,7 @@ def delete_collection_with_http_info( @validate_call def delete_collection_without_preload_content( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -772,7 +799,7 @@ def delete_collection_without_preload_content( This method will schedule the deletion of the collection. Until deleted, the collection will be available in the `trash`. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -808,6 +835,7 @@ def delete_collection_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -834,7 +862,9 @@ def _delete_collection_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -847,11 +877,12 @@ def _delete_collection_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -880,8 +911,9 @@ def _delete_collection_serialize( @validate_call def delete_score_from_collection( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -900,10 +932,12 @@ def delete_score_from_collection( This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) :type collection: str :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str :param _request_timeout: timeout setting for this request. If one @@ -931,6 +965,7 @@ def delete_score_from_collection( _param = self._delete_score_from_collection_serialize( collection=collection, score=score, + event_properties=event_properties, sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, @@ -942,6 +977,7 @@ def delete_score_from_collection( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -957,8 +993,9 @@ def delete_score_from_collection( @validate_call def delete_score_from_collection_with_http_info( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -977,10 +1014,12 @@ def delete_score_from_collection_with_http_info( This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) :type collection: str :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str :param _request_timeout: timeout setting for this request. If one @@ -1008,6 +1047,7 @@ def delete_score_from_collection_with_http_info( _param = self._delete_score_from_collection_serialize( collection=collection, score=score, + event_properties=event_properties, sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, @@ -1019,6 +1059,7 @@ def delete_score_from_collection_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1034,8 +1075,9 @@ def delete_score_from_collection_with_http_info( @validate_call def delete_score_from_collection_without_preload_content( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted ")], score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -1054,10 +1096,12 @@ def delete_score_from_collection_without_preload_content( This method will delete a score from the collection. Unlike [`DELETE /scores/{score}`](#operation/deleteScore), this score will not remove the score from your account, but only from the collection. This can be used to *move* a score from one collection to another, or simply remove a score from one collection when this one is contained in multiple collections. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted (required) :type collection: str :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str :param _request_timeout: timeout setting for this request. If one @@ -1085,6 +1129,7 @@ def delete_score_from_collection_without_preload_content( _param = self._delete_score_from_collection_serialize( collection=collection, score=score, + event_properties=event_properties, sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, @@ -1096,6 +1141,7 @@ def delete_score_from_collection_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1108,6 +1154,7 @@ def _delete_score_from_collection_serialize( self, collection, score, + event_properties, sharing_key, _request_auth, _content_type, @@ -1124,7 +1171,9 @@ def _delete_score_from_collection_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1133,6 +1182,10 @@ def _delete_score_from_collection_serialize( if score is not None: _path_params['score'] = score # process the query parameters + if event_properties is not None: + + _query_params.append(('eventProperties', event_properties)) + if sharing_key is not None: _query_params.append(('sharingKey', sharing_key)) @@ -1143,12 +1196,26 @@ def _delete_score_from_collection_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -1176,7 +1243,7 @@ def _delete_score_from_collection_serialize( @validate_call def edit_collection( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], body: CollectionModification, _request_timeout: Union[ None, @@ -1194,7 +1261,7 @@ def edit_collection( """Update a collection's metadata - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param body: (required) :type body: CollectionModification @@ -1233,6 +1300,7 @@ def edit_collection( '200': "Collection", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1248,7 +1316,7 @@ def edit_collection( @validate_call def edit_collection_with_http_info( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], body: CollectionModification, _request_timeout: Union[ None, @@ -1266,7 +1334,7 @@ def edit_collection_with_http_info( """Update a collection's metadata - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param body: (required) :type body: CollectionModification @@ -1305,6 +1373,7 @@ def edit_collection_with_http_info( '200': "Collection", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1320,7 +1389,7 @@ def edit_collection_with_http_info( @validate_call def edit_collection_without_preload_content( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], body: CollectionModification, _request_timeout: Union[ None, @@ -1338,7 +1407,7 @@ def edit_collection_without_preload_content( """Update a collection's metadata - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param body: (required) :type body: CollectionModification @@ -1377,6 +1446,7 @@ def edit_collection_without_preload_content( '200': "Collection", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1404,7 +1474,9 @@ def _edit_collection_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1419,11 +1491,12 @@ def _edit_collection_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1465,7 +1538,7 @@ def _edit_collection_serialize( @validate_call def get_collection( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -1483,7 +1556,7 @@ def get_collection( """Get collection details - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str @@ -1522,6 +1595,7 @@ def get_collection( '200': "Collection", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1537,7 +1611,7 @@ def get_collection( @validate_call def get_collection_with_http_info( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -1555,7 +1629,7 @@ def get_collection_with_http_info( """Get collection details - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str @@ -1594,6 +1668,7 @@ def get_collection_with_http_info( '200': "Collection", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1609,7 +1684,7 @@ def get_collection_with_http_info( @validate_call def get_collection_without_preload_content( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -1627,7 +1702,7 @@ def get_collection_without_preload_content( """Get collection details - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str @@ -1666,6 +1741,7 @@ def get_collection_without_preload_content( '200': "Collection", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1693,7 +1769,9 @@ def _get_collection_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1710,11 +1788,12 @@ def _get_collection_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1743,13 +1822,13 @@ def _get_collection_serialize( @validate_call def list_collection_scores( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], - sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1767,10 +1846,8 @@ def list_collection_scores( Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`. For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str - :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. - :type sharing_key: str :param sort: Sort :type sort: str :param direction: Sort direction @@ -1781,6 +1858,8 @@ def list_collection_scores( :type next: str :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. :type previous: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str :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 @@ -1805,12 +1884,12 @@ def list_collection_scores( _param = self._list_collection_scores_serialize( collection=collection, - sharing_key=sharing_key, sort=sort, direction=direction, limit=limit, next=next, previous=previous, + sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1819,6 +1898,7 @@ def list_collection_scores( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1834,13 +1914,13 @@ def list_collection_scores( @validate_call def list_collection_scores_with_http_info( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], - sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1858,10 +1938,8 @@ def list_collection_scores_with_http_info( Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`. For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str - :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. - :type sharing_key: str :param sort: Sort :type sort: str :param direction: Sort direction @@ -1872,6 +1950,8 @@ def list_collection_scores_with_http_info( :type next: str :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. :type previous: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str :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 @@ -1896,12 +1976,12 @@ def list_collection_scores_with_http_info( _param = self._list_collection_scores_serialize( collection=collection, - sharing_key=sharing_key, sort=sort, direction=direction, limit=limit, next=next, previous=previous, + sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -1910,6 +1990,7 @@ def list_collection_scores_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1925,13 +2006,13 @@ def list_collection_scores_with_http_info( @validate_call def list_collection_scores_without_preload_content( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], - sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores ")], sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -1949,10 +2030,8 @@ def list_collection_scores_without_preload_content( Use this method to list the scores contained in a collection. If no sort option is provided, the scores are sorted by `modificationDate` `desc`. For example, to list the scores contained in your app collection, you can use `GET /v2/collections/app/scores`. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. The following collection aliases are supported: - `root`: **Deprecated.** The root collection of the account - `app`: Alias for the current app collection - `trash`: Automatically contains resources that have been deleted The following virtual collections are supported: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores (required) :type collection: str - :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. - :type sharing_key: str :param sort: Sort :type sort: str :param direction: Sort direction @@ -1963,6 +2042,8 @@ def list_collection_scores_without_preload_content( :type next: str :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. :type previous: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str :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 @@ -1987,12 +2068,12 @@ def list_collection_scores_without_preload_content( _param = self._list_collection_scores_serialize( collection=collection, - sharing_key=sharing_key, sort=sort, direction=direction, limit=limit, next=next, previous=previous, + sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -2001,6 +2082,7 @@ def list_collection_scores_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2012,12 +2094,12 @@ def list_collection_scores_without_preload_content( def _list_collection_scores_serialize( self, collection, - sharing_key, sort, direction, limit, next, previous, + sharing_key, _request_auth, _content_type, _headers, @@ -2033,17 +2115,15 @@ def _list_collection_scores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if collection is not None: _path_params['collection'] = collection # process the query parameters - if sharing_key is not None: - - _query_params.append(('sharingKey', sharing_key)) - if sort is not None: _query_params.append(('sort', sort)) @@ -2064,17 +2144,22 @@ def _list_collection_scores_serialize( _query_params.append(('previous', previous)) + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2103,7 +2188,7 @@ def _list_collection_scores_serialize( @validate_call def list_collections( self, - parent: Annotated[Optional[StrictStr], Field(description="List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. ")] = None, + parent: Annotated[Optional[StrictStr], Field(description="List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. ")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, @@ -2124,9 +2209,9 @@ def list_collections( ) -> List[Collection]: """List the collections - Use this method to list the user's collections contained in `parent` (by default in the `root` collection). If no sort option is provided, the collections are sorted by `creationDate` `desc`. Note that this method will not include the `parent` collection in the listing. For example, if you need the details of the `root` collection, you can use `GET /v2/collections/root`. To fetch your app collection details, you can use `GET /v2/collections/app`. + Use this method to list the user's collections. If no sort option is provided, the collections are sorted by `creationDate` `desc`. By default (`parent=user`), this returns all user account collections with virtual collections on the first page. To fetch your app collection details, you can use `GET /v2/collections/app`. - :param parent: List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. + :param parent: List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. :type parent: str :param sort: Sort :type sort: str @@ -2175,6 +2260,7 @@ def list_collections( _response_types_map: Dict[str, Optional[str]] = { '200': "List[Collection]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2190,7 +2276,7 @@ def list_collections( @validate_call def list_collections_with_http_info( self, - parent: Annotated[Optional[StrictStr], Field(description="List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. ")] = None, + parent: Annotated[Optional[StrictStr], Field(description="List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. ")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, @@ -2211,9 +2297,9 @@ def list_collections_with_http_info( ) -> ApiResponse[List[Collection]]: """List the collections - Use this method to list the user's collections contained in `parent` (by default in the `root` collection). If no sort option is provided, the collections are sorted by `creationDate` `desc`. Note that this method will not include the `parent` collection in the listing. For example, if you need the details of the `root` collection, you can use `GET /v2/collections/root`. To fetch your app collection details, you can use `GET /v2/collections/app`. + Use this method to list the user's collections. If no sort option is provided, the collections are sorted by `creationDate` `desc`. By default (`parent=user`), this returns all user account collections with virtual collections on the first page. To fetch your app collection details, you can use `GET /v2/collections/app`. - :param parent: List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. + :param parent: List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. :type parent: str :param sort: Sort :type sort: str @@ -2262,6 +2348,7 @@ def list_collections_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[Collection]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2277,7 +2364,7 @@ def list_collections_with_http_info( @validate_call def list_collections_without_preload_content( self, - parent: Annotated[Optional[StrictStr], Field(description="List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. ")] = None, + parent: Annotated[Optional[StrictStr], Field(description="List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. ")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, @@ -2298,9 +2385,9 @@ def list_collections_without_preload_content( ) -> RESTResponseType: """List the collections - Use this method to list the user's collections contained in `parent` (by default in the `root` collection). If no sort option is provided, the collections are sorted by `creationDate` `desc`. Note that this method will not include the `parent` collection in the listing. For example, if you need the details of the `root` collection, you can use `GET /v2/collections/root`. To fetch your app collection details, you can use `GET /v2/collections/app`. + Use this method to list the user's collections. If no sort option is provided, the collections are sorted by `creationDate` `desc`. By default (`parent=user`), this returns all user account collections with virtual collections on the first page. To fetch your app collection details, you can use `GET /v2/collections/app`. - :param parent: List the collection contained in this `parent` collection. This option doesn't provide a complete multi-level collection support. When sharing a collection with someone, this one will have as `parent` `sharedWithMe`. + :param parent: List the collections contained in this `parent` collection. When set to `user` (default), returns the user's own collections as well as collections shared with the user. Using `root` or `sharedWithMe` is **deprecated** and will be treated as `user`. :type parent: str :param sort: Sort :type sort: str @@ -2349,6 +2436,7 @@ def list_collections_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[Collection]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2380,7 +2468,9 @@ def _list_collections_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2415,11 +2505,12 @@ def _list_collections_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2448,7 +2539,7 @@ def _list_collections_serialize( @validate_call def untrash_collection( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2461,12 +2552,12 @@ def untrash_collection( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> None: - """Untrash a collection + ) -> FlatErrorResponse: + """(Deprecated) Untrash a collection - This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. (required) :type collection: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2489,6 +2580,7 @@ def untrash_collection( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /collections/{collection}/untrash is deprecated.", DeprecationWarning) _param = self._untrash_collection_serialize( collection=collection, @@ -2499,9 +2591,8 @@ def untrash_collection( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2517,7 +2608,7 @@ def untrash_collection( @validate_call def untrash_collection_with_http_info( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2530,12 +2621,12 @@ def untrash_collection_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[None]: - """Untrash a collection + ) -> ApiResponse[FlatErrorResponse]: + """(Deprecated) Untrash a collection - This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. (required) :type collection: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2558,6 +2649,7 @@ def untrash_collection_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /collections/{collection}/untrash is deprecated.", DeprecationWarning) _param = self._untrash_collection_serialize( collection=collection, @@ -2568,9 +2660,8 @@ def untrash_collection_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2586,7 +2677,7 @@ def untrash_collection_with_http_info( @validate_call def untrash_collection_without_preload_content( self, - collection: Annotated[StrictStr, Field(description="Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted ")], + collection: Annotated[StrictStr, Field(description="Unique identifier of the collection.")], _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -2600,11 +2691,11 @@ def untrash_collection_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Untrash a collection + """(Deprecated) Untrash a collection - This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. + **DEPRECATED** This method will restore the collection by removing it from the `trash` and add it back to the `root` collection. - :param collection: Unique identifier of the collection. The following aliases are supported: - `root`: The root collection of the account - `app`: Alias for the current app collection - `sharedWithMe`: Automatically contains new resources that have been shared individually - `trash`: Automatically contains resources that have been deleted (required) + :param collection: Unique identifier of the collection. (required) :type collection: str :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -2627,6 +2718,7 @@ def untrash_collection_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /collections/{collection}/untrash is deprecated.", DeprecationWarning) _param = self._untrash_collection_serialize( collection=collection, @@ -2637,9 +2729,8 @@ def untrash_collection_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '204': None, - '403': "FlatErrorResponse", - '404': "FlatErrorResponse", + '400': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2666,7 +2757,9 @@ def _untrash_collection_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2679,11 +2772,12 @@ def _untrash_collection_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/flat_api/api/edu_resources_api.py b/flat_api/api/edu_resources_api.py index edf488f..c8232ce 100644 --- a/flat_api/api/edu_resources_api.py +++ b/flat_api/api/edu_resources_api.py @@ -1,26 +1,26 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr, field_validator -from typing import Optional +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import List, Optional from typing_extensions import Annotated from flat_api.models.assignment import Assignment +from flat_api.models.assignment_type import AssignmentType from flat_api.models.assignment_update import AssignmentUpdate from flat_api.models.class_assignment import ClassAssignment from flat_api.models.edu_library import EduLibrary @@ -31,6 +31,8 @@ from flat_api.models.edu_resource_move import EduResourceMove from flat_api.models.edu_resource_update import EduResourceUpdate from flat_api.models.edu_resource_use_in_class import EduResourceUseInClass +from flat_api.models.grade import Grade +from flat_api.models.teaching_theme import TeachingTheme from flat_api.api_client import ApiClient, RequestSerialized from flat_api.api_response import ApiResponse @@ -108,6 +110,7 @@ def copy_edu_resource( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -178,6 +181,7 @@ def copy_edu_resource_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -248,6 +252,7 @@ def copy_edu_resource_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -275,7 +280,9 @@ def _copy_edu_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -290,11 +297,12 @@ def _copy_edu_resource_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -388,6 +396,7 @@ def copy_edu_resource_to_demo_class( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassAssignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -455,6 +464,7 @@ def copy_edu_resource_to_demo_class_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassAssignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -522,6 +532,7 @@ def copy_edu_resource_to_demo_class_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassAssignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -548,7 +559,9 @@ def _copy_edu_resource_to_demo_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -561,11 +574,12 @@ def _copy_edu_resource_to_demo_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -645,6 +659,7 @@ def create_edu_resource( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -711,6 +726,7 @@ def create_edu_resource_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -777,6 +793,7 @@ def create_edu_resource_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -803,7 +820,9 @@ def _create_edu_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -816,11 +835,12 @@ def _create_edu_resource_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -914,6 +934,7 @@ def create_edu_resource_lti_link( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResourceLtiLink", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -981,6 +1002,7 @@ def create_edu_resource_lti_link_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResourceLtiLink", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1048,6 +1070,7 @@ def create_edu_resource_lti_link_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResourceLtiLink", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1074,7 +1097,9 @@ def _create_edu_resource_lti_link_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1087,11 +1112,12 @@ def _create_edu_resource_lti_link_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1171,6 +1197,7 @@ def delete_edu_resource( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1237,6 +1264,7 @@ def delete_edu_resource_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1303,6 +1331,7 @@ def delete_edu_resource_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1329,7 +1358,9 @@ def _delete_edu_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1342,11 +1373,12 @@ def _delete_edu_resource_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1426,6 +1458,7 @@ def get_edu_resource( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1492,6 +1525,7 @@ def get_edu_resource_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1558,6 +1592,7 @@ def get_edu_resource_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1584,7 +1619,9 @@ def _get_edu_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1597,11 +1634,12 @@ def _get_edu_resource_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1677,6 +1715,7 @@ def list_edu_libraries( _response_types_map: Dict[str, Optional[str]] = { '200': "List[EduLibrary]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1739,6 +1778,7 @@ def list_edu_libraries_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[EduLibrary]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1801,6 +1841,7 @@ def list_edu_libraries_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[EduLibrary]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1826,7 +1867,9 @@ def _list_edu_libraries_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1837,11 +1880,12 @@ def _list_edu_libraries_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1870,8 +1914,12 @@ def _list_edu_libraries_serialize( @validate_call def list_edu_resources( self, - parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder ")] = None, + parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization ")] = None, + without_subfolders_resources: Annotated[Optional[StrictBool], Field(description="For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. ")] = None, type: Annotated[Optional[StrictStr], Field(description="Filter the returned resources by type ")] = None, + subjects: Annotated[Optional[List[TeachingTheme]], Field(description="Filter the returned resources by subjects ")] = None, + assignment_types: Annotated[Optional[List[AssignmentType]], Field(description="Filter the returned resources by assignment types ")] = None, + grades: Annotated[Optional[List[Grade]], Field(description="Filter the returned resources by grades ")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of resources that may be returned")] = None, @@ -1893,10 +1941,18 @@ def list_edu_resources( """List education resources in a library or folder - :param parent: List the resources contained in this `parent` library or folder + :param parent: List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization :type parent: str + :param without_subfolders_resources: For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. + :type without_subfolders_resources: bool :param type: Filter the returned resources by type :type type: str + :param subjects: Filter the returned resources by subjects + :type subjects: List[TeachingTheme] + :param assignment_types: Filter the returned resources by assignment types + :type assignment_types: List[AssignmentType] + :param grades: Filter the returned resources by grades + :type grades: List[Grade] :param sort: Sort :type sort: str :param direction: Sort direction @@ -1931,7 +1987,11 @@ def list_edu_resources( _param = self._list_edu_resources_serialize( parent=parent, + without_subfolders_resources=without_subfolders_resources, type=type, + subjects=subjects, + assignment_types=assignment_types, + grades=grades, sort=sort, direction=direction, limit=limit, @@ -1945,6 +2005,7 @@ def list_edu_resources( _response_types_map: Dict[str, Optional[str]] = { '200': "List[EduResource]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1960,8 +2021,12 @@ def list_edu_resources( @validate_call def list_edu_resources_with_http_info( self, - parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder ")] = None, + parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization ")] = None, + without_subfolders_resources: Annotated[Optional[StrictBool], Field(description="For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. ")] = None, type: Annotated[Optional[StrictStr], Field(description="Filter the returned resources by type ")] = None, + subjects: Annotated[Optional[List[TeachingTheme]], Field(description="Filter the returned resources by subjects ")] = None, + assignment_types: Annotated[Optional[List[AssignmentType]], Field(description="Filter the returned resources by assignment types ")] = None, + grades: Annotated[Optional[List[Grade]], Field(description="Filter the returned resources by grades ")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of resources that may be returned")] = None, @@ -1983,10 +2048,18 @@ def list_edu_resources_with_http_info( """List education resources in a library or folder - :param parent: List the resources contained in this `parent` library or folder + :param parent: List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization :type parent: str + :param without_subfolders_resources: For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. + :type without_subfolders_resources: bool :param type: Filter the returned resources by type :type type: str + :param subjects: Filter the returned resources by subjects + :type subjects: List[TeachingTheme] + :param assignment_types: Filter the returned resources by assignment types + :type assignment_types: List[AssignmentType] + :param grades: Filter the returned resources by grades + :type grades: List[Grade] :param sort: Sort :type sort: str :param direction: Sort direction @@ -2021,7 +2094,11 @@ def list_edu_resources_with_http_info( _param = self._list_edu_resources_serialize( parent=parent, + without_subfolders_resources=without_subfolders_resources, type=type, + subjects=subjects, + assignment_types=assignment_types, + grades=grades, sort=sort, direction=direction, limit=limit, @@ -2035,6 +2112,7 @@ def list_edu_resources_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[EduResource]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2050,8 +2128,12 @@ def list_edu_resources_with_http_info( @validate_call def list_edu_resources_without_preload_content( self, - parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder ")] = None, + parent: Annotated[Optional[StrictStr], Field(description="List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization ")] = None, + without_subfolders_resources: Annotated[Optional[StrictBool], Field(description="For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. ")] = None, type: Annotated[Optional[StrictStr], Field(description="Filter the returned resources by type ")] = None, + subjects: Annotated[Optional[List[TeachingTheme]], Field(description="Filter the returned resources by subjects ")] = None, + assignment_types: Annotated[Optional[List[AssignmentType]], Field(description="Filter the returned resources by assignment types ")] = None, + grades: Annotated[Optional[List[Grade]], Field(description="Filter the returned resources by grades ")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of resources that may be returned")] = None, @@ -2073,10 +2155,18 @@ def list_edu_resources_without_preload_content( """List education resources in a library or folder - :param parent: List the resources contained in this `parent` library or folder + :param parent: List the resources contained in this `parent` library or folder. Accepts a folder identifier, or the identifier of one of the libraries returned by [`listEduLibraries`](#tag/EduResources/operation/listEduLibraries). Which libraries are available depends on the account, so use the `id` values that endpoint returns rather than hardcoding this list: * `root`: the user's own resources * `organization`: resources shared with the organization :type parent: str + :param without_subfolders_resources: For the `parent` = `organization`, do not include resources from subfolders. By default in the Resource Library UI, we include resources from subfolders, but for example in a picker like LTI, we don't want to include them. + :type without_subfolders_resources: bool :param type: Filter the returned resources by type :type type: str + :param subjects: Filter the returned resources by subjects + :type subjects: List[TeachingTheme] + :param assignment_types: Filter the returned resources by assignment types + :type assignment_types: List[AssignmentType] + :param grades: Filter the returned resources by grades + :type grades: List[Grade] :param sort: Sort :type sort: str :param direction: Sort direction @@ -2111,7 +2201,11 @@ def list_edu_resources_without_preload_content( _param = self._list_edu_resources_serialize( parent=parent, + without_subfolders_resources=without_subfolders_resources, type=type, + subjects=subjects, + assignment_types=assignment_types, + grades=grades, sort=sort, direction=direction, limit=limit, @@ -2125,6 +2219,7 @@ def list_edu_resources_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[EduResource]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2136,7 +2231,11 @@ def list_edu_resources_without_preload_content( def _list_edu_resources_serialize( self, parent, + without_subfolders_resources, type, + subjects, + assignment_types, + grades, sort, direction, limit, @@ -2151,13 +2250,18 @@ def _list_edu_resources_serialize( _host = None _collection_formats: Dict[str, str] = { + 'subjects': 'multi', + 'assignmentTypes': 'multi', + 'grades': 'multi', } _path_params: Dict[str, str] = {} _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2166,10 +2270,26 @@ def _list_edu_resources_serialize( _query_params.append(('parent', parent)) + if without_subfolders_resources is not None: + + _query_params.append(('withoutSubfoldersResources', without_subfolders_resources)) + if type is not None: _query_params.append(('type', type)) + if subjects is not None: + + _query_params.append(('subjects', subjects)) + + if assignment_types is not None: + + _query_params.append(('assignmentTypes', assignment_types)) + + if grades is not None: + + _query_params.append(('grades', grades)) + if sort is not None: _query_params.append(('sort', sort)) @@ -2196,11 +2316,12 @@ def _list_edu_resources_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2284,6 +2405,7 @@ def move_edu_resource( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2354,6 +2476,7 @@ def move_edu_resource_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2424,6 +2547,7 @@ def move_edu_resource_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2451,7 +2575,9 @@ def _move_edu_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2466,11 +2592,12 @@ def _move_edu_resource_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2568,6 +2695,7 @@ def update_edu_resource( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2639,6 +2767,7 @@ def update_edu_resource_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2710,6 +2839,7 @@ def update_edu_resource_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "EduResource", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2737,7 +2867,9 @@ def _update_edu_resource_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2752,11 +2884,12 @@ def _update_edu_resource_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2853,6 +2986,7 @@ def update_edu_resource_assignment( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2923,6 +3057,7 @@ def update_edu_resource_assignment_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2993,6 +3128,7 @@ def update_edu_resource_assignment_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Assignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3020,7 +3156,9 @@ def _update_edu_resource_assignment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3035,11 +3173,12 @@ def _update_edu_resource_assignment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -3137,6 +3276,7 @@ def use_edu_resource_in_class( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassAssignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3208,6 +3348,7 @@ def use_edu_resource_in_class_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassAssignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3279,6 +3420,7 @@ def use_edu_resource_in_class_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ClassAssignment", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3306,7 +3448,9 @@ def _use_edu_resource_in_class_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3321,11 +3465,12 @@ def _use_edu_resource_in_class_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/flat_api/api/group_api.py b/flat_api/api/group_api.py index 75cc0c4..11eb1ea 100644 --- a/flat_api/api/group_api.py +++ b/flat_api/api/group_api.py @@ -1,26 +1,29 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated from pydantic import Field, StrictStr, field_validator -from typing import Optional +from typing import List, Optional from typing_extensions import Annotated +from flat_api.models.add_group_user200_response import AddGroupUser200Response +from flat_api.models.add_group_user_request import AddGroupUserRequest +from flat_api.models.group_creation import GroupCreation from flat_api.models.group_details import GroupDetails +from flat_api.models.rename_group_request import RenameGroupRequest from flat_api.models.score_details import ScoreDetails from flat_api.models.user_public import UserPublic @@ -43,9 +46,10 @@ def __init__(self, api_client=None) -> None: @validate_call - def get_group_details( + def add_group_user( self, group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + add_group_user_request: AddGroupUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -58,12 +62,15 @@ def get_group_details( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> GroupDetails: - """Get group information + ) -> AddGroupUser200Response: + """Add a student to a group + Add a student to the specified group (must be in the same class) :param group: Unique identifier of a Flat group (required) :type group: str + :param add_group_user_request: (required) + :type add_group_user_request: AddGroupUserRequest :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 @@ -86,8 +93,9 @@ def get_group_details( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_details_serialize( + _param = self._add_group_user_serialize( group=group, + add_group_user_request=add_group_user_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -95,7 +103,11 @@ def get_group_details( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GroupDetails", + '200': "AddGroupUser200Response", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -109,9 +121,10 @@ def get_group_details( @validate_call - def get_group_details_with_http_info( + def add_group_user_with_http_info( self, group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + add_group_user_request: AddGroupUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -124,12 +137,15 @@ def get_group_details_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[GroupDetails]: - """Get group information + ) -> ApiResponse[AddGroupUser200Response]: + """Add a student to a group + Add a student to the specified group (must be in the same class) :param group: Unique identifier of a Flat group (required) :type group: str + :param add_group_user_request: (required) + :type add_group_user_request: AddGroupUserRequest :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 @@ -152,8 +168,9 @@ def get_group_details_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_details_serialize( + _param = self._add_group_user_serialize( group=group, + add_group_user_request=add_group_user_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -161,7 +178,11 @@ def get_group_details_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GroupDetails", + '200': "AddGroupUser200Response", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -175,9 +196,10 @@ def get_group_details_with_http_info( @validate_call - def get_group_details_without_preload_content( + def add_group_user_without_preload_content( self, group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + add_group_user_request: AddGroupUserRequest, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -191,11 +213,14 @@ def get_group_details_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Get group information + """Add a student to a group + Add a student to the specified group (must be in the same class) :param group: Unique identifier of a Flat group (required) :type group: str + :param add_group_user_request: (required) + :type add_group_user_request: AddGroupUserRequest :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 @@ -218,8 +243,9 @@ def get_group_details_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_details_serialize( + _param = self._add_group_user_serialize( group=group, + add_group_user_request=add_group_user_request, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -227,7 +253,11 @@ def get_group_details_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "GroupDetails", + '200': "AddGroupUser200Response", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -236,9 +266,10 @@ def get_group_details_without_preload_content( return response_data.response - def _get_group_details_serialize( + def _add_group_user_serialize( self, group, + add_group_user_request, _request_auth, _content_type, _headers, @@ -254,7 +285,9 @@ def _get_group_details_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -264,15 +297,31 @@ def _get_group_details_serialize( # process the header parameters # process the form parameters # process the body parameter + if add_group_user_request is not None: + _body_params = add_group_user_request # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -280,8 +329,8 @@ def _get_group_details_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/groups/{group}', + method='POST', + resource_path='/groups/{group}/users', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -298,10 +347,9 @@ def _get_group_details_serialize( @validate_call - def get_group_scores( + def create_group( self, - group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + group_creation: GroupCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -314,15 +362,13 @@ def get_group_scores( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[ScoreDetails]: - """List group's scores + ) -> GroupDetails: + """Create a new group - Get the list of scores shared with a group. + Create a group of the given type, tied to a classroom, optionally with initial members. - :param group: Unique identifier of a Flat group (required) - :type group: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param group_creation: (required) + :type group_creation: GroupCreation :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 @@ -345,9 +391,8 @@ def get_group_scores( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_scores_serialize( - group=group, - parent=parent, + _param = self._create_group_serialize( + group_creation=group_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -355,7 +400,11 @@ def get_group_scores( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ScoreDetails]", + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -369,10 +418,9 @@ def get_group_scores( @validate_call - def get_group_scores_with_http_info( + def create_group_with_http_info( self, - group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + group_creation: GroupCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -385,15 +433,13 @@ def get_group_scores_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[ScoreDetails]]: - """List group's scores + ) -> ApiResponse[GroupDetails]: + """Create a new group - Get the list of scores shared with a group. + Create a group of the given type, tied to a classroom, optionally with initial members. - :param group: Unique identifier of a Flat group (required) - :type group: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param group_creation: (required) + :type group_creation: GroupCreation :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 @@ -416,9 +462,8 @@ def get_group_scores_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_scores_serialize( - group=group, - parent=parent, + _param = self._create_group_serialize( + group_creation=group_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -426,7 +471,11 @@ def get_group_scores_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ScoreDetails]", + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -440,10 +489,9 @@ def get_group_scores_with_http_info( @validate_call - def get_group_scores_without_preload_content( + def create_group_without_preload_content( self, - group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + group_creation: GroupCreation, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -457,14 +505,12 @@ def get_group_scores_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List group's scores + """Create a new group - Get the list of scores shared with a group. + Create a group of the given type, tied to a classroom, optionally with initial members. - :param group: Unique identifier of a Flat group (required) - :type group: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param group_creation: (required) + :type group_creation: GroupCreation :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 @@ -487,9 +533,8 @@ def get_group_scores_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._get_group_scores_serialize( - group=group, - parent=parent, + _param = self._create_group_serialize( + group_creation=group_creation, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -497,7 +542,11 @@ def get_group_scores_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[ScoreDetails]", + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -506,10 +555,9 @@ def get_group_scores_without_preload_content( return response_data.response - def _get_group_scores_serialize( + def _create_group_serialize( self, - group, - parent, + group_creation, _request_auth, _content_type, _headers, @@ -525,29 +573,41 @@ def _get_group_scores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters - if group is not None: - _path_params['group'] = group # process the query parameters - if parent is not None: - - _query_params.append(('parent', parent)) - # process the header parameters # process the form parameters # process the body parameter + if group_creation is not None: + _body_params = group_creation # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) - + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -555,8 +615,8 @@ def _get_group_scores_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/groups/{group}/scores', + method='POST', + resource_path='/groups', path_params=_path_params, query_params=_query_params, header_params=_header_params, @@ -573,10 +633,9 @@ def _get_group_scores_serialize( @validate_call - def list_group_users( + def delete_group( self, group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], - source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -589,14 +648,13 @@ def list_group_users( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[UserPublic]: - """List group's users + ) -> None: + """Delete a group + Delete a group. Only available to teachers of the classroom. :param group: Unique identifier of a Flat group (required) :type group: str - :param source: Filter the users by their source - :type source: str :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 @@ -619,9 +677,8 @@ def list_group_users( :return: Returns the result object. """ # noqa: E501 - _param = self._list_group_users_serialize( + _param = self._delete_group_serialize( group=group, - source=source, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -629,7 +686,10 @@ def list_group_users( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[UserPublic]", + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -643,10 +703,9 @@ def list_group_users( @validate_call - def list_group_users_with_http_info( + def delete_group_with_http_info( self, group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], - source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -659,14 +718,13 @@ def list_group_users_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[UserPublic]]: - """List group's users + ) -> ApiResponse[None]: + """Delete a group + Delete a group. Only available to teachers of the classroom. :param group: Unique identifier of a Flat group (required) :type group: str - :param source: Filter the users by their source - :type source: str :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 @@ -689,9 +747,8 @@ def list_group_users_with_http_info( :return: Returns the result object. """ # noqa: E501 - _param = self._list_group_users_serialize( + _param = self._delete_group_serialize( group=group, - source=source, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -699,7 +756,10 @@ def list_group_users_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[UserPublic]", + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -713,10 +773,9 @@ def list_group_users_with_http_info( @validate_call - def list_group_users_without_preload_content( + def delete_group_without_preload_content( self, group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], - source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -730,13 +789,12 @@ def list_group_users_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List group's users + """Delete a group + Delete a group. Only available to teachers of the classroom. :param group: Unique identifier of a Flat group (required) :type group: str - :param source: Filter the users by their source - :type source: str :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 @@ -759,9 +817,8 @@ def list_group_users_without_preload_content( :return: Returns the result object. """ # noqa: E501 - _param = self._list_group_users_serialize( + _param = self._delete_group_serialize( group=group, - source=source, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -769,7 +826,10 @@ def list_group_users_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[UserPublic]", + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -778,10 +838,9 @@ def list_group_users_without_preload_content( return response_data.response - def _list_group_users_serialize( + def _delete_group_serialize( self, group, - source, _request_auth, _content_type, _headers, @@ -797,28 +856,27 @@ def _list_group_users_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if group is not None: _path_params['group'] = group # process the query parameters - if source is not None: - - _query_params.append(('source', source)) - # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -827,8 +885,1735 @@ def _list_group_users_serialize( ] return self.api_client.param_serialize( - method='GET', - resource_path='/groups/{group}/users', + method='DELETE', + resource_path='/groups/{group}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_group_details( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupDetails: + """Get group information + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_details_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_group_details_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupDetails]: + """Get group information + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_details_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_group_details_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get group information + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_details_serialize( + group=group, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_details_serialize( + self, + group, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_group_scores( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ScoreDetails]: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_group_scores_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ScoreDetails]]: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_group_scores_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List group's scores + + Get the list of scores shared with a group. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param parent: Filter the score forked from the score id `parent` + :type parent: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_group_scores_serialize( + group=group, + parent=parent, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_group_scores_serialize( + self, + group, + parent, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + if parent is not None: + + _query_params.append(('parent', parent)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group}/scores', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_group_users( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[UserPublic]: + """List group's users + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param source: Filter the users by their source + :type source: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_users_serialize( + group=group, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserPublic]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_group_users_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[UserPublic]]: + """List group's users + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param source: Filter the users by their source + :type source: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_users_serialize( + group=group, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserPublic]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_group_users_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + source: Annotated[Optional[StrictStr], Field(description="Filter the users by their source ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List group's users + + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param source: Filter the users by their source + :type source: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_group_users_serialize( + group=group, + source=source, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserPublic]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_group_users_serialize( + self, + group, + source, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + if source is not None: + + _query_params.append(('source', source)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups/{group}/users', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_groups( + self, + type: StrictStr, + classroom: Annotated[Optional[StrictStr], Field(description="Classroom ID to filter by")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="Assignment ID to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GroupDetails]: + """List groups + + List all groups of a given type, filtered by either a classroom or an assignment. + + :param type: (required) + :type type: str + :param classroom: Classroom ID to filter by + :type classroom: str + :param assignment: Assignment ID to filter by + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + type=type, + classroom=classroom, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GroupDetails]", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_groups_with_http_info( + self, + type: StrictStr, + classroom: Annotated[Optional[StrictStr], Field(description="Classroom ID to filter by")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="Assignment ID to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GroupDetails]]: + """List groups + + List all groups of a given type, filtered by either a classroom or an assignment. + + :param type: (required) + :type type: str + :param classroom: Classroom ID to filter by + :type classroom: str + :param assignment: Assignment ID to filter by + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + type=type, + classroom=classroom, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GroupDetails]", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_groups_without_preload_content( + self, + type: StrictStr, + classroom: Annotated[Optional[StrictStr], Field(description="Classroom ID to filter by")] = None, + assignment: Annotated[Optional[StrictStr], Field(description="Assignment ID to filter by")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List groups + + List all groups of a given type, filtered by either a classroom or an assignment. + + :param type: (required) + :type type: str + :param classroom: Classroom ID to filter by + :type classroom: str + :param assignment: Assignment ID to filter by + :type assignment: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_groups_serialize( + type=type, + classroom=classroom, + assignment=assignment, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GroupDetails]", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_groups_serialize( + self, + type, + classroom, + assignment, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if type is not None: + + _query_params.append(('type', type)) + + if classroom is not None: + + _query_params.append(('classroom', classroom)) + + if assignment is not None: + + _query_params.append(('assignment', assignment)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/groups', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def remove_group_user( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + user: Annotated[StrictStr, Field(description="User ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Remove a student from a class group + + Remove a student from a class group + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param user: User ID (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_user_serialize( + group=group, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def remove_group_user_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + user: Annotated[StrictStr, Field(description="User ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Remove a student from a class group + + Remove a student from a class group + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param user: User ID (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_user_serialize( + group=group, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def remove_group_user_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + user: Annotated[StrictStr, Field(description="User ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Remove a student from a class group + + Remove a student from a class group + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param user: User ID (required) + :type user: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._remove_group_user_serialize( + group=group, + user=user, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _remove_group_user_serialize( + self, + group, + user, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + if user is not None: + _path_params['user'] = user + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/groups/{group}/users/{user}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def rename_group( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + rename_group_request: RenameGroupRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GroupDetails: + """Rename a group + + Rename a sub-group. Only available for class student groups. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param rename_group_request: (required) + :type rename_group_request: RenameGroupRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_group_serialize( + group=group, + rename_group_request=rename_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def rename_group_with_http_info( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + rename_group_request: RenameGroupRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GroupDetails]: + """Rename a group + + Rename a sub-group. Only available for class student groups. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param rename_group_request: (required) + :type rename_group_request: RenameGroupRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_group_serialize( + group=group, + rename_group_request=rename_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def rename_group_without_preload_content( + self, + group: Annotated[StrictStr, Field(description="Unique identifier of a Flat group ")], + rename_group_request: RenameGroupRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Rename a group + + Rename a sub-group. Only available for class student groups. + + :param group: Unique identifier of a Flat group (required) + :type group: str + :param rename_group_request: (required) + :type rename_group_request: RenameGroupRequest + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._rename_group_serialize( + group=group, + rename_group_request=rename_group_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GroupDetails", + '400': "FlatErrorResponse", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _rename_group_serialize( + self, + group, + rename_group_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if group is not None: + _path_params['group'] = group + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if rename_group_request is not None: + _body_params = rename_group_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/groups/{group}', path_params=_path_params, query_params=_query_params, header_params=_header_params, diff --git a/flat_api/api/omr_api.py b/flat_api/api/omr_api.py new file mode 100644 index 0000000..acac54d --- /dev/null +++ b/flat_api/api/omr_api.py @@ -0,0 +1,3646 @@ +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictBytes, StrictInt, StrictStr, field_validator +from typing import List, Optional, Tuple, Union +from typing_extensions import Annotated +from flat_api.models.credit_transaction import CreditTransaction +from flat_api.models.omr_capabilities import OmrCapabilities +from flat_api.models.omr_details_submission import OmrDetailsSubmission +from flat_api.models.omr_job import OmrJob +from flat_api.models.omr_job_creation import OmrJobCreation +from flat_api.models.omr_job_file_upload import OmrJobFileUpload +from flat_api.models.omr_job_file_upload_result import OmrJobFileUploadResult +from flat_api.models.omr_job_status import OmrJobStatus +from flat_api.models.omr_step_name import OmrStepName + +from flat_api.api_client import ApiClient, RequestSerialized +from flat_api.api_response import ApiResponse +from flat_api.rest import RESTResponseType + + +class OMRApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + def add_omr_job_file( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + omr_job_file_upload: OmrJobFileUpload, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJobFileUploadResult: + """Add a file to an OMR job + + Add one image or PDF to a draft job. Call once per file; files keep their upload order. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param omr_job_file_upload: (required) + :type omr_job_file_upload: OmrJobFileUpload + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_omr_job_file_serialize( + job=job, + omr_job_file_upload=omr_job_file_upload, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJobFileUploadResult", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_omr_job_file_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + omr_job_file_upload: OmrJobFileUpload, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJobFileUploadResult]: + """Add a file to an OMR job + + Add one image or PDF to a draft job. Call once per file; files keep their upload order. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param omr_job_file_upload: (required) + :type omr_job_file_upload: OmrJobFileUpload + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_omr_job_file_serialize( + job=job, + omr_job_file_upload=omr_job_file_upload, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJobFileUploadResult", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def add_omr_job_file_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + omr_job_file_upload: OmrJobFileUpload, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add a file to an OMR job + + Add one image or PDF to a draft job. Call once per file; files keep their upload order. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param omr_job_file_upload: (required) + :type omr_job_file_upload: OmrJobFileUpload + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_omr_job_file_serialize( + job=job, + omr_job_file_upload=omr_job_file_upload, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJobFileUploadResult", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _add_omr_job_file_serialize( + self, + job, + omr_job_file_upload, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + if omr_job_file_upload is not None: + _body_params = omr_job_file_upload + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/files', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def cancel_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Cancel an OMR job + + Cancel a draft or in-flight job. Any charged credits are reversed. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def cancel_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Cancel an OMR job + + Cancel a draft or in-flight job. Any charged credits are reversed. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def cancel_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Cancel an OMR job + + Cancel a draft or in-flight job. Any charged credits are reversed. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _cancel_omr_job_serialize( + self, + job, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/cancel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def create_omr_job( + self, + omr_job_creation: OmrJobCreation, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Create an OMR job + + Create an Optical Music Recognition job. There are two ways to call this endpoint: * **Draft:** send the parameters without `files` to create an empty job, then add files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple images or incremental mobile capture. * **One-shot:** include `files` and `autoStart: true` to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in `interactiveSteps`: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break. + + :param omr_job_creation: (required) + :type omr_job_creation: OmrJobCreation + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_omr_job_serialize( + omr_job_creation=omr_job_creation, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OmrJob", + '202': "OmrJob", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_omr_job_with_http_info( + self, + omr_job_creation: OmrJobCreation, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Create an OMR job + + Create an Optical Music Recognition job. There are two ways to call this endpoint: * **Draft:** send the parameters without `files` to create an empty job, then add files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple images or incremental mobile capture. * **One-shot:** include `files` and `autoStart: true` to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in `interactiveSteps`: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break. + + :param omr_job_creation: (required) + :type omr_job_creation: OmrJobCreation + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_omr_job_serialize( + omr_job_creation=omr_job_creation, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OmrJob", + '202': "OmrJob", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_omr_job_without_preload_content( + self, + omr_job_creation: OmrJobCreation, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create an OMR job + + Create an Optical Music Recognition job. There are two ways to call this endpoint: * **Draft:** send the parameters without `files` to create an empty job, then add files with `addOmrJobFile`, then run it with `startOmrJob`. Best for multiple images or incremental mobile capture. * **One-shot:** include `files` and `autoStart: true` to import in a single request. Best for a single PDF or a third-party integration. Declare the interactive steps your client supports in `interactiveSteps`: the pipeline runs fully automatically and only pauses at the steps you list. Steps you do not list, including ones added in the future, are auto-resolved with server defaults, so older clients never break. + + :param omr_job_creation: (required) + :type omr_job_creation: OmrJobCreation + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_omr_job_serialize( + omr_job_creation=omr_job_creation, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '201': "OmrJob", + '202': "OmrJob", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_omr_job_serialize( + self, + omr_job_creation, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + if omr_job_creation is not None: + _body_params = omr_job_creation + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Delete an OMR job's data + + Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the `status` it finished with, stays listable, and reports `retention.expiredDate`. Downloads then fail with `OMR_JOB_EXPIRED`. Only available for jobs whose `output` is `musicxml`. Library imports are not covered by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the resulting score instead. The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Delete an OMR job's data + + Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the `status` it finished with, stays listable, and reports `retention.expiredDate`. Downloads then fail with `OMR_JOB_EXPIRED`. Only available for jobs whose `output` is `musicxml`. Library imports are not covered by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the resulting score instead. The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an OMR job's data + + Erase a job's uploaded files and recognition results now, instead of waiting for its retention deadline. Use this to serve a deletion request from your own end user. Reaches the same end state as the scheduled cleanup: the files are gone, the job keeps the `status` it finished with, stays listable, and reports `retention.expiredDate`. Downloads then fail with `OMR_JOB_EXPIRED`. Only available for jobs whose `output` is `musicxml`. Library imports are not covered by the retention policy and are rejected with `OMR_JOB_NOT_EXPIRABLE`; delete the resulting score instead. The job must have finished (`done`, `error` or `canceled`). A draft or in-flight job is rejected with `OMR_JOB_IN_PROGRESS`: cancel it first, then delete. Deleting never cancels on your behalf, because cancellation reverses charged credits and that must not happen as a side effect of erasing data. Calling this again on an already-erased job succeeds and changes nothing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '403': "FlatErrorResponse", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_omr_job_serialize( + self, + job, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/omr/jobs/{job}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_omr_capabilities( + self, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrCapabilities: + """OMR capabilities and limits + + Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and `remainingCredits` is omitted. + + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_capabilities_serialize( + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrCapabilities", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_omr_capabilities_with_http_info( + self, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrCapabilities]: + """OMR capabilities and limits + + Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and `remainingCredits` is omitted. + + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_capabilities_serialize( + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrCapabilities", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_omr_capabilities_without_preload_content( + self, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """OMR capabilities and limits + + Advertises the supported steps, export formats, limits, cost-per-page, remaining credits and locales, so clients can feature-detect instead of hardcoding behavior. Authentication is optional: called without an account, the limits are those of the free plan and `remainingCredits` is omitted. + + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_capabilities_serialize( + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrCapabilities", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_capabilities_serialize( + self, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/capabilities', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + wait: Annotated[Optional[Annotated[int, Field(le=25, strict=True, ge=0)]], Field(description="Long-poll up to this many seconds for a state change before returning.")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Get an OMR job + + Get the current state of an OMR job. This is the primary polling endpoint. Pass `wait` to long-poll until the state changes. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param wait: Long-poll up to this many seconds for a state change before returning. + :type wait: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_serialize( + job=job, + wait=wait, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + wait: Annotated[Optional[Annotated[int, Field(le=25, strict=True, ge=0)]], Field(description="Long-poll up to this many seconds for a state change before returning.")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Get an OMR job + + Get the current state of an OMR job. This is the primary polling endpoint. Pass `wait` to long-poll until the state changes. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param wait: Long-poll up to this many seconds for a state change before returning. + :type wait: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_serialize( + job=job, + wait=wait, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + wait: Annotated[Optional[Annotated[int, Field(le=25, strict=True, ge=0)]], Field(description="Long-poll up to this many seconds for a state change before returning.")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an OMR job + + Get the current state of an OMR job. This is the primary polling endpoint. Pass `wait` to long-poll until the state changes. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param wait: Long-poll up to this many seconds for a state change before returning. + :type wait: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_serialize( + job=job, + wait=wait, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "OmrJob", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_job_serialize( + self, + job, + wait, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + if wait is not None: + + _query_params.append(('wait', wait)) + + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs/{job}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_omr_job_export( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + format: Annotated[StrictStr, Field(description="Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). ")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Download the finalized result + + Stream the finalized result in the requested format. Available once the job is `done`. For `output: musicxml` jobs this is the primary way to retrieve the result; no library score is created. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param format: Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). (required) + :type format: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_export_serialize( + job=job, + format=format, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_omr_job_export_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + format: Annotated[StrictStr, Field(description="Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). ")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Download the finalized result + + Stream the finalized result in the requested format. Available once the job is `done`. For `output: musicxml` jobs this is the primary way to retrieve the result; no library score is created. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param format: Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). (required) + :type format: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_export_serialize( + job=job, + format=format, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_omr_job_export_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + format: Annotated[StrictStr, Field(description="Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). ")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Download the finalized result + + Stream the finalized result in the requested format. Available once the job is `done`. For `output: musicxml` jobs this is the primary way to retrieve the result; no library score is created. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param format: Export format. New formats may be added over time; request what your client supports. * `musicxml`: Uncompressed MusicXML (plain text `.xml`, `application/vnd.recordare.musicxml+xml`). * `mxl`: Compressed MusicXML (zip archive `.mxl`, `application/vnd.recordare.musicxml`), the same notation as `musicxml` but smaller to download. * `midi`: Standard MIDI file (`.mid`, `audio/midi`). * `thumbnail.png`: PNG preview of the first page (`image/png`). (required) + :type format: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_export_serialize( + job=job, + format=format, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_job_export_serialize( + self, + job, + format, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + if format is not None: + _path_params['format'] = format + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/octet-stream', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs/{job}/exports/{format}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_omr_job_file( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + index: Annotated[StrictInt, Field(description="0-based index of the input file (page) to fetch.")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> bytes: + """Get an input page image + + Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read `retention.expiredDate` on the job to tell that case apart before requesting a file. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param index: 0-based index of the input file (page) to fetch. (required) + :type index: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_file_serialize( + job=job, + index=index, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_omr_job_file_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + index: Annotated[StrictInt, Field(description="0-based index of the input file (page) to fetch.")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[bytes]: + """Get an input page image + + Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read `retention.expiredDate` on the job to tell that case apart before requesting a file. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param index: 0-based index of the input file (page) to fetch. (required) + :type index: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_file_serialize( + job=job, + index=index, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_omr_job_file_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + index: Annotated[StrictInt, Field(description="0-based index of the input file (page) to fetch.")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an input page image + + Fetch one of the job's input files (a page image or PDF) by index, for the review UI. Once data retention has erased the job, this returns 409 `OMR_JOB_EXPIRED`. Read `retention.expiredDate` on the job to tell that case apart before requesting a file. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param index: 0-based index of the input file (page) to fetch. (required) + :type index: int + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_omr_job_file_serialize( + job=job, + index=index, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "bytes", + '404': "FlatErrorResponse", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_omr_job_file_serialize( + self, + job, + index, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + if index is not None: + _path_params['index'] = index + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'image/jpeg', + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs/{job}/files/{index}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_billing_credits_history( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[CreditTransaction]: + """List credit history + + The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's `state` to `canceled`. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read `state` to tell the two apart, and sum only `active` entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from `getOmrCapabilities`. + + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_billing_credits_history_serialize( + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CreditTransaction]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_billing_credits_history_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[CreditTransaction]]: + """List credit history + + The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's `state` to `canceled`. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read `state` to tell the two apart, and sum only `active` entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from `getOmrCapabilities`. + + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_billing_credits_history_serialize( + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CreditTransaction]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_billing_credits_history_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List credit history + + The credit ledger of the authenticated account, sorted by creation date descending (most recent entry first). Every entry that moved the balance is listed: the deductions taken when an import runs, and the top-ups added by a credit pack. Reversing a deduction does not add an entry, it flips the original one's `state` to `canceled`. Canceled entries stay in the list, so an import that was charged and then failed still shows its deduction rather than disappearing. Read `state` to tell the two apart, and sum only `active` entries. A refund can additionally add a positive entry when cancelling alone could not restore the full cost, for instance because the plan's allowance has since reset. The current balance is not computed from this list: read it from `getOmrCapabilities`. + + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_billing_credits_history_serialize( + limit=limit, + next=next, + previous=previous, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[CreditTransaction]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_billing_credits_history_serialize( + self, + limit, + next, + previous, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/billing/credits/history', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_omr_jobs( + self, + status: Annotated[Optional[OmrJobStatus], Field(description="Filter jobs by status")] = None, + expired: Annotated[Optional[StrictBool], Field(description="Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[OmrJob]: + """List OMR jobs + + List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + + :param status: Filter jobs by status + :type status: OmrJobStatus + :param expired: Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. + :type expired: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_omr_jobs_serialize( + status=status, + expired=expired, + limit=limit, + next=next, + previous=previous, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OmrJob]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_omr_jobs_with_http_info( + self, + status: Annotated[Optional[OmrJobStatus], Field(description="Filter jobs by status")] = None, + expired: Annotated[Optional[StrictBool], Field(description="Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[OmrJob]]: + """List OMR jobs + + List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + + :param status: Filter jobs by status + :type status: OmrJobStatus + :param expired: Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. + :type expired: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_omr_jobs_serialize( + status=status, + expired=expired, + limit=limit, + next=next, + previous=previous, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OmrJob]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_omr_jobs_without_preload_content( + self, + status: Annotated[Optional[OmrJobStatus], Field(description="Filter jobs by status")] = None, + expired: Annotated[Optional[StrictBool], Field(description="Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. ")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List OMR jobs + + List the caller's OMR jobs, for resuming work or cleaning up abandoned drafts. + + :param status: Filter jobs by status + :type status: OmrJobStatus + :param expired: Filter by data-retention state, independently of `status`. * `true`: only jobs whose files have been erased. * `false`: only jobs that still hold their files. Omit to get both. A job keeps the `status` it finished with after erasure, so this is the only way to tell the two apart. + :type expired: bool + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_omr_jobs_serialize( + status=status, + expired=expired, + limit=limit, + next=next, + previous=previous, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[OmrJob]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_omr_jobs_serialize( + self, + status, + expired, + limit, + next, + previous, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if status is not None: + + _query_params.append(('status', status.value)) + + if expired is not None: + + _query_params.append(('expired', expired)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) + + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/omr/jobs', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def start_omr_job( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Start an OMR job + + Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def start_omr_job_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Start an OMR job + + Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def start_omr_job_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Start an OMR job + + Validate the attached files, run the permission, quota and credit checks, then queue the job for processing. + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._start_omr_job_serialize( + job=job, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '400': "FlatErrorResponse", + '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _start_omr_job_serialize( + self, + job, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/start', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def submit_omr_job_step( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + step: Annotated[OmrStepName, Field(description="The pending step being submitted")], + body: OmrDetailsSubmission, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> OmrJob: + """Submit an interactive step + + Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on `step` (a `oneOf` discriminated by the step name). + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param step: The pending step being submitted (required) + :type step: OmrStepName + :param body: (required) + :type body: OmrDetailsSubmission + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_omr_job_step_serialize( + job=job, + step=step, + body=body, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def submit_omr_job_step_with_http_info( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + step: Annotated[OmrStepName, Field(description="The pending step being submitted")], + body: OmrDetailsSubmission, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[OmrJob]: + """Submit an interactive step + + Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on `step` (a `oneOf` discriminated by the step name). + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param step: The pending step being submitted (required) + :type step: OmrStepName + :param body: (required) + :type body: OmrDetailsSubmission + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_omr_job_step_serialize( + job=job, + step=step, + body=body, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def submit_omr_job_step_without_preload_content( + self, + job: Annotated[StrictStr, Field(description="Unique identifier of the OMR job")], + step: Annotated[OmrStepName, Field(description="The pending step being submitted")], + body: OmrDetailsSubmission, + x_flat_locale: Annotated[Optional[StrictStr], Field(description="Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Submit an interactive step + + Resolve the step the job is currently awaiting and resume the pipeline. The request body shape depends on `step` (a `oneOf` discriminated by the step name). + + :param job: Unique identifier of the OMR job (required) + :type job: str + :param step: The pending step being submitted (required) + :type step: OmrStepName + :param body: (required) + :type body: OmrDetailsSubmission + :param x_flat_locale: Preferred locale for localized content in the response (translated error messages, emails, etc.). Accepts any IETF language tag. The API best-matches the value to a supported locale and never rejects an unknown one (it falls back to the closest match, then to `en`). Supported normalized locales: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ko`, `ms`, `nl`, `nb`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW`. Precedence (highest first): this `X-Flat-Locale` header, the authenticated user's account locale, the `Accept-Language` header, then `en`. + :type x_flat_locale: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._submit_omr_job_step_serialize( + job=job, + step=step, + body=body, + x_flat_locale=x_flat_locale, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '202': "OmrJob", + '409': "FlatErrorResponse", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _submit_omr_job_step_serialize( + self, + job, + step, + body, + x_flat_locale, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if job is not None: + _path_params['job'] = job + if step is not None: + _path_params['step'] = step.value + # process the query parameters + # process the header parameters + if x_flat_locale is not None: + _header_params['X-Flat-Locale'] = x_flat_locale + # process the form parameters + # process the body parameter + if body is not None: + _body_params = body + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/omr/jobs/{job}/steps/{step}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/flat_api/api/organization_api.py b/flat_api/api/organization_api.py index e5675f7..415de40 100644 --- a/flat_api/api/organization_api.py +++ b/flat_api/api/organization_api.py @@ -1,26 +1,29 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, field_validator +from pydantic import Field, StrictBool, StrictInt, StrictStr, field_validator from typing import List, Optional from typing_extensions import Annotated from flat_api.models.api_access_token import ApiAccessToken +from flat_api.models.create_lti_configuration200_response import CreateLtiConfiguration200Response +from flat_api.models.lti_configuration import LtiConfiguration +from flat_api.models.lti_configuration_create import LtiConfigurationCreate +from flat_api.models.lti_configuration_update import LtiConfigurationUpdate from flat_api.models.lti_credentials import LtiCredentials from flat_api.models.lti_credentials_creation import LtiCredentialsCreation from flat_api.models.organization_invitation import OrganizationInvitation @@ -57,6 +60,7 @@ def count_orga_users( q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -69,7 +73,7 @@ def count_orga_users( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> List[UserDetailsAdmin]: + ) -> int: """Count the organization users using the provided filters @@ -81,6 +85,8 @@ def count_orga_users( :type group: List[str] :param no_active_license: Filter users who don't have an active license :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str :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 @@ -108,6 +114,7 @@ def count_orga_users( q=q, group=group, no_active_license=no_active_license, + test_accounts=test_accounts, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -115,7 +122,8 @@ def count_orga_users( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[UserDetailsAdmin]", + '200': "int", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -135,6 +143,7 @@ def count_orga_users_with_http_info( q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -147,7 +156,7 @@ def count_orga_users_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[List[UserDetailsAdmin]]: + ) -> ApiResponse[int]: """Count the organization users using the provided filters @@ -159,6 +168,8 @@ def count_orga_users_with_http_info( :type group: List[str] :param no_active_license: Filter users who don't have an active license :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str :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 @@ -186,6 +197,7 @@ def count_orga_users_with_http_info( q=q, group=group, no_active_license=no_active_license, + test_accounts=test_accounts, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -193,7 +205,8 @@ def count_orga_users_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[UserDetailsAdmin]", + '200': "int", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -213,6 +226,7 @@ def count_orga_users_without_preload_content( q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -237,6 +251,8 @@ def count_orga_users_without_preload_content( :type group: List[str] :param no_active_license: Filter users who don't have an active license :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str :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 @@ -264,6 +280,7 @@ def count_orga_users_without_preload_content( q=q, group=group, no_active_license=no_active_license, + test_accounts=test_accounts, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -271,7 +288,8 @@ def count_orga_users_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "List[UserDetailsAdmin]", + '200': "int", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -286,6 +304,7 @@ def _count_orga_users_serialize( q, group, no_active_license, + test_accounts, _request_auth, _content_type, _headers, @@ -303,7 +322,9 @@ def _count_orga_users_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -324,17 +345,22 @@ def _count_orga_users_serialize( _query_params.append(('noActiveLicense', no_active_license)) + if test_accounts is not None: + + _query_params.append(('testAccounts', test_accounts)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -360,6 +386,280 @@ def _count_orga_users_serialize( + @validate_call + def create_lti_configuration( + self, + lti_configuration_create: LtiConfigurationCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CreateLtiConfiguration200Response: + """Create a new LTI configuration (1.1 or 1.3) + + + :param lti_configuration_create: (required) + :type lti_configuration_create: LtiConfigurationCreate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_lti_configuration_serialize( + lti_configuration_create=lti_configuration_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateLtiConfiguration200Response", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_lti_configuration_with_http_info( + self, + lti_configuration_create: LtiConfigurationCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CreateLtiConfiguration200Response]: + """Create a new LTI configuration (1.1 or 1.3) + + + :param lti_configuration_create: (required) + :type lti_configuration_create: LtiConfigurationCreate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_lti_configuration_serialize( + lti_configuration_create=lti_configuration_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateLtiConfiguration200Response", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_lti_configuration_without_preload_content( + self, + lti_configuration_create: LtiConfigurationCreate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new LTI configuration (1.1 or 1.3) + + + :param lti_configuration_create: (required) + :type lti_configuration_create: LtiConfigurationCreate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_lti_configuration_serialize( + lti_configuration_create=lti_configuration_create, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "CreateLtiConfiguration200Response", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_lti_configuration_serialize( + self, + lti_configuration_create, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if lti_configuration_create is not None: + _body_params = lti_configuration_create + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/organizations/lti/configurations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def create_lti_credentials( self, @@ -377,9 +677,9 @@ def create_lti_credentials( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> LtiCredentials: - """Create a new couple of LTI 1.x credentials + """(Deprecated) Create a new couple of LTI 1.x credentials - Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). :param body: (required) :type body: LtiCredentialsCreation @@ -404,6 +704,7 @@ def create_lti_credentials( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /organizations/lti/credentials is deprecated.", DeprecationWarning) _param = self._create_lti_credentials_serialize( body=body, @@ -416,6 +717,7 @@ def create_lti_credentials( _response_types_map: Dict[str, Optional[str]] = { '200': "LtiCredentials", '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -445,9 +747,9 @@ def create_lti_credentials_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[LtiCredentials]: - """Create a new couple of LTI 1.x credentials + """(Deprecated) Create a new couple of LTI 1.x credentials - Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). :param body: (required) :type body: LtiCredentialsCreation @@ -472,6 +774,7 @@ def create_lti_credentials_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /organizations/lti/credentials is deprecated.", DeprecationWarning) _param = self._create_lti_credentials_serialize( body=body, @@ -484,6 +787,7 @@ def create_lti_credentials_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "LtiCredentials", '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -513,9 +817,9 @@ def create_lti_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Create a new couple of LTI 1.x credentials + """(Deprecated) Create a new couple of LTI 1.x credentials - Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. Flat for Education is a Certified LTI Provider. You can use these API methods to automate the creation of LTI credentials. You can read more about our LTI implementation, supported components and LTI Endpoints in our [Developer Documentation](https://flat.io/developers/docs/lti/). :param body: (required) :type body: LtiCredentialsCreation @@ -540,6 +844,7 @@ def create_lti_credentials_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("POST /organizations/lti/credentials is deprecated.", DeprecationWarning) _param = self._create_lti_credentials_serialize( body=body, @@ -552,6 +857,7 @@ def create_lti_credentials_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "LtiCredentials", '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -578,7 +884,9 @@ def _create_lti_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -591,11 +899,12 @@ def _create_lti_credentials_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -689,6 +998,7 @@ def create_organization_invitation( _response_types_map: Dict[str, Optional[str]] = { '200': "OrganizationInvitation", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -756,6 +1066,7 @@ def create_organization_invitation_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "OrganizationInvitation", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -823,6 +1134,7 @@ def create_organization_invitation_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "OrganizationInvitation", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -849,7 +1161,9 @@ def _create_organization_invitation_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -862,11 +1176,12 @@ def _create_organization_invitation_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -959,6 +1274,7 @@ def create_organization_user( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1025,6 +1341,7 @@ def create_organization_user_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1091,6 +1408,7 @@ def create_organization_user_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1117,7 +1435,9 @@ def _create_organization_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1130,11 +1450,12 @@ def _create_organization_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1232,6 +1553,7 @@ def create_organization_user_access_token( _response_types_map: Dict[str, Optional[str]] = { '200': "ApiAccessToken", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1303,6 +1625,7 @@ def create_organization_user_access_token_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ApiAccessToken", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1374,6 +1697,7 @@ def create_organization_user_access_token_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ApiAccessToken", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1401,7 +1725,9 @@ def _create_organization_user_access_token_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1416,11 +1742,12 @@ def _create_organization_user_access_token_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1517,6 +1844,7 @@ def create_organization_user_signin_link( _response_types_map: Dict[str, Optional[str]] = { '200': "UserSigninLink", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1587,6 +1915,7 @@ def create_organization_user_signin_link_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserSigninLink", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1657,6 +1986,7 @@ def create_organization_user_signin_link_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "UserSigninLink", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1684,7 +2014,9 @@ def _create_organization_user_signin_link_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1699,11 +2031,12 @@ def _create_organization_user_signin_link_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1742,6 +2075,513 @@ def _create_organization_user_signin_link_serialize( + @validate_call + def delete_lti_configuration( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an LTI configuration + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_lti_configuration_serialize( + configuration=configuration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_lti_configuration_with_http_info( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an LTI configuration + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_lti_configuration_serialize( + configuration=configuration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_lti_configuration_without_preload_content( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an LTI configuration + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_lti_configuration_serialize( + configuration=configuration, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '204': None, + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_lti_configuration_serialize( + self, + configuration, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if configuration is not None: + _path_params['configuration'] = configuration + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/organizations/lti/configurations/{configuration}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_lti_configurations( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[LtiConfiguration]: + """List LTI configurations (1.1 and 1.3) + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_lti_configurations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiConfiguration]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_lti_configurations_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[LtiConfiguration]]: + """List LTI configurations (1.1 and 1.3) + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_lti_configurations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiConfiguration]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_lti_configurations_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List LTI configurations (1.1 and 1.3) + + + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_lti_configurations_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[LtiConfiguration]", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_lti_configurations_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/organizations/lti/configurations', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def list_lti_credentials( self, @@ -1758,8 +2598,9 @@ def list_lti_credentials( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> List[LtiCredentials]: - """List LTI 1.x credentials + """(Deprecated) List LTI 1.x credentials + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1782,6 +2623,7 @@ def list_lti_credentials( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /organizations/lti/credentials is deprecated.", DeprecationWarning) _param = self._list_lti_credentials_serialize( _request_auth=_request_auth, @@ -1793,6 +2635,7 @@ def list_lti_credentials( _response_types_map: Dict[str, Optional[str]] = { '200': "List[LtiCredentials]", '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1821,8 +2664,9 @@ def list_lti_credentials_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[List[LtiCredentials]]: - """List LTI 1.x credentials + """(Deprecated) List LTI 1.x credentials + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1845,6 +2689,7 @@ def list_lti_credentials_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /organizations/lti/credentials is deprecated.", DeprecationWarning) _param = self._list_lti_credentials_serialize( _request_auth=_request_auth, @@ -1856,6 +2701,7 @@ def list_lti_credentials_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[LtiCredentials]", '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1884,8 +2730,9 @@ def list_lti_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """List LTI 1.x credentials + """(Deprecated) List LTI 1.x credentials + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request @@ -1908,6 +2755,7 @@ def list_lti_credentials_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("GET /organizations/lti/credentials is deprecated.", DeprecationWarning) _param = self._list_lti_credentials_serialize( _request_auth=_request_auth, @@ -1919,6 +2767,7 @@ def list_lti_credentials_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[LtiCredentials]", '403': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1944,7 +2793,9 @@ def _list_lti_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1955,11 +2806,12 @@ def _list_lti_credentials_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2051,6 +2903,7 @@ def list_organization_invitations( _response_types_map: Dict[str, Optional[str]] = { '200': "List[OrganizationInvitation]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2129,6 +2982,7 @@ def list_organization_invitations_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[OrganizationInvitation]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2207,6 +3061,7 @@ def list_organization_invitations_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[OrganizationInvitation]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2236,7 +3091,9 @@ def _list_organization_invitations_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2263,11 +3120,12 @@ def _list_organization_invitations_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2296,7 +3154,7 @@ def _list_organization_invitations_serialize( @validate_call def list_organization_users( self, - sort: Annotated[Optional[List[StrictStr]], Field(description="The order to sort the user list")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. ")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, @@ -2304,6 +3162,7 @@ def list_organization_users( q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, license_expiration_date: Annotated[Optional[List[StrictStr]], Field(description="Filter users by license expiration date or `active` / `notActive`")] = None, only_ids: Annotated[Optional[StrictBool], Field(description="Return only user ids")] = None, limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, @@ -2323,8 +3182,8 @@ def list_organization_users( """List the organization users - :param sort: The order to sort the user list - :type sort: List[str] + :param sort: The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. + :type sort: str :param direction: Sort direction :type direction: str :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. @@ -2339,6 +3198,8 @@ def list_organization_users( :type group: List[str] :param no_active_license: Filter users who don't have an active license :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str :param license_expiration_date: Filter users by license expiration date or `active` / `notActive` :type license_expiration_date: List[str] :param only_ids: Return only user ids @@ -2376,6 +3237,7 @@ def list_organization_users( q=q, group=group, no_active_license=no_active_license, + test_accounts=test_accounts, license_expiration_date=license_expiration_date, only_ids=only_ids, limit=limit, @@ -2387,6 +3249,7 @@ def list_organization_users( _response_types_map: Dict[str, Optional[str]] = { '200': "List[UserDetailsAdmin]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2402,7 +3265,7 @@ def list_organization_users( @validate_call def list_organization_users_with_http_info( self, - sort: Annotated[Optional[List[StrictStr]], Field(description="The order to sort the user list")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. ")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, @@ -2410,6 +3273,7 @@ def list_organization_users_with_http_info( q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, license_expiration_date: Annotated[Optional[List[StrictStr]], Field(description="Filter users by license expiration date or `active` / `notActive`")] = None, only_ids: Annotated[Optional[StrictBool], Field(description="Return only user ids")] = None, limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, @@ -2429,8 +3293,8 @@ def list_organization_users_with_http_info( """List the organization users - :param sort: The order to sort the user list - :type sort: List[str] + :param sort: The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. + :type sort: str :param direction: Sort direction :type direction: str :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. @@ -2445,6 +3309,8 @@ def list_organization_users_with_http_info( :type group: List[str] :param no_active_license: Filter users who don't have an active license :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str :param license_expiration_date: Filter users by license expiration date or `active` / `notActive` :type license_expiration_date: List[str] :param only_ids: Return only user ids @@ -2482,6 +3348,7 @@ def list_organization_users_with_http_info( q=q, group=group, no_active_license=no_active_license, + test_accounts=test_accounts, license_expiration_date=license_expiration_date, only_ids=only_ids, limit=limit, @@ -2493,6 +3360,7 @@ def list_organization_users_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[UserDetailsAdmin]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2508,7 +3376,7 @@ def list_organization_users_with_http_info( @validate_call def list_organization_users_without_preload_content( self, - sort: Annotated[Optional[List[StrictStr]], Field(description="The order to sort the user list")] = None, + sort: Annotated[Optional[StrictStr], Field(description="The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. ")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, @@ -2516,6 +3384,7 @@ def list_organization_users_without_preload_content( q: Annotated[Optional[StrictStr], Field(description="The query to search")] = None, group: Annotated[Optional[List[StrictStr]], Field(description="Filter users by group")] = None, no_active_license: Annotated[Optional[StrictBool], Field(description="Filter users who don't have an active license")] = None, + test_accounts: Annotated[Optional[StrictStr], Field(description="Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. ")] = None, license_expiration_date: Annotated[Optional[List[StrictStr]], Field(description="Filter users by license expiration date or `active` / `notActive`")] = None, only_ids: Annotated[Optional[StrictBool], Field(description="Return only user ids")] = None, limit: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, @@ -2535,8 +3404,8 @@ def list_organization_users_without_preload_content( """List the organization users - :param sort: The order to sort the user list - :type sort: List[str] + :param sort: The order to sort the user list. * `creationDate`: Order by account creation. * `firstname`, `lastname`, `username`: Order by the user identity. * `lastActivityDate`: Order by the last recorded activity. * `licenseExpirationDate`: Order by the expiration of the active license. + :type sort: str :param direction: Sort direction :type direction: str :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. @@ -2551,6 +3420,8 @@ def list_organization_users_without_preload_content( :type group: List[str] :param no_active_license: Filter users who don't have an active license :type no_active_license: bool + :param test_accounts: Filter users based on test account status. Test accounts are student accounts created for testing purposes by teachers. * `exclude`: Hide test accounts from results. * `only`: Show only test accounts. When omitted, all users are returned. + :type test_accounts: str :param license_expiration_date: Filter users by license expiration date or `active` / `notActive` :type license_expiration_date: List[str] :param only_ids: Return only user ids @@ -2588,6 +3459,7 @@ def list_organization_users_without_preload_content( q=q, group=group, no_active_license=no_active_license, + test_accounts=test_accounts, license_expiration_date=license_expiration_date, only_ids=only_ids, limit=limit, @@ -2599,6 +3471,7 @@ def list_organization_users_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[UserDetailsAdmin]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2617,6 +3490,7 @@ def _list_organization_users_serialize( q, group, no_active_license, + test_accounts, license_expiration_date, only_ids, limit, @@ -2629,7 +3503,6 @@ def _list_organization_users_serialize( _host = None _collection_formats: Dict[str, str] = { - 'sort': 'multi', 'role': 'multi', 'group': 'multi', 'licenseExpirationDate': 'multi', @@ -2639,7 +3512,9 @@ def _list_organization_users_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2676,6 +3551,10 @@ def _list_organization_users_serialize( _query_params.append(('noActiveLicense', no_active_license)) + if test_accounts is not None: + + _query_params.append(('testAccounts', test_accounts)) + if license_expiration_date is not None: _query_params.append(('licenseExpirationDate', license_expiration_date)) @@ -2694,11 +3573,12 @@ def _list_organization_users_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2778,6 +3658,7 @@ def remove_organization_invitation( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2844,6 +3725,7 @@ def remove_organization_invitation_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2910,6 +3792,7 @@ def remove_organization_invitation_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2936,7 +3819,9 @@ def _remove_organization_invitation_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2949,11 +3834,12 @@ def _remove_organization_invitation_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3038,6 +3924,7 @@ def remove_organization_user( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3109,6 +3996,7 @@ def remove_organization_user_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3180,6 +4068,7 @@ def remove_organization_user_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '204': None, + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3207,7 +4096,9 @@ def _remove_organization_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3224,11 +4115,12 @@ def _remove_organization_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3271,8 +4163,9 @@ def revoke_lti_credentials( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> None: - """Revoke LTI 1.x credentials + """(Deprecated) Revoke LTI 1.x credentials + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. :param credentials: Credentials unique identifier (required) :type credentials: str @@ -3297,6 +4190,7 @@ def revoke_lti_credentials( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /organizations/lti/credentials/{credentials} is deprecated.", DeprecationWarning) _param = self._revoke_lti_credentials_serialize( credentials=credentials, @@ -3310,6 +4204,7 @@ def revoke_lti_credentials( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3339,8 +4234,9 @@ def revoke_lti_credentials_with_http_info( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> ApiResponse[None]: - """Revoke LTI 1.x credentials + """(Deprecated) Revoke LTI 1.x credentials + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. :param credentials: Credentials unique identifier (required) :type credentials: str @@ -3365,6 +4261,7 @@ def revoke_lti_credentials_with_http_info( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /organizations/lti/credentials/{credentials} is deprecated.", DeprecationWarning) _param = self._revoke_lti_credentials_serialize( credentials=credentials, @@ -3378,6 +4275,7 @@ def revoke_lti_credentials_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3407,8 +4305,9 @@ def revoke_lti_credentials_without_preload_content( _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, ) -> RESTResponseType: - """Revoke LTI 1.x credentials + """(Deprecated) Revoke LTI 1.x credentials + DEPRECATED. Use the unified endpoints under `/organizations/lti/configurations`. Note: Teachers may be restricted by the organization privacy setting `lti1p1AllowTeachersCredentials`. :param credentials: Credentials unique identifier (required) :type credentials: str @@ -3433,6 +4332,7 @@ def revoke_lti_credentials_without_preload_content( :type _host_index: int, optional :return: Returns the result object. """ # noqa: E501 + warnings.warn("DELETE /organizations/lti/credentials/{credentials} is deprecated.", DeprecationWarning) _param = self._revoke_lti_credentials_serialize( credentials=credentials, @@ -3446,6 +4346,7 @@ def revoke_lti_credentials_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3472,7 +4373,9 @@ def _revoke_lti_credentials_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3485,11 +4388,12 @@ def _revoke_lti_credentials_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3515,6 +4419,295 @@ def _revoke_lti_credentials_serialize( + @validate_call + def update_lti_configuration( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + lti_configuration_update: LtiConfigurationUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> LtiConfiguration: + """Update an existing LTI configuration (edit 1.3; 1.1 not editable) + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :param lti_configuration_update: (required) + :type lti_configuration_update: LtiConfigurationUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_lti_configuration_serialize( + configuration=configuration, + lti_configuration_update=lti_configuration_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiConfiguration", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_lti_configuration_with_http_info( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + lti_configuration_update: LtiConfigurationUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[LtiConfiguration]: + """Update an existing LTI configuration (edit 1.3; 1.1 not editable) + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :param lti_configuration_update: (required) + :type lti_configuration_update: LtiConfigurationUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_lti_configuration_serialize( + configuration=configuration, + lti_configuration_update=lti_configuration_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiConfiguration", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_lti_configuration_without_preload_content( + self, + configuration: Annotated[StrictStr, Field(description="Configuration unique identifier")], + lti_configuration_update: LtiConfigurationUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an existing LTI configuration (edit 1.3; 1.1 not editable) + + + :param configuration: Configuration unique identifier (required) + :type configuration: str + :param lti_configuration_update: (required) + :type lti_configuration_update: LtiConfigurationUpdate + :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. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_lti_configuration_serialize( + configuration=configuration, + lti_configuration_update=lti_configuration_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "LtiConfiguration", + 'default': "FlatErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_lti_configuration_serialize( + self, + configuration, + lti_configuration_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if configuration is not None: + _path_params['configuration'] = configuration + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + if lti_configuration_update is not None: + _body_params = lti_configuration_update + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'OAuth2' + ] + + return self.api_client.param_serialize( + method='PUT', + resource_path='/organizations/lti/configurations/{configuration}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call def update_organization_user( self, @@ -3573,6 +4766,7 @@ def update_organization_user( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3643,6 +4837,7 @@ def update_organization_user_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3713,6 +4908,7 @@ def update_organization_user_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "UserDetailsAdmin", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3740,7 +4936,9 @@ def _update_organization_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3755,11 +4953,12 @@ def _update_organization_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/flat_api/api/score_api.py b/flat_api/api/score_api.py index 762cfe7..b4ab2e1 100644 --- a/flat_api/api/score_api.py +++ b/flat_api/api/score_api.py @@ -1,24 +1,23 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr, field_validator -from typing import Optional +from pydantic import Field, StrictBool, StrictBytes, StrictStr, field_validator +from typing import List, Optional, Tuple, Union from typing_extensions import Annotated from flat_api.models.assignment_submission import AssignmentSubmission from flat_api.models.resource_collaborator import ResourceCollaborator @@ -34,6 +33,7 @@ from flat_api.models.score_revision_creation import ScoreRevisionCreation from flat_api.models.score_track import ScoreTrack from flat_api.models.score_track_creation import ScoreTrackCreation +from flat_api.models.score_track_creation_response import ScoreTrackCreationResponse from flat_api.models.score_track_update import ScoreTrackUpdate from flat_api.models.task import Task from flat_api.models.task_export_options import TaskExportOptions @@ -118,6 +118,7 @@ def add_score_collaborator( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -192,6 +193,7 @@ def add_score_collaborator_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -266,6 +268,7 @@ def add_score_collaborator_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -293,7 +296,9 @@ def _add_score_collaborator_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -308,11 +313,12 @@ def _add_score_collaborator_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -368,7 +374,7 @@ def add_score_track( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ScoreTrack: + ) -> ScoreTrackCreationResponse: """Add a new video or audio track to the score Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo. @@ -409,9 +415,10 @@ def add_score_track( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ScoreTrack", + '200': "ScoreTrackCreationResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -441,7 +448,7 @@ def add_score_track_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[ScoreTrack]: + ) -> ApiResponse[ScoreTrackCreationResponse]: """Add a new video or audio track to the score Use this method to add new track to the score. This track can then be played on flat.io or in an embedded score. This API method support medias hosted on SoundCloud, YouTube and Vimeo. @@ -482,9 +489,10 @@ def add_score_track_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ScoreTrack", + '200': "ScoreTrackCreationResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -555,9 +563,10 @@ def add_score_track_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "ScoreTrack", + '200': "ScoreTrackCreationResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -585,7 +594,9 @@ def _add_score_track_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -600,11 +611,12 @@ def _add_score_track_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -717,6 +729,7 @@ def create_export_task( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -803,6 +816,7 @@ def create_export_task_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -889,6 +903,7 @@ def create_export_task_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -919,7 +934,9 @@ def _create_export_task_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -942,11 +959,12 @@ def _create_export_task_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1004,7 +1022,7 @@ def create_score( ) -> ScoreDetails: """Create a new score - Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import an existing MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`), Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar, or MuseScore file to create the new Flat document. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. + Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import a file to create the new Flat document. **Preferred formats**: * **MusicXML**: `.xml`, `.musicxml`, `.mxl` (compressed) — MIME: `vnd.recordare.musicxml+xml`, `vnd.recordare.musicxml`. This is the only format that preserves all notation data (articulations, dynamics, layout, etc.) with full round-trip support. * **MIDI**: `.mid`, `.midi` — MIME: `audio/midi`. Only preserves pitch, timing, and instrument data; notation details are lost. **Also supported** (converted to MusicXML on import, some notation details may be lost): * **Guitar Pro**: `.gp`, `.gp3`, `.gp4`, `.gp5`, `.gpx`, `.gtp` * **MuseScore**: `.mscz`, `.mscx` * **Finale**: `.musx` * **ABC notation**: `.abc` — MIME: `text/vnd.abc` * **PowerTab**: `.ptb` * **Capella**: `.cap`, `.capx` * **MEI**: `.mei` * **Overture**: `.ove` * **TablEdit**: `.tef` * **Band-in-a-Box**: `.mgu`, `.sgu` * **Karaoke MIDI**: `.kar` * **MuseData**: `.md` * **Score Writer**: `.scw` * **Bagpipe Music Writer**: `.bmw`, `.bww` * **Encore**: `.enc` **Scanned music** (requires `supportsTasks`, runs our music recognition and spends credits): * **PDF**: `.pdf` * **Images**: `.jpg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`, `.heic`, `.heif` The file is identified by its own content, so its extension and any declared type do not have to match. **One file per request**: a multi-page PDF or a multi-frame TIFF is fine, but several separate images of the same score (a page photographed at a time) need `createOmrJob`, which takes many inputs in one job and bills them as a single document. Its live limits are served by `getOmrCapabilities`. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. :param body: (required) :type body: ScoreCreation @@ -1040,8 +1058,10 @@ def create_score( _response_types_map: Dict[str, Optional[str]] = { '200': "ScoreDetails", + '202': "Task", '400': "FlatErrorResponse", '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1073,7 +1093,7 @@ def create_score_with_http_info( ) -> ApiResponse[ScoreDetails]: """Create a new score - Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import an existing MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`), Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar, or MuseScore file to create the new Flat document. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. + Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import a file to create the new Flat document. **Preferred formats**: * **MusicXML**: `.xml`, `.musicxml`, `.mxl` (compressed) — MIME: `vnd.recordare.musicxml+xml`, `vnd.recordare.musicxml`. This is the only format that preserves all notation data (articulations, dynamics, layout, etc.) with full round-trip support. * **MIDI**: `.mid`, `.midi` — MIME: `audio/midi`. Only preserves pitch, timing, and instrument data; notation details are lost. **Also supported** (converted to MusicXML on import, some notation details may be lost): * **Guitar Pro**: `.gp`, `.gp3`, `.gp4`, `.gp5`, `.gpx`, `.gtp` * **MuseScore**: `.mscz`, `.mscx` * **Finale**: `.musx` * **ABC notation**: `.abc` — MIME: `text/vnd.abc` * **PowerTab**: `.ptb` * **Capella**: `.cap`, `.capx` * **MEI**: `.mei` * **Overture**: `.ove` * **TablEdit**: `.tef` * **Band-in-a-Box**: `.mgu`, `.sgu` * **Karaoke MIDI**: `.kar` * **MuseData**: `.md` * **Score Writer**: `.scw` * **Bagpipe Music Writer**: `.bmw`, `.bww` * **Encore**: `.enc` **Scanned music** (requires `supportsTasks`, runs our music recognition and spends credits): * **PDF**: `.pdf` * **Images**: `.jpg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`, `.heic`, `.heif` The file is identified by its own content, so its extension and any declared type do not have to match. **One file per request**: a multi-page PDF or a multi-frame TIFF is fine, but several separate images of the same score (a page photographed at a time) need `createOmrJob`, which takes many inputs in one job and bills them as a single document. Its live limits are served by `getOmrCapabilities`. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. :param body: (required) :type body: ScoreCreation @@ -1109,8 +1129,10 @@ def create_score_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "ScoreDetails", + '202': "Task", '400': "FlatErrorResponse", '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1142,7 +1164,7 @@ def create_score_without_preload_content( ) -> RESTResponseType: """Create a new score - Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import an existing MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`), Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar, or MuseScore file to create the new Flat document. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. + Use this API method to **create a new music score in the current User account**. This API endpoints provides 3 ways to create scores: * `ScoreCreationBuilderData` : Create a blank score by providing the list of instruments to use. You can optionally customize the initial key signature, time signature, enable TABs, Chord grids, as well as the page layout. * `ScoreCreationFileImport`: Import a file to create the new Flat document. **Preferred formats**: * **MusicXML**: `.xml`, `.musicxml`, `.mxl` (compressed) — MIME: `vnd.recordare.musicxml+xml`, `vnd.recordare.musicxml`. This is the only format that preserves all notation data (articulations, dynamics, layout, etc.) with full round-trip support. * **MIDI**: `.mid`, `.midi` — MIME: `audio/midi`. Only preserves pitch, timing, and instrument data; notation details are lost. **Also supported** (converted to MusicXML on import, some notation details may be lost): * **Guitar Pro**: `.gp`, `.gp3`, `.gp4`, `.gp5`, `.gpx`, `.gtp` * **MuseScore**: `.mscz`, `.mscx` * **Finale**: `.musx` * **ABC notation**: `.abc` — MIME: `text/vnd.abc` * **PowerTab**: `.ptb` * **Capella**: `.cap`, `.capx` * **MEI**: `.mei` * **Overture**: `.ove` * **TablEdit**: `.tef` * **Band-in-a-Box**: `.mgu`, `.sgu` * **Karaoke MIDI**: `.kar` * **MuseData**: `.md` * **Score Writer**: `.scw` * **Bagpipe Music Writer**: `.bmw`, `.bww` * **Encore**: `.enc` **Scanned music** (requires `supportsTasks`, runs our music recognition and spends credits): * **PDF**: `.pdf` * **Images**: `.jpg`, `.png`, `.webp`, `.tiff`, `.gif`, `.avif`, `.heic`, `.heif` The file is identified by its own content, so its extension and any declared type do not have to match. **One file per request**: a multi-page PDF or a multi-frame TIFF is fine, but several separate images of the same score (a page photographed at a time) need `createOmrJob`, which takes many inputs in one job and bills them as a single document. Its live limits are served by `getOmrCapabilities`. * `ScoreCreationGoogleDriveImport`: Import an existing Google Drive file from the connected Google Drive account. This API call will automatically create the first revision of the document, the score can be modified by the using our web application or by uploading a new revision of this file (`POST /v2/scores/{score}/revisions/{revision}`). The currently authenticated user will be granted owner of the file and will be able to add other collaborators (users and groups). If no `collection` is specified, the API will create the score in the most appropriate collection. When using an OAuth2 access token or a personal token, the score will be automatically added to your dedicated app collection in the account (`/v2/collections/app`). If a `collection` is specified and this one has more public privacy settings than the score (e.g. `public` vs `private` for the score), the privacy settings of the created score will be adjusted to the collection ones. You can check the adjusted privacy settings in the returned score `privacy`, and optionally adjust these settings if needed using `PUT /scores/{score}`. :param body: (required) :type body: ScoreCreation @@ -1178,8 +1200,10 @@ def create_score_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "ScoreDetails", + '202': "Task", '400': "FlatErrorResponse", '402': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1206,7 +1230,9 @@ def _create_score_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1219,11 +1245,12 @@ def _create_score_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1324,6 +1351,7 @@ def create_score_revision( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1398,6 +1426,7 @@ def create_score_revision_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1472,6 +1501,7 @@ def create_score_revision_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1499,7 +1529,9 @@ def _create_score_revision_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1514,11 +1546,12 @@ def _create_score_revision_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -1577,7 +1610,7 @@ def delete_score( ) -> None: """Delete a score - This method can be used by the owner/admin (`aclAdmin` rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. When called by a regular collaborator (`aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections). + This method can be used by anyone that has at least read access to the document: - When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. - When called by a collaborator, the score will be unshared (i.e. removed from the account & own collections). - When called by another user that has the score in its collections, the score will be removed from all the user collections. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -1618,6 +1651,7 @@ def delete_score( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1650,7 +1684,7 @@ def delete_score_with_http_info( ) -> ApiResponse[None]: """Delete a score - This method can be used by the owner/admin (`aclAdmin` rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. When called by a regular collaborator (`aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections). + This method can be used by anyone that has at least read access to the document: - When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. - When called by a collaborator, the score will be unshared (i.e. removed from the account & own collections). - When called by another user that has the score in its collections, the score will be removed from all the user collections. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -1691,6 +1725,7 @@ def delete_score_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1723,7 +1758,7 @@ def delete_score_without_preload_content( ) -> RESTResponseType: """Delete a score - This method can be used by the owner/admin (`aclAdmin` rights) of a score as well as regular collaborators. When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. When called by a regular collaborator (`aclRead` / `aclWrite`), the score will be unshared (i.e. removed from the account & own collections). + This method can be used by anyone that has at least read access to the document: - When called by an owner/admin, it will schedule the deletion of the score, its revisions, and complete history. The score won't be accessible anymore after calling this method and the user's quota will directly be updated. - When called by a collaborator, the score will be unshared (i.e. removed from the account & own collections). - When called by another user that has the score in its collections, the score will be removed from all the user collections. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -1764,6 +1799,7 @@ def delete_score_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1791,7 +1827,9 @@ def _delete_score_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -1808,11 +1846,12 @@ def _delete_score_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -1843,6 +1882,7 @@ def delete_score_comment( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -1864,6 +1904,8 @@ def delete_score_comment( :type score: str :param comment: Unique identifier of a sheet music comment (required) :type comment: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str :param _request_timeout: timeout setting for this request. If one @@ -1891,6 +1933,7 @@ def delete_score_comment( _param = self._delete_score_comment_serialize( score=score, comment=comment, + event_properties=event_properties, sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, @@ -1902,6 +1945,7 @@ def delete_score_comment( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1919,6 +1963,7 @@ def delete_score_comment_with_http_info( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -1940,6 +1985,8 @@ def delete_score_comment_with_http_info( :type score: str :param comment: Unique identifier of a sheet music comment (required) :type comment: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str :param _request_timeout: timeout setting for this request. If one @@ -1967,6 +2014,7 @@ def delete_score_comment_with_http_info( _param = self._delete_score_comment_serialize( score=score, comment=comment, + event_properties=event_properties, sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, @@ -1978,6 +2026,7 @@ def delete_score_comment_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -1995,6 +2044,7 @@ def delete_score_comment_without_preload_content( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], comment: Annotated[StrictStr, Field(description="Unique identifier of a sheet music comment ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, @@ -2016,6 +2066,8 @@ def delete_score_comment_without_preload_content( :type score: str :param comment: Unique identifier of a sheet music comment (required) :type comment: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. :type sharing_key: str :param _request_timeout: timeout setting for this request. If one @@ -2043,6 +2095,7 @@ def delete_score_comment_without_preload_content( _param = self._delete_score_comment_serialize( score=score, comment=comment, + event_properties=event_properties, sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, @@ -2054,6 +2107,7 @@ def delete_score_comment_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2066,6 +2120,7 @@ def _delete_score_comment_serialize( self, score, comment, + event_properties, sharing_key, _request_auth, _content_type, @@ -2082,7 +2137,9 @@ def _delete_score_comment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2091,6 +2148,10 @@ def _delete_score_comment_serialize( if comment is not None: _path_params['comment'] = comment # process the query parameters + if event_properties is not None: + + _query_params.append(('eventProperties', event_properties)) + if sharing_key is not None: _query_params.append(('sharingKey', sharing_key)) @@ -2101,12 +2162,26 @@ def _delete_score_comment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -2191,6 +2266,7 @@ def delete_score_track( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2263,6 +2339,7 @@ def delete_score_track_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2335,6 +2412,7 @@ def delete_score_track_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2362,7 +2440,9 @@ def _delete_score_track_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2377,11 +2457,12 @@ def _delete_score_track_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -2469,6 +2550,7 @@ def edit_score( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2543,6 +2625,7 @@ def edit_score_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2617,6 +2700,7 @@ def edit_score_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2644,7 +2728,9 @@ def _edit_score_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2659,11 +2745,12 @@ def _edit_score_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -2768,6 +2855,7 @@ def fork_score( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2846,6 +2934,7 @@ def fork_score_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2924,6 +3013,7 @@ def fork_score_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -2952,7 +3042,9 @@ def _fork_score_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -2971,11 +3063,12 @@ def _fork_score_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -3073,6 +3166,8 @@ def get_group_scores( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3144,6 +3239,8 @@ def get_group_scores_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3215,6 +3312,8 @@ def get_group_scores_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3242,7 +3341,9 @@ def _get_group_scores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3259,11 +3360,12 @@ def _get_group_scores_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3351,6 +3453,7 @@ def get_score( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3425,6 +3528,7 @@ def get_score_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3499,6 +3603,7 @@ def get_score_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3526,7 +3631,9 @@ def _get_score_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3543,11 +3650,12 @@ def _get_score_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3639,6 +3747,7 @@ def get_score_collaborator( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3717,6 +3826,7 @@ def get_score_collaborator_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3795,6 +3905,7 @@ def get_score_collaborator_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -3823,7 +3934,9 @@ def _get_score_collaborator_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -3842,11 +3955,12 @@ def _get_score_collaborator_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -3934,6 +4048,7 @@ def get_score_collaborators( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4008,6 +4123,7 @@ def get_score_collaborators_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4082,6 +4198,7 @@ def get_score_collaborators_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4109,7 +4226,9 @@ def _get_score_collaborators_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4126,11 +4245,12 @@ def _get_score_collaborators_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4160,10 +4280,10 @@ def _get_score_collaborators_serialize( def get_score_comments( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], - sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, type: Annotated[Optional[StrictStr], Field(description="Filter the comments by type")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4183,14 +4303,14 @@ def get_score_comments( :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str - :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. - :type sharing_key: str :param type: Filter the comments by type :type type: str :param sort: Sort :type sort: str :param direction: Sort direction :type direction: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str :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 @@ -4215,10 +4335,10 @@ def get_score_comments( _param = self._get_score_comments_serialize( score=score, - sharing_key=sharing_key, type=type, sort=sort, direction=direction, + sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4230,6 +4350,7 @@ def get_score_comments( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4246,10 +4367,10 @@ def get_score_comments( def get_score_comments_with_http_info( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], - sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, type: Annotated[Optional[StrictStr], Field(description="Filter the comments by type")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4269,14 +4390,14 @@ def get_score_comments_with_http_info( :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str - :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. - :type sharing_key: str :param type: Filter the comments by type :type type: str :param sort: Sort :type sort: str :param direction: Sort direction :type direction: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str :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 @@ -4301,10 +4422,10 @@ def get_score_comments_with_http_info( _param = self._get_score_comments_serialize( score=score, - sharing_key=sharing_key, type=type, sort=sort, direction=direction, + sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4316,6 +4437,7 @@ def get_score_comments_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4332,10 +4454,10 @@ def get_score_comments_with_http_info( def get_score_comments_without_preload_content( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], - sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, type: Annotated[Optional[StrictStr], Field(description="Filter the comments by type")] = None, sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + sharing_key: Annotated[Optional[StrictStr], Field(description="This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -4355,14 +4477,14 @@ def get_score_comments_without_preload_content( :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str - :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. - :type sharing_key: str :param type: Filter the comments by type :type type: str :param sort: Sort :type sort: str :param direction: Sort direction :type direction: str + :param sharing_key: This sharing key must be specified to access to a score or collection with a `privacy` mode set to `privateLink` and the current user is not a collaborator of the document. + :type sharing_key: str :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 @@ -4387,10 +4509,10 @@ def get_score_comments_without_preload_content( _param = self._get_score_comments_serialize( score=score, - sharing_key=sharing_key, type=type, sort=sort, direction=direction, + sharing_key=sharing_key, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -4402,6 +4524,7 @@ def get_score_comments_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4413,10 +4536,10 @@ def get_score_comments_without_preload_content( def _get_score_comments_serialize( self, score, - sharing_key, type, sort, direction, + sharing_key, _request_auth, _content_type, _headers, @@ -4432,17 +4555,15 @@ def _get_score_comments_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if score is not None: _path_params['score'] = score # process the query parameters - if sharing_key is not None: - - _query_params.append(('sharingKey', sharing_key)) - if type is not None: _query_params.append(('type', type)) @@ -4455,17 +4576,22 @@ def _get_score_comments_serialize( _query_params.append(('direction', direction)) + if sharing_key is not None: + + _query_params.append(('sharingKey', sharing_key)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4557,6 +4683,7 @@ def get_score_revision( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4635,6 +4762,7 @@ def get_score_revision_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4713,6 +4841,7 @@ def get_score_revision_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4741,7 +4870,9 @@ def _get_score_revision_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -4760,11 +4891,12 @@ def _get_score_revision_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -4812,10 +4944,10 @@ def get_score_revision_data( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> bytearray: + ) -> bytes: """Get a score revision data - Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, MP3 `mp3`, WAV `wav`, MIDI `midi`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. + Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, ABC notation `abc`, MP3 `mp3`, WAV `wav`, MIDI `midi`, Flat `flat`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. ABC notation is a text format that cannot express everything a score contains. Like MIDI, the export is lossy: notation ABC has no equivalent for is approximated or dropped rather than failing the request. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -4868,10 +5000,11 @@ def get_score_revision_data( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "bytes", '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -4906,10 +5039,10 @@ def get_score_revision_data_with_http_info( _content_type: Optional[StrictStr] = None, _headers: Optional[Dict[StrictStr, Any]] = None, _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, - ) -> ApiResponse[bytearray]: + ) -> ApiResponse[bytes]: """Get a score revision data - Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, MP3 `mp3`, WAV `wav`, MIDI `midi`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. + Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, ABC notation `abc`, MP3 `mp3`, WAV `wav`, MIDI `midi`, Flat `flat`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. ABC notation is a text format that cannot express everything a score contains. Like MIDI, the export is lossy: notation ABC has no equivalent for is approximated or dropped rather than failing the request. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -4962,10 +5095,11 @@ def get_score_revision_data_with_http_info( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "bytes", '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5003,7 +5137,7 @@ def get_score_revision_data_without_preload_content( ) -> RESTResponseType: """Get a score revision data - Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, MP3 `mp3`, WAV `wav`, MIDI `midi`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. + Retrieve the file corresponding to a score revision (the following formats are available): Flat JSON/Adagio JSON `json`, MusicXML `mxl`/`xml`, ABC notation `abc`, MP3 `mp3`, WAV `wav`, MIDI `midi`, Flat `flat`, a tumbnail of the first page `thumbnail.png` or auto sync points `synchronizationPoints`. ABC notation is a text format that cannot express everything a score contains. Like MIDI, the export is lossy: notation ABC has no equivalent for is approximated or dropped rather than failing the request. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -5056,10 +5190,11 @@ def get_score_revision_data_without_preload_content( ) _response_types_map: Dict[str, Optional[str]] = { - '200': "bytearray", + '200': "bytes", '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5092,7 +5227,9 @@ def _get_score_revision_data_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5125,17 +5262,19 @@ def _get_score_revision_data_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json', - 'application/vnd.recordare.musicxml+xml', - 'application/vnd.recordare.musicxml', - 'audio/mp3', - 'audio/wav', - 'audio/midi', - 'image/png' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json', + 'application/vnd.recordare.musicxml+xml', + 'application/vnd.recordare.musicxml', + 'audio/mp3', + 'audio/wav', + 'audio/midi', + 'image/png', + 'application/octet-stream' + ] + ) # authentication setting @@ -5223,6 +5362,7 @@ def get_score_revisions( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5297,6 +5437,7 @@ def get_score_revisions_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5371,6 +5512,7 @@ def get_score_revisions_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5398,7 +5540,9 @@ def _get_score_revisions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5415,11 +5559,12 @@ def _get_score_revisions_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -5500,6 +5645,7 @@ def get_score_submissions( _response_types_map: Dict[str, Optional[str]] = { '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5567,6 +5713,7 @@ def get_score_submissions_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5634,6 +5781,7 @@ def get_score_submissions_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[AssignmentSubmission]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5660,7 +5808,9 @@ def _get_score_submissions_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5673,11 +5823,12 @@ def _get_score_submissions_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -5767,6 +5918,7 @@ def get_score_track( '200': "ScoreTrack", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5843,6 +5995,7 @@ def get_score_track_with_http_info( '200': "ScoreTrack", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5919,6 +6072,7 @@ def get_score_track_without_preload_content( '200': "ScoreTrack", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -5947,7 +6101,9 @@ def _get_score_track_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -5966,11 +6122,12 @@ def _get_score_track_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6066,6 +6223,7 @@ def get_user_likes( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6148,6 +6306,7 @@ def get_user_likes_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6230,6 +6389,7 @@ def get_user_likes_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6260,7 +6420,9 @@ def _get_user_likes_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6289,11 +6451,12 @@ def _get_user_likes_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6323,7 +6486,12 @@ def _get_user_likes_serialize( def get_user_scores( self, user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6339,12 +6507,22 @@ def get_user_scores( ) -> List[ScoreDetails]: """List user's scores - Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) :type user: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str :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 @@ -6369,7 +6547,12 @@ def get_user_scores( _param = self._get_user_scores_serialize( user=user, - parent=parent, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6378,6 +6561,7 @@ def get_user_scores( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6394,7 +6578,12 @@ def get_user_scores( def get_user_scores_with_http_info( self, user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6410,12 +6599,22 @@ def get_user_scores_with_http_info( ) -> ApiResponse[List[ScoreDetails]]: """List user's scores - Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) :type user: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str :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 @@ -6440,7 +6639,12 @@ def get_user_scores_with_http_info( _param = self._get_user_scores_serialize( user=user, - parent=parent, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6449,6 +6653,7 @@ def get_user_scores_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6465,7 +6670,12 @@ def get_user_scores_with_http_info( def get_user_scores_without_preload_content( self, user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -6481,12 +6691,22 @@ def get_user_scores_without_preload_content( ) -> RESTResponseType: """List user's scores - Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) :type user: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str :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 @@ -6511,7 +6731,12 @@ def get_user_scores_without_preload_content( _param = self._get_user_scores_serialize( user=user, - parent=parent, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -6520,6 +6745,7 @@ def get_user_scores_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6531,7 +6757,12 @@ def get_user_scores_without_preload_content( def _get_user_scores_serialize( self, user, - parent, + paginate, + sort, + direction, + limit, + next, + previous, _request_auth, _content_type, _headers, @@ -6547,16 +6778,38 @@ def _get_user_scores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if user is not None: _path_params['user'] = user # process the query parameters - if parent is not None: + if paginate is not None: - _query_params.append(('parent', parent)) + _query_params.append(('paginate', paginate)) + + if sort is not None: + + _query_params.append(('sort', sort)) + + if direction is not None: + + _query_params.append(('direction', direction)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) # process the header parameters # process the form parameters @@ -6564,11 +6817,12 @@ def _get_user_scores_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6616,6 +6870,7 @@ def list_score_tracks( ) -> List[ScoreTrack]: """List the audio or video tracks linked to a score + List all audio or video tracks linked to a score. **Access Control for Performance Submission Tracks:** Tracks with `purpose: 'performanceSubmission'` are filtered based on user role: * **Students**: Can only see their own performance submission tracks, plus all non-performance tracks * **Teachers and score admins**: Can see all tracks from all students The `assignment` query parameter can be used to filter tracks for a specific assignment, but the access control rules above still apply. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -6662,6 +6917,7 @@ def list_score_tracks( '200': "List[ScoreTrack]", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6696,6 +6952,7 @@ def list_score_tracks_with_http_info( ) -> ApiResponse[List[ScoreTrack]]: """List the audio or video tracks linked to a score + List all audio or video tracks linked to a score. **Access Control for Performance Submission Tracks:** Tracks with `purpose: 'performanceSubmission'` are filtered based on user role: * **Students**: Can only see their own performance submission tracks, plus all non-performance tracks * **Teachers and score admins**: Can see all tracks from all students The `assignment` query parameter can be used to filter tracks for a specific assignment, but the access control rules above still apply. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -6742,6 +6999,7 @@ def list_score_tracks_with_http_info( '200': "List[ScoreTrack]", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6776,6 +7034,7 @@ def list_score_tracks_without_preload_content( ) -> RESTResponseType: """List the audio or video tracks linked to a score + List all audio or video tracks linked to a score. **Access Control for Performance Submission Tracks:** Tracks with `purpose: 'performanceSubmission'` are filtered based on user role: * **Students**: Can only see their own performance submission tracks, plus all non-performance tracks * **Teachers and score admins**: Can see all tracks from all students The `assignment` query parameter can be used to filter tracks for a specific assignment, but the access control rules above still apply. :param score: Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). (required) :type score: str @@ -6822,6 +7081,7 @@ def list_score_tracks_without_preload_content( '200': "List[ScoreTrack]", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -6851,7 +7111,9 @@ def _list_score_tracks_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -6876,11 +7138,12 @@ def _list_score_tracks_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -6970,6 +7233,7 @@ def mark_score_comment_resolved( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7046,6 +7310,7 @@ def mark_score_comment_resolved_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7122,6 +7387,7 @@ def mark_score_comment_resolved_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7150,7 +7416,9 @@ def _mark_score_comment_resolved_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7169,11 +7437,12 @@ def _mark_score_comment_resolved_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -7263,6 +7532,7 @@ def mark_score_comment_unresolved( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7339,6 +7609,7 @@ def mark_score_comment_unresolved_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7415,6 +7686,7 @@ def mark_score_comment_unresolved_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7443,7 +7715,9 @@ def _mark_score_comment_unresolved_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7462,11 +7736,12 @@ def _mark_score_comment_unresolved_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -7558,6 +7833,7 @@ def post_score_comment( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7636,6 +7912,7 @@ def post_score_comment_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7714,6 +7991,7 @@ def post_score_comment_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7742,7 +8020,9 @@ def _post_score_comment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -7761,11 +8041,12 @@ def _post_score_comment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -7809,6 +8090,7 @@ def remove_score_collaborator( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7830,6 +8112,8 @@ def remove_score_collaborator( :type score: str :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) :type collaborator: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :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 @@ -7855,6 +8139,7 @@ def remove_score_collaborator( _param = self._remove_score_collaborator_serialize( score=score, collaborator=collaborator, + event_properties=event_properties, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7865,6 +8150,7 @@ def remove_score_collaborator( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7882,6 +8168,7 @@ def remove_score_collaborator_with_http_info( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7903,6 +8190,8 @@ def remove_score_collaborator_with_http_info( :type score: str :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) :type collaborator: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :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 @@ -7928,6 +8217,7 @@ def remove_score_collaborator_with_http_info( _param = self._remove_score_collaborator_serialize( score=score, collaborator=collaborator, + event_properties=event_properties, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -7938,6 +8228,7 @@ def remove_score_collaborator_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -7955,6 +8246,7 @@ def remove_score_collaborator_without_preload_content( self, score: Annotated[StrictStr, Field(description="Unique identifier of the score document. This can be a Flat Score unique identifier (i.e. `ScoreDetails.id`) or, if the score is also a Google Drive file, the Drive file unique identifier prefixed with `drive-` (e.g. `drive-0B000000000`). ")], collaborator: Annotated[StrictStr, Field(description="Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** ")], + event_properties: Annotated[Optional[StrictStr], Field(description="Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -7976,6 +8268,8 @@ def remove_score_collaborator_without_preload_content( :type score: str :param collaborator: Unique identifier of a **collaborator permission**, or unique identifier of a **User**, or unique identifier of a **Group** (required) :type collaborator: str + :param event_properties: Optional analytics properties merged into XP tracking for this request. JSON-encoded string representing event properties. Example: - `?eventProperties={\"context\":\"discover\",\"screenLevel0\":\"home\"}` + :type event_properties: str :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 @@ -8001,6 +8295,7 @@ def remove_score_collaborator_without_preload_content( _param = self._remove_score_collaborator_serialize( score=score, collaborator=collaborator, + event_properties=event_properties, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -8011,6 +8306,7 @@ def remove_score_collaborator_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8023,6 +8319,7 @@ def _remove_score_collaborator_serialize( self, score, collaborator, + event_properties, _request_auth, _content_type, _headers, @@ -8038,7 +8335,9 @@ def _remove_score_collaborator_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8047,18 +8346,36 @@ def _remove_score_collaborator_serialize( if collaborator is not None: _path_params['collaborator'] = collaborator # process the query parameters + if event_properties is not None: + + _query_params.append(('eventProperties', event_properties)) + # process the header parameters # process the form parameters # process the body parameter # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/x-www-form-urlencoded' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting _auth_settings: List[str] = [ @@ -8140,6 +8457,7 @@ def untrash_score( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8209,6 +8527,7 @@ def untrash_score_with_http_info( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8278,6 +8597,7 @@ def untrash_score_without_preload_content( '204': None, '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8304,7 +8624,9 @@ def _untrash_score_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8317,11 +8639,12 @@ def _untrash_score_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -8416,6 +8739,7 @@ def update_score_comment( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8497,6 +8821,7 @@ def update_score_comment_with_http_info( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8578,6 +8903,7 @@ def update_score_comment_without_preload_content( '402': "FlatErrorResponse", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8607,7 +8933,9 @@ def _update_score_comment_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8628,11 +8956,12 @@ def _update_score_comment_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: @@ -8735,6 +9064,7 @@ def update_score_track( '200': "ScoreTrack", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8811,6 +9141,7 @@ def update_score_track_with_http_info( '200': "ScoreTrack", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8887,6 +9218,7 @@ def update_score_track_without_preload_content( '200': "ScoreTrack", '403': "FlatErrorResponse", '404': "FlatErrorResponse", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -8915,7 +9247,9 @@ def _update_score_track_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -8932,11 +9266,12 @@ def _update_score_track_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` if _content_type: diff --git a/flat_api/api/task_api.py b/flat_api/api/task_api.py index 53e1130..64b9468 100644 --- a/flat_api/api/task_api.py +++ b/flat_api/api/task_api.py @@ -1,17 +1,16 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union @@ -94,6 +93,7 @@ def get_task( _response_types_map: Dict[str, Optional[str]] = { '200': "Task", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -161,6 +161,7 @@ def get_task_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "Task", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -228,6 +229,7 @@ def get_task_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "Task", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -254,7 +256,9 @@ def _get_task_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -267,11 +271,12 @@ def _get_task_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/flat_api/api/user_api.py b/flat_api/api/user_api.py index f572582..17b9aef 100644 --- a/flat_api/api/user_api.py +++ b/flat_api/api/user_api.py @@ -1,24 +1,23 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + import warnings from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictBool, StrictStr -from typing import Optional +from pydantic import Field, StrictBool, StrictStr, field_validator +from typing import List, Optional from typing_extensions import Annotated from flat_api.models.score_details import ScoreDetails from flat_api.models.user_public import UserPublic @@ -96,6 +95,7 @@ def get_user( _response_types_map: Dict[str, Optional[str]] = { '200': "UserPublic", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -163,6 +163,7 @@ def get_user_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "UserPublic", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -230,6 +231,7 @@ def get_user_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "UserPublic", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -256,7 +258,9 @@ def _get_user_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -269,11 +273,12 @@ def _get_user_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -369,6 +374,7 @@ def get_user_likes( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -451,6 +457,7 @@ def get_user_likes_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -533,6 +540,7 @@ def get_user_likes_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -563,7 +571,9 @@ def _get_user_likes_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters @@ -592,11 +602,12 @@ def _get_user_likes_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting @@ -626,7 +637,12 @@ def _get_user_likes_serialize( def get_user_scores( self, user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -642,12 +658,22 @@ def get_user_scores( ) -> List[ScoreDetails]: """List user's scores - Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) :type user: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str :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 @@ -672,7 +698,12 @@ def get_user_scores( _param = self._get_user_scores_serialize( user=user, - parent=parent, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -681,6 +712,7 @@ def get_user_scores( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -697,7 +729,12 @@ def get_user_scores( def get_user_scores_with_http_info( self, user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -713,12 +750,22 @@ def get_user_scores_with_http_info( ) -> ApiResponse[List[ScoreDetails]]: """List user's scores - Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) :type user: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str :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 @@ -743,7 +790,12 @@ def get_user_scores_with_http_info( _param = self._get_user_scores_serialize( user=user, - parent=parent, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -752,6 +804,7 @@ def get_user_scores_with_http_info( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -768,7 +821,12 @@ def get_user_scores_with_http_info( def get_user_scores_without_preload_content( self, user: Annotated[StrictStr, Field(description="Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. ")], - parent: Annotated[Optional[StrictStr], Field(description="Filter the score forked from the score id `parent`")] = None, + paginate: Annotated[Optional[StrictBool], Field(description="When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. ")] = None, + sort: Annotated[Optional[StrictStr], Field(description="Sort")] = None, + direction: Annotated[Optional[StrictStr], Field(description="Sort direction")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="This is the maximum number of objects that may be returned")] = None, + next: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, + previous: Annotated[Optional[StrictStr], Field(description="An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. ")] = None, _request_timeout: Union[ None, Annotated[StrictFloat, Field(gt=0)], @@ -784,12 +842,22 @@ def get_user_scores_without_preload_content( ) -> RESTResponseType: """List user's scores - Get the list of public scores owned by a User. **DEPRECATED**: Please note that the current behavior will be deprecrated on **2019-01-01**. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the [Collections API](#tag/Collection) instead. + Get the list of public scores owned by a User. If you want to access to private scores, please use the [Collections API](#tag/Collection). For example `GET /v2/collections/allScores/scores` to list all recently updated scores. :param user: Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. (required) :type user: str - :param parent: Filter the score forked from the score id `parent` - :type parent: str + :param paginate: When set to `true`, the API will return a paginated result. When set to `false` or unset, the API will return all the scores. If this parameter is unset or false, then limit/sort/direction/next/previous will be ignored. + :type paginate: bool + :param sort: Sort + :type sort: str + :param direction: Sort direction + :type direction: str + :param limit: This is the maximum number of objects that may be returned + :type limit: int + :param next: An opaque string cursor to fetch the next page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type next: str + :param previous: An opaque string cursor to fetch the previous page of data. The paginated API URLs are returned in the `Link` header when requesting the API. These URLs will contain a `next` and `previous` cursor based on the available data. + :type previous: str :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 @@ -814,7 +882,12 @@ def get_user_scores_without_preload_content( _param = self._get_user_scores_serialize( user=user, - parent=parent, + paginate=paginate, + sort=sort, + direction=direction, + limit=limit, + next=next, + previous=previous, _request_auth=_request_auth, _content_type=_content_type, _headers=_headers, @@ -823,6 +896,7 @@ def get_user_scores_without_preload_content( _response_types_map: Dict[str, Optional[str]] = { '200': "List[ScoreDetails]", + 'default': "FlatErrorResponse", } response_data = self.api_client.call_api( *_param, @@ -834,7 +908,12 @@ def get_user_scores_without_preload_content( def _get_user_scores_serialize( self, user, - parent, + paginate, + sort, + direction, + limit, + next, + previous, _request_auth, _content_type, _headers, @@ -850,16 +929,38 @@ def _get_user_scores_serialize( _query_params: List[Tuple[str, str]] = [] _header_params: Dict[str, Optional[str]] = _headers or {} _form_params: List[Tuple[str, str]] = [] - _files: Dict[str, str] = {} + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} _body_params: Optional[bytes] = None # process the path parameters if user is not None: _path_params['user'] = user # process the query parameters - if parent is not None: + if paginate is not None: + + _query_params.append(('paginate', paginate)) + + if sort is not None: + + _query_params.append(('sort', sort)) - _query_params.append(('parent', parent)) + if direction is not None: + + _query_params.append(('direction', direction)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if next is not None: + + _query_params.append(('next', next)) + + if previous is not None: + + _query_params.append(('previous', previous)) # process the header parameters # process the form parameters @@ -867,11 +968,12 @@ def _get_user_scores_serialize( # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - [ - 'application/json' - ] - ) + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # authentication setting diff --git a/flat_api/api_client.py b/flat_api/api_client.py index 418c43f..82b8c4a 100644 --- a/flat_api/api_client.py +++ b/flat_api/api_client.py @@ -1,11 +1,9 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -13,17 +11,21 @@ """ # noqa: E501 + import datetime from dateutil.parser import parse from enum import Enum +import decimal import json import mimetypes import os import re import tempfile +import uuid from urllib.parse import quote -from typing import Tuple, Optional, List, Dict +from typing import Tuple, Optional, List, Dict, Union +from pydantic import SecretStr from flat_api.configuration import Configuration from flat_api.api_response import ApiResponse, T as ApiResponseT @@ -66,6 +68,8 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'UUID': uuid.UUID, 'object': object, } _pool = None @@ -88,7 +92,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'flat_api/1.1.0' + self.user_agent = _flat_user_agent() self.client_side_validation = configuration.client_side_validation def __enter__(self): @@ -208,7 +212,8 @@ def param_serialize( post_params, collection_formats ) - post_params.extend(self.files_parameters(files)) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( @@ -226,7 +231,7 @@ def param_serialize( body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -298,22 +303,28 @@ def response_deserialize( # if not found, look for '1XX', '2XX', etc. response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + # If the response_type has not matched (eg. did not match the previous if statements) and the default response is available, use it. + if response_type is None and str(response_data.status) not in response_types_map \ + and (not isinstance(response_data.status, int) or not 100 <= response_data.status <= 599 or str(response_data.status)[0] + "XX" not in response_types_map) \ + and 'default' in response_types_map: + response_type = response_types_map['default'] + # deserialize response data response_text = None return_data = None try: - if response_type == "bytearray": + if response_type in ("bytearray", "bytes"): return_data = response_data.data elif response_type == "file": return_data = self.__deserialize_file(response_data) elif response_type is not None: match = None - content_type = response_data.getheader('content-type') + content_type = response_data.headers.get('content-type') if content_type is not None: match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) encoding = match.group(1) if match else "utf-8" response_text = response_data.data.decode(encoding) - return_data = self.deserialize(response_text, response_type) + return_data = self.deserialize(response_text, response_type, content_type) finally: if not 200 <= response_data.status <= 299: raise ApiException.from_response( @@ -325,7 +336,7 @@ def response_deserialize( return ApiResponse( status_code = response_data.status, data = return_data, - headers = response_data.getheaders(), + headers = response_data.headers, raw_data = response_data.data ) @@ -333,9 +344,11 @@ def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -345,8 +358,14 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj + elif isinstance(obj, uuid.UUID): + return str(obj) elif isinstance(obj, list): return [ self.sanitize_for_serialization(sub_obj) for sub_obj in obj @@ -357,37 +376,56 @@ def sanitize_for_serialization(self, obj): ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() - + elif isinstance(obj, decimal.Decimal): + return str(obj) elif isinstance(obj, dict): - obj_dict = obj - else: - # Convert model obj to dict except - # attributes `openapi_types`, `attribute_map` - # and attributes which value is not None. - # Convert attribute name to json key in - # model definition for request. + return { + key: self.sanitize_for_serialization(val) + for key, val in obj.items() + } + + # Convert model obj to dict except + # attributes `openapi_types`, `attribute_map` + # and attributes which value is not None. + # Convert attribute name to json key in + # model definition for request. + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + return self.sanitize_for_serialization(obj_dict) - return { - key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items() - } - def deserialize(self, response_text, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ # fetch data from response object - try: - data = json.loads(response_text) - except ValueError: + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -425,12 +463,16 @@ def __deserialize(self, data, klass): if klass in self.PRIMITIVE_TYPES: return self.__deserialize_primitive(data, klass) - elif klass == object: + elif klass is object: return self.__deserialize_object(data) - elif klass == datetime.date: + elif klass is datetime.date: return self.__deserialize_date(data) - elif klass == datetime.datetime: + elif klass is datetime.datetime: return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif klass is uuid.UUID: + return uuid.UUID(data) elif issubclass(klass, Enum): return self.__deserialize_enum(data, klass) else: @@ -487,7 +529,7 @@ def parameters_to_url_query(self, params, collection_formats): if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': - new_params.extend((k, str(value)) for value in v) + new_params.extend((k, quote(str(value))) for value in v) else: if collection_format == 'ssv': delimiter = ' ' @@ -505,31 +547,39 @@ def parameters_to_url_query(self, params, collection_formats): return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = ( - mimetypes.guess_type(filename)[0] - or 'application/octet-stream' - ) - params.append( - tuple([k, tuple([filename, filedata, mimetype])]) - ) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -629,7 +679,16 @@ def _apply_auth_params( :param auth_setting: auth settings for the endpoint """ if auth_setting['in'] == 'cookie': - headers['Cookie'] = auth_setting['value'] + if not 'Cookie' in headers: + headers['Cookie'] = "" + else: + headers['Cookie'] += "; " + # Account for cookie value containing spaces and special characters + cookie_value = str(auth_setting['value']) + if not re.match("^\".*\"$", cookie_value): + cookie_value = cookie_value.replace("\"", "\\\"") + cookie_value = f"\"{cookie_value}\"" + headers['Cookie'] += f"{auth_setting['key']}={cookie_value}" elif auth_setting['in'] == 'header': if auth_setting['type'] != 'http-signature': headers[auth_setting['key']] = auth_setting['value'] @@ -656,14 +715,16 @@ def __deserialize_file(self, response): os.close(fd) os.remove(path) - content_disposition = response.getheader("Content-Disposition") + content_disposition = response.headers.get("Content-Disposition") if content_disposition: m = re.search( r'filename=[\'"]?([^\'"\s]+)[\'"]?', content_disposition ) assert m is not None, "Unexpected 'content-disposition' header value" - filename = m.group(1) + filename = os.path.basename(m.group(1)) # Strip any directory traversal + if filename in ("", ".", ".."): # fall back to tmp filename + filename = os.path.basename(path) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -757,3 +818,17 @@ def __deserialize_model(self, data, klass): """ return klass.from_dict(data) + + +def _flat_user_agent() -> str: + """`Flat-SDK-Python/ (python/)`. + + Derived from the package version so it can never drift from what is published. + """ + import platform + + from flat_api import __version__ + + return ( + f"Flat-SDK-Python/{__version__} (python/{platform.python_version()})" + ) diff --git a/flat_api/client.py b/flat_api/client.py new file mode 100644 index 0000000..bd793ae --- /dev/null +++ b/flat_api/client.py @@ -0,0 +1,78 @@ +"""The entry points a developer actually uses. + +``FlatClient`` is synchronous, ``AsyncFlatClient`` is its asynchronous twin. Both take the same +arguments and raise the same typed errors; only the call convention differs. +""" + +from __future__ import annotations + +from typing import Any + +from flat_api.api_client import ApiClient +from flat_api.configuration import Configuration +from flat_api.oauth import OAuth2Helper, TokenManager, Tokens +from flat_api._retry import RetryPolicy + +__all__ = ["FlatClient", "AsyncFlatClient"] + +DEFAULT_BASE_URL = "https://api.flat.io/v2" +#: A finite default. Waiting forever is not an acceptable default for an SDK. +DEFAULT_TIMEOUT = 30.0 + + +class _BaseClient: + def __init__( + self, + access_token: str | None = None, + *, + tokens: Tokens | None = None, + oauth: OAuth2Helper | None = None, + on_token_refresh: Any = None, + base_url: str = DEFAULT_BASE_URL, + timeout: float = DEFAULT_TIMEOUT, + retry: RetryPolicy | None = None, + ) -> None: + if access_token is None and tokens is None: + raise ValueError("pass either access_token= or tokens=") + if tokens is None: + tokens = Tokens(access_token=access_token or "") + + self.tokens = TokenManager(tokens, helper=oauth, on_token_refresh=on_token_refresh) + self.retry = retry if retry is not None else RetryPolicy() + self.base_url = base_url + self.timeout = timeout + + configuration = Configuration(host=base_url) + configuration.access_token = self.tokens.access_token + self._configuration = configuration + self._api_client = self._build_api_client(configuration) + + def _build_api_client(self, configuration: Configuration) -> Any: + return ApiClient(configuration) + + @property + def api_client(self) -> Any: + """The generated client, for operations not yet surfaced ergonomically.""" + return self._api_client + + def _reauthenticate(self) -> None: + """Refresh the access token and push it into the generated configuration.""" + token = self.tokens.refresh() + self._configuration.access_token = token + + +class FlatClient(_BaseClient): + """Synchronous Flat API client. + + client = FlatClient(access_token="...") + me = client.api_client # generated APIs hang off here + """ + + +class AsyncFlatClient(_BaseClient): + """Asynchronous Flat API client, backed by the ``flat_api.aio`` generation pass.""" + + def _build_api_client(self, configuration: Configuration) -> Any: + from flat_api.aio.api_client import ApiClient as AsyncApiClient + + return AsyncApiClient(configuration) diff --git a/flat_api/configuration.py b/flat_api/configuration.py index c94ccfd..ab1c071 100644 --- a/flat_api/configuration.py +++ b/flat_api/configuration.py @@ -1,11 +1,9 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -14,14 +12,18 @@ import copy +import http.client as httplib import logging from logging import FileHandler import multiprocessing import sys -from typing import Optional +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from urllib.parse import urlparse +from urllib.request import getproxies +from typing_extensions import NotRequired, Self + import urllib3 -import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -29,10 +31,114 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "OAuth2": OAuth2AuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -53,22 +159,65 @@ class Configuration: string values to replace variables in templated server configuration. The validation of enums is performed for variables with defined enum values before. + :param verify_ssl: bool - Set this to false to skip verifying SSL certificate + when calling API from https server. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: int | urllib3.util.retry.Retry - Retry configuration. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param cert_file: the path to a client certificate file, for mTLS. + :param key_file: the path to a client key file, for mTLS. + :param assert_hostname: Set this to True/False to enable/disable SSL hostname verification. + :param tls_server_name: SSL/TLS Server Name Indication (SNI). Set this to the SNI value expected by the server. + :param connection_pool_maxsize: Connection pool max size. None in the constructor is coerced to 100 for async and cpu_count * 5 for sync. + :param proxy: Proxy URL. + :param no_proxy: Comma-separated hosts that bypass the proxy. + :param proxy_headers: Proxy headers. + :param safe_chars_for_path_param: Safe characters for path parameter encoding. + :param client_side_validation: Enable client-side validation. Default True. + :param socket_options: Options to pass down to the underlying urllib3 socket. + :param datetime_format: Datetime format string for serialization. + :param date_format: Date format string for serialization. :Example: """ - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[Union[int, urllib3.util.retry.Retry]] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + cert_file: Optional[str]=None, + key_file: Optional[str]=None, + verify_ssl: bool=True, + assert_hostname: Optional[bool]=None, + tls_server_name: Optional[str]=None, + connection_pool_maxsize: Optional[int]=None, + proxy: Optional[str]=None, + no_proxy: Optional[str]=None, + proxy_headers: Optional[Any]=None, + safe_chars_for_path_param: str='', + client_side_validation: bool=True, + socket_options: Optional[Any]=None, + datetime_format: str="%Y-%m-%dT%H:%M:%S.%f%z", + date_format: str="%Y-%m-%d", + *, + debug: Optional[bool] = None, + ) -> None: """Constructor """ self._base_path = "https://api.flat.io/v2" if host is None else host @@ -82,6 +231,9 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -125,11 +277,14 @@ def __init__(self, host=None, self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ - self.verify_ssl = True + self.verify_ssl = verify_ssl """SSL/TLS verification Set this to false to skip verifying SSL certificate when calling API from https server. @@ -137,56 +292,69 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ - self.cert_file = None + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ + self.cert_file = cert_file """client certificate file """ - self.key_file = None + self.key_file = key_file """client key file """ - self.assert_hostname = None + self.assert_hostname = assert_hostname """Set this to True/False to enable/disable SSL hostname verification. """ - self.tls_server_name = None + self.tls_server_name = tls_server_name """SSL/TLS Server Name Indication (SNI) Set this to the SNI value expected by the server. """ - self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + self.connection_pool_maxsize = connection_pool_maxsize if connection_pool_maxsize is not None else multiprocessing.cpu_count() * 5 """urllib3 connection pool's maximum number of connections saved - per pool. urllib3 uses 1 connection as default value, but this is - not the best value when you are making a lot of possibly parallel - requests to the same host, which is often the case here. - cpu_count * 5 is used as default value to increase performance. - """ - - self.proxy: Optional[str] = None + per pool. None in the constructor is coerced to cpu_count * 5. + """ + + # urllib3 does not read proxy environment variables itself: + # https://github.com/urllib3/urllib3/issues/1785 + if proxy is None or no_proxy is None: + proxies = getproxies() + if proxy is None: + scheme = urlparse(self.host).scheme + proxy = proxies.get(scheme) or proxies.get("all") + if no_proxy is None: + no_proxy = proxies.get("no") + self.proxy = proxy """Proxy URL """ - self.proxy_headers = None + self.no_proxy = no_proxy + """Hosts that bypass the proxy + """ + self.proxy_headers = proxy_headers """Proxy headers """ - self.safe_chars_for_path_param = '' + self.safe_chars_for_path_param = safe_chars_for_path_param """Safe chars for path_param """ - self.retries = None - """Adding retries to override urllib3 default value 3 + self.retries = retries + """Retry configuration """ # Enable client side validation - self.client_side_validation = True + self.client_side_validation = client_side_validation - self.socket_options = None + self.socket_options = socket_options """Options to pass down to the underlying urllib3 socket """ - self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + self.datetime_format = datetime_format """datetime format """ - self.date_format = "%Y-%m-%d" + self.date_format = date_format """date format """ - def __deepcopy__(self, memo): + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -195,16 +363,16 @@ def __deepcopy__(self, memo): setattr(result, k, copy.deepcopy(v, memo)) # shallow copy of loggers result.logger = copy.copy(self.logger) - # use setters to configure loggers + # use setter to re-create the file handler (excluded from __dict__ copy) result.logger_file = self.logger_file - result.debug = self.debug + return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -215,7 +383,7 @@ def set_default(cls, default): cls._default = default @classmethod - def get_default_copy(cls): + def get_default_copy(cls) -> Self: """Deprecated. Please use `get_default` instead. Deprecated. Please use `get_default` instead. @@ -225,7 +393,7 @@ def get_default_copy(cls): return cls.get_default() @classmethod - def get_default(cls): + def get_default(cls) -> Self: """Return the default configuration. This method returns newly created, based on default constructor, @@ -235,11 +403,11 @@ def get_default(cls): :return: The configuration object. """ if cls._default is None: - cls._default = Configuration() + cls._default = cls() return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -251,7 +419,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -270,7 +438,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -279,7 +447,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -301,7 +469,7 @@ def debug(self, value): httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -312,7 +480,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -323,7 +491,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -334,13 +502,16 @@ def get_api_key_with_prefix(self, identifier, alias=None): self.refresh_api_key_hook(self) key = self.api_key.get(identifier, self.api_key.get(alias) if alias is not None else None) if key: - prefix = self.api_key_prefix.get(identifier) + prefix = self.api_key_prefix.get( + identifier, self.api_key_prefix.get(alias) if alias is not None else None) if prefix: return "%s %s" % (prefix, key) else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -351,16 +522,17 @@ def get_basic_auth_token(self): password = "" if self.password is not None: password = self.password + return urllib3.util.make_headers( basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if self.access_token is not None: auth['OAuth2'] = { 'type': 'oauth2', @@ -370,7 +542,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -378,11 +550,11 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 2.20.0\n"\ - "SDK Package Version: 1.1.0".\ + "Version of the API: 2.26.0\n"\ + "SDK Package Version: 2.0.0".\ format(env=sys.platform, pyversion=sys.version) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -394,7 +566,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -422,6 +599,7 @@ def get_host_from_settings(self, index, variables=None, servers=None): variable_name, variable['default_value']) if 'enum_values' in variable \ + and variable['enum_values'] \ and used_value not in variable['enum_values']: raise ValueError( "The variable `{0}` in the host URL has invalid value " @@ -434,12 +612,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/flat_api/errors.py b/flat_api/errors.py new file mode 100644 index 0000000..11fc5ca --- /dev/null +++ b/flat_api/errors.py @@ -0,0 +1,137 @@ +"""Typed errors for the Flat API. + +Branch on the error class, not on the status code: rate limiting and authorization failures both +return HTTP 403 and are separated only by the response body's ``code``. +""" + +from __future__ import annotations + +from typing import Any, Mapping + +__all__ = [ + "FlatError", + "FlatAuthenticationError", + "FlatAuthorizationError", + "FlatRateLimitError", + "FlatValidationError", + "FlatNotFoundError", + "FlatQuotaError", + "FlatServerError", + "from_response", +] + +RATE_LIMIT_CODE = "API_RATE_LIMIT_EXCEEDED" +QUOTA_CODES = frozenset({"QUOTA_EXCEEDED", "CREDITS_EXHAUSTED", "OMR_CREDITS_EXHAUSTED"}) + + +class FlatError(Exception): + """Base class for every error raised by this SDK.""" + + def __init__( + self, + message: str, + *, + status: int | None = None, + code: str | None = None, + request_id: str | None = None, + headers: Mapping[str, str] | None = None, + body: Any = None, + ) -> None: + super().__init__(message) + self.message = message + self.status = status + self.code = code + #: The server-provided error identifier. Present only for internal and backend errors, + #: so treat it as optional and quote it to support when you have it. + self.request_id = request_id + self.headers = dict(headers or {}) + self.body = body + + def __str__(self) -> str: + parts = [self.message] + if self.code: + parts.append(f"code={self.code}") + if self.status is not None: + parts.append(f"status={self.status}") + if self.request_id: + parts.append(f"id={self.request_id}") + return " ".join(parts) + + +class FlatAuthenticationError(FlatError): + """The token is missing, invalid or expired, or a refresh failed. Re-authorize.""" + + +class FlatAuthorizationError(FlatError): + """Authenticated but not permitted: a missing scope or insufficient permission.""" + + +class FlatRateLimitError(FlatError): + """The account or IP exceeded its request quota. Returned as HTTP 403, not 429.""" + + def __init__(self, message: str, **kwargs: Any) -> None: + super().__init__(message, **kwargs) + self.limit = _int_header(self.headers, "X-RateLimit-Limit") + self.remaining = _int_header(self.headers, "X-RateLimit-Remaining") + #: UTC epoch seconds at which the window resets. Flat sends no Retry-After header. + self.reset = _int_header(self.headers, "X-RateLimit-Reset") + + +class FlatValidationError(FlatError): + """The request body or parameters failed validation.""" + + +class FlatNotFoundError(FlatError): + """The resource does not exist, or is not visible to this token.""" + + +class FlatQuotaError(FlatError): + """A metered resource, such as OMR credits, is exhausted.""" + + +class FlatServerError(FlatError): + """An internal or backend error. ``request_id`` is normally set here.""" + + +def _int_header(headers: Mapping[str, str], name: str) -> int | None: + for key, value in headers.items(): + if key.lower() == name.lower(): + try: + return int(value) + except (TypeError, ValueError): + return None + return None + + +def from_response( + status: int, + body: Any, + headers: Mapping[str, str] | None = None, +) -> FlatError: + """Build the right error for a non-2xx response.""" + payload = body if isinstance(body, dict) else {} + code = payload.get("code") + message = payload.get("message") or f"HTTP {status}" + common = { + "status": status, + "code": code, + "request_id": payload.get("id"), + "headers": headers, + "body": body, + } + + if status == 403 and code == RATE_LIMIT_CODE: + return FlatRateLimitError(message, **common) + if code in QUOTA_CODES: + return FlatQuotaError(message, **common) + if status == 401: + return FlatAuthenticationError(message, **common) + if status == 403: + return FlatAuthorizationError(message, **common) + if status == 404: + return FlatNotFoundError(message, **common) + if status in (400, 422): + return FlatValidationError(message, **common) + if status >= 500: + return FlatServerError(message, **common) + return FlatError(message, **common) diff --git a/flat_api/exceptions.py b/flat_api/exceptions.py index 67046cb..005a786 100644 --- a/flat_api/exceptions.py +++ b/flat_api/exceptions.py @@ -1,17 +1,16 @@ -# coding: utf-8 - """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 + from typing import Any, Optional from typing_extensions import Self @@ -129,7 +128,7 @@ def __init__( self.body = http_resp.data.decode('utf-8') except Exception: pass - self.headers = http_resp.getheaders() + self.headers = http_resp.headers @classmethod def from_response( @@ -151,6 +150,13 @@ def from_response( if http_resp.status == 404: raise NotFoundException(http_resp=http_resp, body=body, data=data) + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + if 500 <= http_resp.status <= 599: raise ServiceException(http_resp=http_resp, body=body, data=data) raise ApiException(http_resp=http_resp, body=body, data=data) @@ -163,8 +169,11 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.data or self.body: - error_message += "HTTP response body: {0}\n".format(self.data or self.body) + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) return error_message @@ -189,6 +198,16 @@ class ServiceException(ApiException): pass +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + def render_path(path_to_item): """Returns a string representation of a path""" result = "" diff --git a/flat_api/models/__init__.py b/flat_api/models/__init__.py index 0158488..cd4f4f7 100644 --- a/flat_api/models/__init__.py +++ b/flat_api/models/__init__.py @@ -4,24 +4,28 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 - # import models into model package +from flat_api.models.add_group_user200_response import AddGroupUser200Response +from flat_api.models.add_group_user_request import AddGroupUserRequest from flat_api.models.api_access_token import ApiAccessToken from flat_api.models.app_scopes import AppScopes from flat_api.models.assignment import Assignment +from flat_api.models.assignment_capabilities import AssignmentCapabilities +from flat_api.models.assignment_capabilities_can_publish_in_class_error import AssignmentCapabilitiesCanPublishInClassError from flat_api.models.assignment_copy import AssignmentCopy from flat_api.models.assignment_copy_response import AssignmentCopyResponse -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities -from flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error import AssignmentCopyResponseCapabilitiesCanPublishInClassError +from flat_api.models.assignment_copy_to_class import AssignmentCopyToClass +from flat_api.models.assignment_copy_to_resource_library import AssignmentCopyToResourceLibrary +from flat_api.models.assignment_group import AssignmentGroup from flat_api.models.assignment_submission import AssignmentSubmission from flat_api.models.assignment_submission_comment import AssignmentSubmissionComment from flat_api.models.assignment_submission_comment_creation import AssignmentSubmissionCommentCreation @@ -30,18 +34,19 @@ from flat_api.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment from flat_api.models.assignment_submission_history_state import AssignmentSubmissionHistoryState from flat_api.models.assignment_submission_lti import AssignmentSubmissionLti -from flat_api.models.assignment_submission_playback_inner import AssignmentSubmissionPlaybackInner +from flat_api.models.assignment_submission_playback import AssignmentSubmissionPlayback from flat_api.models.assignment_submission_state import AssignmentSubmissionState +from flat_api.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode from flat_api.models.assignment_submission_update import AssignmentSubmissionUpdate from flat_api.models.assignment_type import AssignmentType from flat_api.models.assignment_update import AssignmentUpdate from flat_api.models.class_assignment import ClassAssignment -from flat_api.models.class_assignment_canvas import ClassAssignmentCanvas -from flat_api.models.class_assignment_lti import ClassAssignmentLti -from flat_api.models.class_assignment_mfc import ClassAssignmentMfc +from flat_api.models.class_assignment_all_of_canvas import ClassAssignmentAllOfCanvas +from flat_api.models.class_assignment_all_of_lti import ClassAssignmentAllOfLti +from flat_api.models.class_assignment_all_of_mfc import ClassAssignmentAllOfMfc from flat_api.models.class_assignment_update import ClassAssignmentUpdate -from flat_api.models.class_assignment_update_google_classroom import ClassAssignmentUpdateGoogleClassroom -from flat_api.models.class_assignment_update_microsoft_graph import ClassAssignmentUpdateMicrosoftGraph +from flat_api.models.class_assignment_update_all_of_google_classroom import ClassAssignmentUpdateAllOfGoogleClassroom +from flat_api.models.class_assignment_update_all_of_microsoft_graph import ClassAssignmentUpdateAllOfMicrosoftGraph from flat_api.models.class_attachment_creation import ClassAttachmentCreation from flat_api.models.class_creation import ClassCreation from flat_api.models.class_details import ClassDetails @@ -61,15 +66,20 @@ from flat_api.models.collection import Collection from flat_api.models.collection_app import CollectionApp from flat_api.models.collection_capabilities import CollectionCapabilities +from flat_api.models.collection_contents import CollectionContents from flat_api.models.collection_creation import CollectionCreation from flat_api.models.collection_modification import CollectionModification from flat_api.models.collection_privacy import CollectionPrivacy from flat_api.models.collection_type import CollectionType +from flat_api.models.create_lti_configuration200_response import CreateLtiConfiguration200Response +from flat_api.models.credit_transaction import CreditTransaction from flat_api.models.edu_library import EduLibrary from flat_api.models.edu_resource import EduResource +from flat_api.models.edu_resource_assignment_creation import EduResourceAssignmentCreation from flat_api.models.edu_resource_capabilities import EduResourceCapabilities from flat_api.models.edu_resource_copy import EduResourceCopy from flat_api.models.edu_resource_creation import EduResourceCreation +from flat_api.models.edu_resource_folder import EduResourceFolder from flat_api.models.edu_resource_lti_link import EduResourceLtiLink from flat_api.models.edu_resource_move import EduResourceMove from flat_api.models.edu_resource_privacy import EduResourcePrivacy @@ -78,25 +88,70 @@ from flat_api.models.edu_resource_update import EduResourceUpdate from flat_api.models.edu_resource_use_in_class import EduResourceUseInClass from flat_api.models.flat_error_response import FlatErrorResponse -from flat_api.models.flat_locales import FlatLocales from flat_api.models.google_classroom_coursework import GoogleClassroomCoursework from flat_api.models.google_classroom_submission import GoogleClassroomSubmission +from flat_api.models.grade import Grade from flat_api.models.group import Group +from flat_api.models.group_creation import GroupCreation from flat_api.models.group_details import GroupDetails from flat_api.models.group_type import GroupType from flat_api.models.license_mode import LicenseMode from flat_api.models.license_sources import LicenseSources from flat_api.models.lms_name import LmsName +from flat_api.models.lti_configuration import LtiConfiguration +from flat_api.models.lti_configuration1p1 import LtiConfiguration1p1 +from flat_api.models.lti_configuration1p1_all_of_tool import LtiConfiguration1p1AllOfTool +from flat_api.models.lti_configuration1p3 import LtiConfiguration1p3 +from flat_api.models.lti_configuration1p3_base import LtiConfiguration1p3Base +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.models.lti_configuration1p3_base_supported_services_ags import LtiConfiguration1p3BaseSupportedServicesAgs +from flat_api.models.lti_configuration1p3_base_supported_services_deep_linking import LtiConfiguration1p3BaseSupportedServicesDeepLinking +from flat_api.models.lti_configuration1p3_base_supported_services_nrps import LtiConfiguration1p3BaseSupportedServicesNrps +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from flat_api.models.lti_configuration1p3_deployment import LtiConfiguration1p3Deployment +from flat_api.models.lti_configuration1p3_dynamic import LtiConfiguration1p3Dynamic +from flat_api.models.lti_configuration1p3_manual import LtiConfiguration1p3Manual +from flat_api.models.lti_configuration_base import LtiConfigurationBase +from flat_api.models.lti_configuration_create import LtiConfigurationCreate +from flat_api.models.lti_configuration_create1p1 import LtiConfigurationCreate1p1 +from flat_api.models.lti_configuration_create1p3_deployment import LtiConfigurationCreate1p3Deployment +from flat_api.models.lti_configuration_create1p3_dynamic import LtiConfigurationCreate1p3Dynamic +from flat_api.models.lti_configuration_create1p3_dynamic_platform_info import LtiConfigurationCreate1p3DynamicPlatformInfo +from flat_api.models.lti_configuration_create1p3_manual import LtiConfigurationCreate1p3Manual +from flat_api.models.lti_configuration_update import LtiConfigurationUpdate +from flat_api.models.lti_configuration_update_deployment import LtiConfigurationUpdateDeployment +from flat_api.models.lti_configuration_update_standalone import LtiConfigurationUpdateStandalone from flat_api.models.lti_credentials import LtiCredentials from flat_api.models.lti_credentials_creation import LtiCredentialsCreation from flat_api.models.media_attachment import MediaAttachment from flat_api.models.media_score_sharing_mode import MediaScoreSharingMode from flat_api.models.microsoft_graph_assignment import MicrosoftGraphAssignment from flat_api.models.microsoft_graph_submission import MicrosoftGraphSubmission +from flat_api.models.omr_capabilities import OmrCapabilities +from flat_api.models.omr_details_step_data import OmrDetailsStepData +from flat_api.models.omr_details_submission import OmrDetailsSubmission +from flat_api.models.omr_detected_instrument import OmrDetectedInstrument +from flat_api.models.omr_imported_metadata import OmrImportedMetadata +from flat_api.models.omr_instrument_override import OmrInstrumentOverride +from flat_api.models.omr_job import OmrJob +from flat_api.models.omr_job_creation import OmrJobCreation +from flat_api.models.omr_job_file_metadata import OmrJobFileMetadata +from flat_api.models.omr_job_file_upload import OmrJobFileUpload +from flat_api.models.omr_job_file_upload_result import OmrJobFileUploadResult +from flat_api.models.omr_job_input_file import OmrJobInputFile +from flat_api.models.omr_job_output import OmrJobOutput +from flat_api.models.omr_job_progress import OmrJobProgress +from flat_api.models.omr_job_result import OmrJobResult +from flat_api.models.omr_job_retention import OmrJobRetention +from flat_api.models.omr_job_status import OmrJobStatus +from flat_api.models.omr_locale_details import OmrLocaleDetails +from flat_api.models.omr_pending_step import OmrPendingStep +from flat_api.models.omr_step_name import OmrStepName from flat_api.models.organization_invitation import OrganizationInvitation from flat_api.models.organization_invitation_creation import OrganizationInvitationCreation from flat_api.models.organization_roles import OrganizationRoles from flat_api.models.organization_user_access_token_creation import OrganizationUserAccessTokenCreation +from flat_api.models.rename_group_request import RenameGroupRequest from flat_api.models.resource_collaborator import ResourceCollaborator from flat_api.models.resource_collaborator_creation import ResourceCollaboratorCreation from flat_api.models.resource_rights import ResourceRights @@ -108,11 +163,16 @@ from flat_api.models.score_comments_counts import ScoreCommentsCounts from flat_api.models.score_creation import ScoreCreation from flat_api.models.score_creation_builder_data import ScoreCreationBuilderData -from flat_api.models.score_creation_builder_data_layout_data import ScoreCreationBuilderDataLayoutData -from flat_api.models.score_creation_builder_data_score_data import ScoreCreationBuilderDataScoreData -from flat_api.models.score_creation_builder_data_score_data_instruments_inner import ScoreCreationBuilderDataScoreDataInstrumentsInner +from flat_api.models.score_creation_builder_data_all_of_builder_data import ScoreCreationBuilderDataAllOfBuilderData +from flat_api.models.score_creation_builder_data_all_of_builder_data_layout_data import ScoreCreationBuilderDataAllOfBuilderDataLayoutData +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data import ScoreCreationBuilderDataAllOfBuilderDataScoreData +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data_instruments import ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments +from flat_api.models.score_creation_common import ScoreCreationCommon +from flat_api.models.score_creation_file_import import ScoreCreationFileImport +from flat_api.models.score_creation_google_drive_import import ScoreCreationGoogleDriveImport from flat_api.models.score_creation_type import ScoreCreationType from flat_api.models.score_details import ScoreDetails +from flat_api.models.score_details_all_of_me import ScoreDetailsAllOfMe from flat_api.models.score_fork import ScoreFork from flat_api.models.score_license import ScoreLicense from flat_api.models.score_likes_counts import ScoreLikesCounts @@ -123,8 +183,10 @@ from flat_api.models.score_revision_creation import ScoreRevisionCreation from flat_api.models.score_revision_statistics import ScoreRevisionStatistics from flat_api.models.score_source import ScoreSource +from flat_api.models.score_summary import ScoreSummary from flat_api.models.score_track import ScoreTrack from flat_api.models.score_track_creation import ScoreTrackCreation +from flat_api.models.score_track_creation_response import ScoreTrackCreationResponse from flat_api.models.score_track_point import ScoreTrackPoint from flat_api.models.score_track_purpose import ScoreTrackPurpose from flat_api.models.score_track_state import ScoreTrackState @@ -135,15 +197,18 @@ from flat_api.models.task_export_options import TaskExportOptions from flat_api.models.task_progress import TaskProgress from flat_api.models.task_result import TaskResult +from flat_api.models.teaching_theme import TeachingTheme from flat_api.models.tutteo_product import TutteoProduct from flat_api.models.user_admin_update import UserAdminUpdate from flat_api.models.user_azure_details import UserAzureDetails +from flat_api.models.user_basics import UserBasics from flat_api.models.user_community_profile_links import UserCommunityProfileLinks from flat_api.models.user_creation import UserCreation from flat_api.models.user_details import UserDetails from flat_api.models.user_details_admin import UserDetailsAdmin -from flat_api.models.user_details_admin_license import UserDetailsAdminLicense +from flat_api.models.user_details_admin_all_of_license import UserDetailsAdminAllOfLicense from flat_api.models.user_public import UserPublic from flat_api.models.user_public_summary import UserPublicSummary from flat_api.models.user_signin_link import UserSigninLink from flat_api.models.user_signin_link_creation import UserSigninLinkCreation + diff --git a/flat_api/models/add_group_user200_response.py b/flat_api/models/add_group_user200_response.py new file mode 100644 index 0000000..a1ec49e --- /dev/null +++ b/flat_api/models/add_group_user200_response.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AddGroupUser200Response(BaseModel): + """ + AddGroupUser200Response + """ # noqa: E501 + user: Optional[StrictStr] = Field(default=None, description="User ID that was added") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["user"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddGroupUser200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddGroupUser200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "user": obj.get("user") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/add_group_user_request.py b/flat_api/models/add_group_user_request.py new file mode 100644 index 0000000..b9ddd17 --- /dev/null +++ b/flat_api/models/add_group_user_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AddGroupUserRequest(BaseModel): + """ + AddGroupUserRequest + """ # noqa: E501 + user: StrictStr = Field(description="ID of the student to add") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["user"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AddGroupUserRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AddGroupUserRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "user": obj.get("user") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/api_access_token.py b/flat_api/models/api_access_token.py index eec0c96..9dfb1be 100644 --- a/flat_api/models/api_access_token.py +++ b/flat_api/models/api_access_token.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,11 +19,12 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.app_scopes import AppScopes from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ApiAccessToken(BaseModel): """ @@ -35,13 +36,15 @@ class ApiAccessToken(BaseModel): issued_date: Optional[datetime] = Field(default=None, description="The date then this token was issued ", alias="issuedDate") expiration_date: Optional[datetime] = Field(default=None, description="The date then this token will expire ", alias="expirationDate") scopes: Optional[List[AppScopes]] = Field(default=None, description="The list of scopes associated to the token ") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "name", "token", "issuedDate", "expirationDate", "scopes"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,8 +53,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -67,8 +69,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -95,6 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "expirationDate": obj.get("expirationDate"), "scopes": obj.get("scopes") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/app_scopes.py b/flat_api/models/app_scopes.py index 69ccd15..412161a 100644 --- a/flat_api/models/app_scopes.py +++ b/flat_api/models/app_scopes.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -36,6 +36,7 @@ class AppScopes(str, Enum): COLLECTIONS_DOT_READONLY = 'collections.readonly' COLLECTIONS_DOT_ADD_SCORES = 'collections.add_scores' COLLECTIONS = 'collections' + NOTIFICATIONS_DOT_READONLY = 'notifications.readonly' EDU_DOT_RESOURCES = 'edu.resources' EDU_DOT_RESOURCES_DOT_READONLY = 'edu.resources.readonly' EDU_DOT_CLASSES = 'edu.classes' @@ -48,6 +49,7 @@ class AppScopes(str, Enum): EDU_DOT_ADMIN_DOT_USERS = 'edu.admin.users' EDU_DOT_ADMIN_DOT_USERS_DOT_READONLY = 'edu.admin.users.readonly' TASKS_DOT_READONLY = 'tasks.readonly' + OMR = 'omr' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flat_api/models/assignment.py b/flat_api/models/assignment.py index cbab03c..234a859 100644 --- a/flat_api/models/assignment.py +++ b/flat_api/models/assignment.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,13 +18,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities +from flat_api.models.assignment_capabilities import AssignmentCapabilities +from flat_api.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode from flat_api.models.assignment_type import AssignmentType from flat_api.models.media_attachment import MediaAttachment from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Assignment(BaseModel): """ @@ -32,19 +34,31 @@ class Assignment(BaseModel): """ # noqa: E501 id: StrictStr = Field(description="Unique identifier of the assignment") type: AssignmentType - capabilities: AssignmentCopyResponseCapabilities + capabilities: AssignmentCapabilities title: StrictStr = Field(description="Title of the assignment") - description: Optional[StrictStr] = Field(default=None, description="Description and content of the assignment") + description: Optional[StrictStr] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[StrictStr] = Field(default=None, description="HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="descriptionHtml") + teacher_instructions: Optional[StrictStr] = Field(default=None, description="Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. ", alias="teacherInstructions") + teacher_instructions_html: Optional[StrictStr] = Field(default=None, description="HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="teacherInstructionsHtml") cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") - attachments: List[MediaAttachment] + attachments: List[MediaAttachment] = Field(description="Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. ") use_dedicated_attachments: Optional[StrictBool] = Field(default=None, description="For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. ", alias="useDedicatedAttachments") max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If set, the grading will be enabled for the assignement ", alias="maxPoints") release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") toolset: Optional[StrictStr] = Field(default=None, description="The id of the associated toolset") nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") - __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized"] + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord"] @field_validator('release_grades') def release_grades_validate_enum(cls, value): @@ -56,11 +70,22 @@ def release_grades_validate_enum(cls, value): raise ValueError("must be one of enum values ('auto', 'manual')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -69,8 +94,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -86,8 +110,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -101,10 +127,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) _items = [] if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) _dict['attachments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -119,9 +150,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type"), - "capabilities": AssignmentCopyResponseCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "capabilities": AssignmentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, "title": obj.get("title"), "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), "cover": obj.get("cover"), "coverFile": obj.get("coverFile"), "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, @@ -130,8 +164,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "releaseGrades": obj.get("releaseGrades"), "shuffleExercises": obj.get("shuffleExercises"), "toolset": obj.get("toolset"), - "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized") + "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_copy_response_capabilities.py b/flat_api/models/assignment_capabilities.py similarity index 50% rename from flat_api/models/assignment_copy_response_capabilities.py rename to flat_api/models/assignment_capabilities.py index ef39515..2f01f0d 100644 --- a/flat_api/models/assignment_copy_response_capabilities.py +++ b/flat_api/models/assignment_capabilities.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,28 +18,31 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional -from flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error import AssignmentCopyResponseCapabilitiesCanPublishInClassError +from flat_api.models.assignment_capabilities_can_publish_in_class_error import AssignmentCapabilitiesCanPublishInClassError from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python -class AssignmentCopyResponseCapabilities(BaseModel): +class AssignmentCapabilities(BaseModel): """ Capabilities the current user has on this assignment. Each capability corresponds to a fine-grained action that a user may take. """ # noqa: E501 can_edit: StrictBool = Field(description="Whether the current user can edit the assignment ", alias="canEdit") can_publish_in_class: StrictBool = Field(description="Whether this assignment can be published in a class ", alias="canPublishInClass") - can_publish_in_class_error: Optional[AssignmentCopyResponseCapabilitiesCanPublishInClassError] = Field(default=None, alias="canPublishInClassError") + can_publish_in_class_error: Optional[AssignmentCapabilitiesCanPublishInClassError] = Field(default=None, alias="canPublishInClassError") can_archive: StrictBool = Field(description="Whether the current user can archive the assignment ", alias="canArchive") can_unarchive: StrictBool = Field(description="Whether the current user can unarchive the assignment ", alias="canUnarchive") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["canEdit", "canPublishInClass", "canPublishInClassError", "canArchive", "canUnarchive"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -48,12 +51,11 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AssignmentCopyResponseCapabilities from a JSON string""" + """Create an instance of AssignmentCapabilities from a JSON string""" return cls.from_dict(json.loads(json_str)) def to_dict(self) -> Dict[str, Any]: @@ -65,8 +67,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -77,11 +81,16 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of can_publish_in_class_error if self.can_publish_in_class_error: _dict['canPublishInClassError'] = self.can_publish_in_class_error.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AssignmentCopyResponseCapabilities from a dict""" + """Create an instance of AssignmentCapabilities from a dict""" if obj is None: return None @@ -91,10 +100,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "canEdit": obj.get("canEdit"), "canPublishInClass": obj.get("canPublishInClass"), - "canPublishInClassError": AssignmentCopyResponseCapabilitiesCanPublishInClassError.from_dict(obj["canPublishInClassError"]) if obj.get("canPublishInClassError") is not None else None, + "canPublishInClassError": AssignmentCapabilitiesCanPublishInClassError.from_dict(obj["canPublishInClassError"]) if obj.get("canPublishInClassError") is not None else None, "canArchive": obj.get("canArchive"), "canUnarchive": obj.get("canUnarchive") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_capabilities_can_publish_in_class_error.py b/flat_api/models/assignment_capabilities_can_publish_in_class_error.py new file mode 100644 index 0000000..90571c7 --- /dev/null +++ b/flat_api/models/assignment_capabilities_can_publish_in_class_error.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCapabilitiesCanPublishInClassError(BaseModel): + """ + If `canPublishInClass` and `canEdit` are false, the issue why this assignment cannot be published in a class + """ # noqa: E501 + code: StrictStr = Field(description="A corresponding code for this error") + message: StrictStr = Field(description="A printable and localized message for this error") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCapabilitiesCanPublishInClassError from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCapabilitiesCanPublishInClassError from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/assignment_copy.py b/flat_api/models/assignment_copy.py index 596a712..bc5f89e 100644 --- a/flat_api/models/assignment_copy.py +++ b/flat_api/models/assignment_copy.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -14,84 +14,125 @@ from __future__ import annotations -import pprint -import re # noqa: F401 import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.models.assignment_copy_to_class import AssignmentCopyToClass +from flat_api.models.assignment_copy_to_resource_library import AssignmentCopyToResourceLibrary +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self -from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self +ASSIGNMENTCOPY_ONE_OF_SCHEMAS = ["AssignmentCopyToClass", "AssignmentCopyToResourceLibrary"] class AssignmentCopy(BaseModel): """ AssignmentCopy - """ # noqa: E501 - classroom: StrictStr = Field(description="The destination classroom where the assignment will be copied") - assignment: Optional[StrictStr] = Field(default=None, description="An optional destination assignment where the original assignement will be copied. Must be a draft.") - scheduled_date: Optional[datetime] = Field(default=None, description="The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. Alternatively the existing `scheduledDate` from the copied assignment will be used. ", alias="scheduledDate") - library_parent: StrictStr = Field(description="Identifier of the parent resource where the new one will created, e.g. a folder id or `root`", alias="libraryParent") - verify_if_not_already_in_resource_library: Optional[StrictBool] = Field(default=None, description="Option to check if the assignment is already in Resource Library", alias="verifyIfNotAlreadyInResourceLibrary") - __properties: ClassVar[List[str]] = ["classroom", "assignment", "scheduledDate", "libraryParent", "verifyIfNotAlreadyInResourceLibrary"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + """ + # data type: AssignmentCopyToClass + oneof_schema_1_validator: Optional[AssignmentCopyToClass] = None + # data type: AssignmentCopyToResourceLibrary + oneof_schema_2_validator: Optional[AssignmentCopyToResourceLibrary] = None + actual_instance: Optional[Union[AssignmentCopyToClass, AssignmentCopyToResourceLibrary]] = None + one_of_schemas: Set[str] = { "AssignmentCopyToClass", "AssignmentCopyToResourceLibrary" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = AssignmentCopy.model_construct() + error_messages = [] + match = 0 + # validate data type: AssignmentCopyToClass + if not isinstance(v, AssignmentCopyToClass): + error_messages.append(f"Error! Input type `{type(v)}` is not `AssignmentCopyToClass`") + else: + match += 1 + # validate data type: AssignmentCopyToResourceLibrary + if not isinstance(v, AssignmentCopyToResourceLibrary): + error_messages.append(f"Error! Input type `{type(v)}` is not `AssignmentCopyToResourceLibrary`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. Details: " + ", ".join(error_messages)) + else: + return v @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AssignmentCopy from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AssignmentCopy from a dict""" - if obj is None: + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into AssignmentCopyToClass + try: + instance.actual_instance = AssignmentCopyToClass.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into AssignmentCopyToResourceLibrary + try: + instance.actual_instance = AssignmentCopyToResourceLibrary.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 AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into AssignmentCopy with oneOf schemas: AssignmentCopyToClass, AssignmentCopyToResourceLibrary. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], AssignmentCopyToClass, AssignmentCopyToResourceLibrary]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: return None - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "classroom": obj.get("classroom"), - "assignment": obj.get("assignment"), - "scheduledDate": obj.get("scheduledDate"), - "libraryParent": obj.get("libraryParent"), - "verifyIfNotAlreadyInResourceLibrary": obj.get("verifyIfNotAlreadyInResourceLibrary") - }) - return _obj + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/flat_api/models/assignment_copy_response.py b/flat_api/models/assignment_copy_response.py index acae4f5..fe52ee4 100644 --- a/flat_api/models/assignment_copy_response.py +++ b/flat_api/models/assignment_copy_response.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,13 +18,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities +from flat_api.models.assignment_capabilities import AssignmentCapabilities +from flat_api.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode from flat_api.models.assignment_type import AssignmentType from flat_api.models.media_attachment import MediaAttachment from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentCopyResponse(BaseModel): """ @@ -32,20 +34,32 @@ class AssignmentCopyResponse(BaseModel): """ # noqa: E501 id: StrictStr = Field(description="Unique identifier of the assignment") type: AssignmentType - capabilities: AssignmentCopyResponseCapabilities + capabilities: AssignmentCapabilities title: StrictStr = Field(description="Title of the assignment") - description: Optional[StrictStr] = Field(default=None, description="Description and content of the assignment") + description: Optional[StrictStr] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[StrictStr] = Field(default=None, description="HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="descriptionHtml") + teacher_instructions: Optional[StrictStr] = Field(default=None, description="Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. ", alias="teacherInstructions") + teacher_instructions_html: Optional[StrictStr] = Field(default=None, description="HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="teacherInstructionsHtml") cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") - attachments: List[MediaAttachment] + attachments: List[MediaAttachment] = Field(description="Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. ") use_dedicated_attachments: Optional[StrictBool] = Field(default=None, description="For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. ", alias="useDedicatedAttachments") max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If set, the grading will be enabled for the assignement ", alias="maxPoints") release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") toolset: Optional[StrictStr] = Field(default=None, description="The id of the associated toolset") nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") resource: Optional[StrictStr] = Field(default=None, description="If this assignment is stored as a resource in the Flat for Education Resource Library, the unique identifier of the resource.") - __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "resource"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord", "resource"] @field_validator('release_grades') def release_grades_validate_enum(cls, value): @@ -57,11 +71,22 @@ def release_grades_validate_enum(cls, value): raise ValueError("must be one of enum values ('auto', 'manual')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -70,8 +95,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -87,8 +111,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -102,10 +128,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) _items = [] if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) _dict['attachments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -120,9 +151,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type"), - "capabilities": AssignmentCopyResponseCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "capabilities": AssignmentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, "title": obj.get("title"), "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), "cover": obj.get("cover"), "coverFile": obj.get("coverFile"), "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, @@ -132,8 +166,21 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "shuffleExercises": obj.get("shuffleExercises"), "toolset": obj.get("toolset"), "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord"), "resource": obj.get("resource") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_copy_response_capabilities_can_publish_in_class_error.py b/flat_api/models/assignment_copy_response_capabilities_can_publish_in_class_error.py deleted file mode 100644 index 60b7c1f..0000000 --- a/flat_api/models/assignment_copy_response_capabilities_can_publish_in_class_error.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List -from typing import Optional, Set -from typing_extensions import Self - -class AssignmentCopyResponseCapabilitiesCanPublishInClassError(BaseModel): - """ - If `canPublishInClass` and `canEdit` are false, the issue why this assignment cannot be published in a class - """ # noqa: E501 - code: StrictStr = Field(description="A corresponding code for this error") - message: StrictStr = Field(description="A printable and localized message for this error") - __properties: ClassVar[List[str]] = ["code", "message"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AssignmentCopyResponseCapabilitiesCanPublishInClassError from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AssignmentCopyResponseCapabilitiesCanPublishInClassError from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "code": obj.get("code"), - "message": obj.get("message") - }) - return _obj - - diff --git a/flat_api/models/assignment_copy_to_class.py b/flat_api/models/assignment_copy_to_class.py new file mode 100644 index 0000000..f931c0a --- /dev/null +++ b/flat_api/models/assignment_copy_to_class.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCopyToClass(BaseModel): + """ + Copy the assignment to a class + """ # noqa: E501 + classroom: StrictStr = Field(description="The destination classroom where the assignment will be copied") + assignment: Optional[StrictStr] = Field(default=None, description="An optional destination assignment where the original assignement will be copied. Must be a draft.") + scheduled_date: Optional[datetime] = Field(default=None, description="The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. Alternatively the existing `scheduledDate` from the copied assignment will be used. ", alias="scheduledDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["classroom", "assignment", "scheduledDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCopyToClass from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCopyToClass from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "classroom": obj.get("classroom"), + "assignment": obj.get("assignment"), + "scheduledDate": obj.get("scheduledDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/assignment_copy_to_resource_library.py b/flat_api/models/assignment_copy_to_resource_library.py new file mode 100644 index 0000000..e3a0e30 --- /dev/null +++ b/flat_api/models/assignment_copy_to_resource_library.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentCopyToResourceLibrary(BaseModel): + """ + Copy the assignment to the EDU Resource Library + """ # noqa: E501 + library_parent: StrictStr = Field(description="Identifier of the parent resource where the new one will created, e.g. a folder id or `root`", alias="libraryParent") + verify_if_not_already_in_resource_library: Optional[StrictBool] = Field(default=None, description="Option to check if the assignment is already in Resource Library", alias="verifyIfNotAlreadyInResourceLibrary") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["libraryParent", "verifyIfNotAlreadyInResourceLibrary"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentCopyToResourceLibrary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentCopyToResourceLibrary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "libraryParent": obj.get("libraryParent"), + "verifyIfNotAlreadyInResourceLibrary": obj.get("verifyIfNotAlreadyInResourceLibrary") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/assignment_group.py b/flat_api/models/assignment_group.py new file mode 100644 index 0000000..d4b3685 --- /dev/null +++ b/flat_api/models/assignment_group.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentGroup(BaseModel): + """ + A group assigned to an assignment for shared writing assignments + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the group") + name: StrictStr = Field(description="The display name of the group") + parent: Optional[StrictStr] = Field(default=None, description="The unique identifier of the parent class group. Only available for groups of type 'assignmentStudentsSubGroup'. May be null if the parent class group was deleted.") + members: List[StrictStr] = Field(description="Array of user IDs that are members of this group") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "parent", "members"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentGroup from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentGroup from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "name": obj.get("name"), + "parent": obj.get("parent"), + "members": obj.get("members") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/assignment_submission.py b/flat_api/models/assignment_submission.py index 85aae91..eb8d785 100644 --- a/flat_api/models/assignment_submission.py +++ b/flat_api/models/assignment_submission.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,17 +18,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from flat_api.models.assignment_submission_comments import AssignmentSubmissionComments from flat_api.models.assignment_submission_lti import AssignmentSubmissionLti -from flat_api.models.assignment_submission_playback_inner import AssignmentSubmissionPlaybackInner +from flat_api.models.assignment_submission_playback import AssignmentSubmissionPlayback from flat_api.models.assignment_submission_state import AssignmentSubmissionState from flat_api.models.google_classroom_submission import GoogleClassroomSubmission from flat_api.models.media_attachment import MediaAttachment from flat_api.models.microsoft_graph_submission import MicrosoftGraphSubmission from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmission(BaseModel): """ @@ -48,18 +49,20 @@ class AssignmentSubmission(BaseModel): draft_grade: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission", alias="draftGrade") max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Optional max points for the grade. If set, a corresponding `draftGrade` or `grade` will be set.", alias="maxPoints") exercises_ids: Optional[List[StrictStr]] = Field(default=None, description="The ids of exercises when they need to be in a specific order", alias="exercisesIds") - playback: List[AssignmentSubmissionPlaybackInner] + playback: List[AssignmentSubmissionPlayback] comments: AssignmentSubmissionComments google_classroom: Optional[GoogleClassroomSubmission] = Field(default=None, alias="googleClassroom") microsoft_graph: Optional[MicrosoftGraphSubmission] = Field(default=None, alias="microsoftGraph") lti: Optional[AssignmentSubmissionLti] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "state", "classroom", "assignment", "creator", "creationDate", "attachments", "submissionDate", "returnDate", "returnCreator", "grade", "draftGrade", "maxPoints", "exercisesIds", "playback", "comments", "googleClassroom", "microsoftGraph", "lti"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -68,8 +71,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -85,8 +87,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -97,16 +101,16 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) _items = [] if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) _dict['attachments'] = _items # override the default output from pydantic by calling `to_dict()` of each item in playback (list) _items = [] if self.playback: - for _item in self.playback: - if _item: - _items.append(_item.to_dict()) + for _item_playback in self.playback: + if _item_playback: + _items.append(_item_playback.to_dict()) _dict['playback'] = _items # override the default output from pydantic by calling `to_dict()` of comments if self.comments: @@ -120,6 +124,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of lti if self.lti: _dict['lti'] = self.lti.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if grade (nullable) is None # and model_fields_set contains the field if self.grade is None and "grade" in self.model_fields_set: @@ -156,12 +165,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "draftGrade": obj.get("draftGrade"), "maxPoints": obj.get("maxPoints"), "exercisesIds": obj.get("exercisesIds"), - "playback": [AssignmentSubmissionPlaybackInner.from_dict(_item) for _item in obj["playback"]] if obj.get("playback") is not None else None, + "playback": [AssignmentSubmissionPlayback.from_dict(_item) for _item in obj["playback"]] if obj.get("playback") is not None else None, "comments": AssignmentSubmissionComments.from_dict(obj["comments"]) if obj.get("comments") is not None else None, "googleClassroom": GoogleClassroomSubmission.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, "microsoftGraph": MicrosoftGraphSubmission.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, "lti": AssignmentSubmissionLti.from_dict(obj["lti"]) if obj.get("lti") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_submission_comment.py b/flat_api/models/assignment_submission_comment.py index b4174aa..56983e4 100644 --- a/flat_api/models/assignment_submission_comment.py +++ b/flat_api/models/assignment_submission_comment.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,10 +19,11 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmissionComment(BaseModel): """ @@ -35,13 +36,15 @@ class AssignmentSubmissionComment(BaseModel): modification_date: Optional[datetime] = Field(default=None, description="The date of the last comment modification", alias="modificationDate") comment: Optional[StrictStr] = Field(default=None, description="The comment text") unread: Optional[StrictBool] = Field(default=None, description="True if the comment is unread by the current user") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "user", "submission", "date", "modificationDate", "comment", "unread"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,8 +53,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -67,8 +69,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -96,6 +105,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "comment": obj.get("comment"), "unread": obj.get("unread") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_submission_comment_creation.py b/flat_api/models/assignment_submission_comment_creation.py index d10da33..f3e3f6f 100644 --- a/flat_api/models/assignment_submission_comment_creation.py +++ b/flat_api/models/assignment_submission_comment_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmissionCommentCreation(BaseModel): """ Creation of a assignment submission comment """ # noqa: E501 comment: StrictStr = Field(description="The comment text") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["comment"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "comment": obj.get("comment") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_submission_comments.py b/flat_api/models/assignment_submission_comments.py index a12a87a..b499aa9 100644 --- a/flat_api/models/assignment_submission_comments.py +++ b/flat_api/models/assignment_submission_comments.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmissionComments(BaseModel): """ @@ -29,13 +30,15 @@ class AssignmentSubmissionComments(BaseModel): """ # noqa: E501 total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of comments added to the submission") unread: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of unread comments for the current user") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["total", "unread"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total": obj.get("total"), "unread": obj.get("unread") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_submission_history.py b/flat_api/models/assignment_submission_history.py index 672153f..f4bf103 100644 --- a/flat_api/models/assignment_submission_history.py +++ b/flat_api/models/assignment_submission_history.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,12 +19,13 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from flat_api.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment from flat_api.models.assignment_submission_history_state import AssignmentSubmissionHistoryState from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmissionHistory(BaseModel): """ @@ -43,6 +44,7 @@ class AssignmentSubmissionHistory(BaseModel): comment: Optional[StrictStr] = Field(default=None, description="The comment that is made to this submission") due_date: Optional[datetime] = Field(default=None, description="The due date of this assignment", alias="dueDate") attachment: Optional[AssignmentSubmissionHistoryAttachment] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["date", "classroom", "assignment", "submission", "users", "source", "state", "draftGrade", "grade", "maxPoints", "comment", "dueDate", "attachment"] @field_validator('source') @@ -55,11 +57,12 @@ def source_validate_enum(cls, value): raise ValueError("must be one of enum values ('lti', 'googleClassroom', 'microsoftGraph')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -68,8 +71,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -85,8 +87,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -97,6 +101,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of attachment if self.attachment: _dict['attachment'] = self.attachment.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -123,6 +132,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "dueDate": obj.get("dueDate"), "attachment": AssignmentSubmissionHistoryAttachment.from_dict(obj["attachment"]) if obj.get("attachment") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_submission_history_attachment.py b/flat_api/models/assignment_submission_history_attachment.py index 90dde2e..12c1edf 100644 --- a/flat_api/models/assignment_submission_history_attachment.py +++ b/flat_api/models/assignment_submission_history_attachment.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmissionHistoryAttachment(BaseModel): """ @@ -30,13 +31,15 @@ class AssignmentSubmissionHistoryAttachment(BaseModel): score: Optional[StrictStr] = Field(default=None, description="The score identifier that changed") revision: Optional[StrictStr] = Field(default=None, description="The revision identifier that changed") title: Optional[StrictStr] = Field(default=None, description="The title of the score that changed") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["score", "revision", "title"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,6 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "revision": obj.get("revision"), "title": obj.get("title") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_submission_history_state.py b/flat_api/models/assignment_submission_history_state.py index fed57ae..64ee184 100644 --- a/flat_api/models/assignment_submission_history_state.py +++ b/flat_api/models/assignment_submission_history_state.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/assignment_submission_lti.py b/flat_api/models/assignment_submission_lti.py index 3cc5b15..8f1add3 100644 --- a/flat_api/models/assignment_submission_lti.py +++ b/flat_api/models/assignment_submission_lti.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,34 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmissionLti(BaseModel): """ - AssignmentSubmissionLti + If set, this submission has a linked LTI 1.3 AGS or LTI 1.1 Outcomes """ # noqa: E501 - sourcedid: StrictStr = Field(description="The sourcedid of the LTI submission when using LTI Outcomes") - __properties: ClassVar[List[str]] = ["sourcedid"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + grade_service: StrictStr = Field(description="The kind of grading service available for this submission: - `ags2p0`: LTI 1.3 Assignment and Grade Services 2.0 - `outcomes1p1`: LTI 1.1 Outcomes 1.1 ", alias="gradeService") + sourcedid: Optional[StrictStr] = Field(default=None, description="The sourcedid of the LTI submission when using LTI Outcomes") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["gradeService", "sourcedid"] + + @field_validator('grade_service') + def grade_service_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ags2p0', 'outcomes1p1']): + raise ValueError("must be one of enum values ('ags2p0', 'outcomes1p1')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +70,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -81,8 +98,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "gradeService": obj.get("gradeService"), "sourcedid": obj.get("sourcedid") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_submission_playback.py b/flat_api/models/assignment_submission_playback.py new file mode 100644 index 0000000..e950918 --- /dev/null +++ b/flat_api/models/assignment_submission_playback.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class AssignmentSubmissionPlayback(BaseModel): + """ + Playback used by a student for an assignment submission. + """ # noqa: E501 + score: StrictStr = Field(description="The score unique identifier") + nb_play_attempt: Union[StrictFloat, StrictInt] = Field(description="Number of times the score was played", alias="nbPlayAttempt") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["score", "nbPlayAttempt"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of AssignmentSubmissionPlayback from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of AssignmentSubmissionPlayback from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "score": obj.get("score"), + "nbPlayAttempt": obj.get("nbPlayAttempt") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/assignment_submission_playback_inner.py b/flat_api/models/assignment_submission_playback_inner.py deleted file mode 100644 index 1f428da..0000000 --- a/flat_api/models/assignment_submission_playback_inner.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr -from typing import Any, ClassVar, Dict, List, Union -from typing import Optional, Set -from typing_extensions import Self - -class AssignmentSubmissionPlaybackInner(BaseModel): - """ - Playback used by student in this submission (used to limit the playback for the assignment) - """ # noqa: E501 - score: StrictStr = Field(description="The score unique identifier") - nb_play_attempt: Union[StrictFloat, StrictInt] = Field(description="The number of playback used by the student", alias="nbPlayAttempt") - __properties: ClassVar[List[str]] = ["score", "nbPlayAttempt"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of AssignmentSubmissionPlaybackInner from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of AssignmentSubmissionPlaybackInner from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "score": obj.get("score"), - "nbPlayAttempt": obj.get("nbPlayAttempt") - }) - return _obj - - diff --git a/flat_api/models/assignment_submission_state.py b/flat_api/models/assignment_submission_state.py index 2e86d0e..a1a2230 100644 --- a/flat_api/models/assignment_submission_state.py +++ b/flat_api/models/assignment_submission_state.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/assignment_submission_students_mode.py b/flat_api/models/assignment_submission_students_mode.py new file mode 100644 index 0000000..ba298d3 --- /dev/null +++ b/flat_api/models/assignment_submission_students_mode.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class AssignmentSubmissionStudentsMode(str, Enum): + """ + Submission mode for assignments: - \"single\": Individual submissions (default) - \"group\": Group submissions (for shared writing assignments) + """ + + """ + allowed enum values + """ + SINGLE = 'single' + GROUP = 'group' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of AssignmentSubmissionStudentsMode from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/models/assignment_submission_update.py b/flat_api/models/assignment_submission_update.py index 11b65f4..8bc308b 100644 --- a/flat_api/models/assignment_submission_update.py +++ b/flat_api/models/assignment_submission_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,30 +18,35 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated +from flat_api.models.assignment_submission_playback import AssignmentSubmissionPlayback from flat_api.models.class_attachment_creation import ClassAttachmentCreation from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentSubmissionUpdate(BaseModel): """ Assignment Submission creation """ # noqa: E501 attachments: Optional[List[ClassAttachmentCreation]] = None + playback: Optional[List[AssignmentSubmissionPlayback]] = None submit: Optional[StrictBool] = Field(default=None, description="If `true`, the submission will be marked as done") draft_grade: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="Optional grade. If unset, no grade was set. This value is only visible by the teacher, and we will be set to `grade` once the teacher returns the submission", alias="draftGrade") grade: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="Optional grade. If unset, no grade was set.") exercises_ids: Optional[List[StrictStr]] = Field(default=None, description="The ids of exercises when they need to be in a specific order", alias="exercisesIds") var_return: Optional[StrictBool] = Field(default=None, description="If `true`, the submission will be marked as done", alias="return") - __properties: ClassVar[List[str]] = ["attachments", "submit", "draftGrade", "grade", "exercisesIds", "return"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["attachments", "playback", "submit", "draftGrade", "grade", "exercisesIds", "return"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,8 +55,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -67,8 +71,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,10 +85,22 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) _items = [] if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in playback (list) + _items = [] + if self.playback: + for _item_playback in self.playback: + if _item_playback: + _items.append(_item_playback.to_dict()) + _dict['playback'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if draft_grade (nullable) is None # and model_fields_set contains the field if self.draft_grade is None and "draft_grade" in self.model_fields_set: @@ -111,12 +129,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "attachments": [ClassAttachmentCreation.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, + "playback": [AssignmentSubmissionPlayback.from_dict(_item) for _item in obj["playback"]] if obj.get("playback") is not None else None, "submit": obj.get("submit"), "draftGrade": obj.get("draftGrade"), "grade": obj.get("grade"), "exercisesIds": obj.get("exercisesIds"), "return": obj.get("return") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/assignment_type.py b/flat_api/models/assignment_type.py index dfed2f3..77eef64 100644 --- a/flat_api/models/assignment_type.py +++ b/flat_api/models/assignment_type.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -32,6 +32,7 @@ class AssignmentType(str, Enum): SCORETEMPLATE = 'scoreTemplate' SHAREDWRITING = 'sharedWriting' WORKSHEET = 'worksheet' + WORKSHEETTEXT = 'worksheetText' PERFORMANCE = 'performance' @classmethod diff --git a/flat_api/models/assignment_update.py b/flat_api/models/assignment_update.py index 2b5536b..cfbe7e9 100644 --- a/flat_api/models/assignment_update.py +++ b/flat_api/models/assignment_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,13 +18,15 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated +from flat_api.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode from flat_api.models.assignment_type import AssignmentType from flat_api.models.class_attachment_creation import ClassAttachmentCreation from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class AssignmentUpdate(BaseModel): """ @@ -32,16 +34,28 @@ class AssignmentUpdate(BaseModel): """ # noqa: E501 type: Optional[AssignmentType] = None title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Title of the assignment") - description: Optional[StrictStr] = Field(default=None, description="Description and content of the assignment") - attachments: Optional[List[ClassAttachmentCreation]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of student instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="descriptionHtml") + teacher_instructions: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Teacher-only instructions (plain text)", alias="teacherInstructions") + teacher_instructions_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of teacher-only instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="teacherInstructionsHtml") + attachments: Optional[List[ClassAttachmentCreation]] = Field(default=None, description="The complete attachment list. Omitting this property on an update leaves the existing attachments alone; sending it replaces them. Dropping a dedicated score from the list deletes the students' copies of it, so send the full set you want to keep rather than only the additions. Duplicates, judged by `url`, `score`, `worksheet` or `googleDriveFileId`, are discarded silently, and exceeding the per-assignment limit fails with `ASSIGNMENT_ATTACHMENTS_LIMIT`. ") nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") toolset: Optional[StrictStr] = Field(default=None, description="The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. ") cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") max_points: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="If set, the grading will be enabled for the assignement with this value as the maximum of points ", alias="maxPoints") release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") - __properties: ClassVar[List[str]] = ["type", "title", "description", "attachments", "nbPlaybackAuthorized", "toolset", "coverFile", "cover", "maxPoints", "releaseGrades", "shuffleExercises"] + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "attachments", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "toolset", "coverFile", "cover", "maxPoints", "releaseGrades", "shuffleExercises", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord"] @field_validator('release_grades') def release_grades_validate_enum(cls, value): @@ -53,11 +67,22 @@ def release_grades_validate_enum(cls, value): raise ValueError("must be one of enum values ('auto', 'manual')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -66,8 +91,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -83,8 +107,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -95,10 +121,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) _items = [] if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) _dict['attachments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if nb_playback_authorized (nullable) is None # and model_fields_set contains the field if self.nb_playback_authorized is None and "nb_playback_authorized" in self.model_fields_set: @@ -139,15 +170,31 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "title": obj.get("title"), "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), "attachments": [ClassAttachmentCreation.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), "toolset": obj.get("toolset"), "coverFile": obj.get("coverFile"), "cover": obj.get("cover"), "maxPoints": obj.get("maxPoints"), "releaseGrades": obj.get("releaseGrades"), - "shuffleExercises": obj.get("shuffleExercises") + "shuffleExercises": obj.get("shuffleExercises"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_assignment.py b/flat_api/models/class_assignment.py index d9b907c..dba9b60 100644 --- a/flat_api/models/class_assignment.py +++ b/flat_api/models/class_assignment.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,19 +19,22 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities +from flat_api.models.assignment_capabilities import AssignmentCapabilities +from flat_api.models.assignment_group import AssignmentGroup from flat_api.models.assignment_submission import AssignmentSubmission +from flat_api.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode from flat_api.models.assignment_type import AssignmentType -from flat_api.models.class_assignment_canvas import ClassAssignmentCanvas -from flat_api.models.class_assignment_lti import ClassAssignmentLti -from flat_api.models.class_assignment_mfc import ClassAssignmentMfc +from flat_api.models.class_assignment_all_of_canvas import ClassAssignmentAllOfCanvas +from flat_api.models.class_assignment_all_of_lti import ClassAssignmentAllOfLti +from flat_api.models.class_assignment_all_of_mfc import ClassAssignmentAllOfMfc from flat_api.models.google_classroom_coursework import GoogleClassroomCoursework from flat_api.models.media_attachment import MediaAttachment from flat_api.models.microsoft_graph_assignment import MicrosoftGraphAssignment from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassAssignment(BaseModel): """ @@ -39,34 +42,47 @@ class ClassAssignment(BaseModel): """ # noqa: E501 id: StrictStr = Field(description="Unique identifier of the assignment") type: AssignmentType - capabilities: AssignmentCopyResponseCapabilities + capabilities: AssignmentCapabilities title: StrictStr = Field(description="Title of the assignment") - description: Optional[StrictStr] = Field(default=None, description="Description and content of the assignment") + description: Optional[StrictStr] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[StrictStr] = Field(default=None, description="HTML version of student instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="descriptionHtml") + teacher_instructions: Optional[StrictStr] = Field(default=None, description="Teacher-only instructions for this assignment. These instructions are only visible to teachers and are not returned when students view the assignment. If `teacherInstructionsHtml` is provided, this field will contain the plain text version for compatibility. ", alias="teacherInstructions") + teacher_instructions_html: Optional[StrictStr] = Field(default=None, description="HTML version of teacher-only instructions with rich text formatting. Supports the following HTML tags: p, br, strong, b, em, i, u, a, ul, ol, li, h1, h2, h3, img. Images are served as absolute http(s) URLs. ", alias="teacherInstructionsHtml") cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") - attachments: List[MediaAttachment] + attachments: List[MediaAttachment] = Field(description="Reference material handed to the students with the assignment: scores, videos, links and Drive files. A score attached here is the one each student receives their own copy of. ") use_dedicated_attachments: Optional[StrictBool] = Field(default=None, description="For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. ", alias="useDedicatedAttachments") max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If set, the grading will be enabled for the assignement ", alias="maxPoints") release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") toolset: Optional[StrictStr] = Field(default=None, description="The id of the associated toolset") nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") creator: Optional[StrictStr] = Field(default=None, description="The User unique identifier of the creator of this assignment ") - state: Optional[StrictStr] = Field(default=None, description="State of the assignment") + state: StrictStr = Field(description="State of the assignment") classroom: Optional[StrictStr] = Field(default=None, description="The unique identifier of the class where this assignment was posted") - creation_date: Optional[datetime] = Field(default=None, description="The creation date of this assignment", alias="creationDate") + creation_date: datetime = Field(description="The creation date of this assignment", alias="creationDate") scheduled_date: Optional[datetime] = Field(default=None, description="The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. ", alias="scheduledDate") due_date: Optional[datetime] = Field(default=None, description="The due date of this assignment, late submissions will be marked as paste due. ", alias="dueDate") assignee_mode: Optional[StrictStr] = Field(default=None, description="Possible modes of assigning assignments", alias="assigneeMode") assigned_students: Optional[List[StrictStr]] = Field(default=None, description="Identifiers for the students that have access to the assignment", alias="assignedStudents") - submissions: Optional[List[AssignmentSubmission]] = None + assigned_groups: Optional[List[AssignmentGroup]] = Field(default=None, description="Groups that have access to the assignment (for shared writing assignments)", alias="assignedGroups") + submissions: List[AssignmentSubmission] google_classroom: Optional[GoogleClassroomCoursework] = Field(default=None, alias="googleClassroom") microsoft_graph: Optional[MicrosoftGraphAssignment] = Field(default=None, alias="microsoftGraph") - mfc: Optional[ClassAssignmentMfc] = None - canvas: Optional[ClassAssignmentCanvas] = None - lti: Optional[ClassAssignmentLti] = None + mfc: Optional[ClassAssignmentAllOfMfc] = None + canvas: Optional[ClassAssignmentAllOfCanvas] = None + lti: Optional[ClassAssignmentAllOfLti] = None issue: Optional[StrictStr] = Field(default=None, description="Detected issue for this assignment") - __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "creator", "state", "classroom", "creationDate", "scheduledDate", "dueDate", "assigneeMode", "assignedStudents", "submissions", "googleClassroom", "microsoftGraph", "mfc", "canvas", "lti", "issue"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord", "creator", "state", "classroom", "creationDate", "scheduledDate", "dueDate", "assigneeMode", "assignedStudents", "assignedGroups", "submissions", "googleClassroom", "microsoftGraph", "mfc", "canvas", "lti", "issue"] @field_validator('release_grades') def release_grades_validate_enum(cls, value): @@ -78,12 +94,19 @@ def release_grades_validate_enum(cls, value): raise ValueError("must be one of enum values ('auto', 'manual')") return value - @field_validator('state') - def state_validate_enum(cls, value): + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): """Validates the enum""" if value is None: return value + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" if value not in set(['draft', 'active', 'archived']): raise ValueError("must be one of enum values ('draft', 'active', 'archived')") return value @@ -98,11 +121,12 @@ def assignee_mode_validate_enum(cls, value): raise ValueError("must be one of enum values ('everyone', 'selected')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -111,8 +135,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -128,8 +151,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -143,16 +168,23 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) _items = [] if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) _dict['attachments'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in assigned_groups (list) + _items = [] + if self.assigned_groups: + for _item_assigned_groups in self.assigned_groups: + if _item_assigned_groups: + _items.append(_item_assigned_groups.to_dict()) + _dict['assignedGroups'] = _items # override the default output from pydantic by calling `to_dict()` of each item in submissions (list) _items = [] if self.submissions: - for _item in self.submissions: - if _item: - _items.append(_item.to_dict()) + for _item_submissions in self.submissions: + if _item_submissions: + _items.append(_item_submissions.to_dict()) _dict['submissions'] = _items # override the default output from pydantic by calling `to_dict()` of google_classroom if self.google_classroom: @@ -169,6 +201,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of lti if self.lti: _dict['lti'] = self.lti.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -183,9 +220,12 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type"), - "capabilities": AssignmentCopyResponseCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "capabilities": AssignmentCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, "title": obj.get("title"), "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), "cover": obj.get("cover"), "coverFile": obj.get("coverFile"), "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, @@ -195,6 +235,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "shuffleExercises": obj.get("shuffleExercises"), "toolset": obj.get("toolset"), "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord"), "creator": obj.get("creator"), "state": obj.get("state"), "classroom": obj.get("classroom"), @@ -203,14 +251,20 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "dueDate": obj.get("dueDate"), "assigneeMode": obj.get("assigneeMode"), "assignedStudents": obj.get("assignedStudents"), + "assignedGroups": [AssignmentGroup.from_dict(_item) for _item in obj["assignedGroups"]] if obj.get("assignedGroups") is not None else None, "submissions": [AssignmentSubmission.from_dict(_item) for _item in obj["submissions"]] if obj.get("submissions") is not None else None, "googleClassroom": GoogleClassroomCoursework.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, "microsoftGraph": MicrosoftGraphAssignment.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, - "mfc": ClassAssignmentMfc.from_dict(obj["mfc"]) if obj.get("mfc") is not None else None, - "canvas": ClassAssignmentCanvas.from_dict(obj["canvas"]) if obj.get("canvas") is not None else None, - "lti": ClassAssignmentLti.from_dict(obj["lti"]) if obj.get("lti") is not None else None, + "mfc": ClassAssignmentAllOfMfc.from_dict(obj["mfc"]) if obj.get("mfc") is not None else None, + "canvas": ClassAssignmentAllOfCanvas.from_dict(obj["canvas"]) if obj.get("canvas") is not None else None, + "lti": ClassAssignmentAllOfLti.from_dict(obj["lti"]) if obj.get("lti") is not None else None, "issue": obj.get("issue") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_assignment_all_of_canvas.py b/flat_api/models/class_assignment_all_of_canvas.py new file mode 100644 index 0000000..b2a3149 --- /dev/null +++ b/flat_api/models/class_assignment_all_of_canvas.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentAllOfCanvas(BaseModel): + """ + A Canvas LMS assignment + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on Canvas assignment") + alternate_link: Optional[StrictStr] = Field(default=None, description="Link to Canvas assignment", alias="alternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "alternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfCanvas from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfCanvas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alternateLink": obj.get("alternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/class_assignment_all_of_lti.py b/flat_api/models/class_assignment_all_of_lti.py new file mode 100644 index 0000000..3b0a866 --- /dev/null +++ b/flat_api/models/class_assignment_all_of_lti.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentAllOfLti(BaseModel): + """ + An LTI assignment + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Resource ID in the LMS") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfLti from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfLti from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/class_assignment_all_of_mfc.py b/flat_api/models/class_assignment_all_of_mfc.py new file mode 100644 index 0000000..0a55224 --- /dev/null +++ b/flat_api/models/class_assignment_all_of_mfc.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentAllOfMfc(BaseModel): + """ + A MusicFirst Classroom assignment + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on MusicFirst Task") + alternate_link: Optional[StrictStr] = Field(default=None, description="Link to MusicFirst Classroom task", alias="alternateLink") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "alternateLink"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfMfc from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentAllOfMfc from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "alternateLink": obj.get("alternateLink") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/class_assignment_canvas.py b/flat_api/models/class_assignment_canvas.py deleted file mode 100644 index da11b9d..0000000 --- a/flat_api/models/class_assignment_canvas.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ClassAssignmentCanvas(BaseModel): - """ - A Canvas LMS assignment - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on Canvas assignment") - alternate_link: Optional[StrictStr] = Field(default=None, description="Link to Canvas assignment", alias="alternateLink") - __properties: ClassVar[List[str]] = ["id", "alternateLink"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ClassAssignmentCanvas from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ClassAssignmentCanvas from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "alternateLink": obj.get("alternateLink") - }) - return _obj - - diff --git a/flat_api/models/class_assignment_lti.py b/flat_api/models/class_assignment_lti.py deleted file mode 100644 index 663ea57..0000000 --- a/flat_api/models/class_assignment_lti.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ClassAssignmentLti(BaseModel): - """ - An LTI assignment - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Resource ID in the LMS") - __properties: ClassVar[List[str]] = ["id"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ClassAssignmentLti from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ClassAssignmentLti from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id") - }) - return _obj - - diff --git a/flat_api/models/class_assignment_mfc.py b/flat_api/models/class_assignment_mfc.py deleted file mode 100644 index 01c831c..0000000 --- a/flat_api/models/class_assignment_mfc.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ClassAssignmentMfc(BaseModel): - """ - A MusicFirst Classroom assignment - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on MusicFirst Task") - alternate_link: Optional[StrictStr] = Field(default=None, description="Link to MusicFirst Classroom task", alias="alternateLink") - __properties: ClassVar[List[str]] = ["id", "alternateLink"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ClassAssignmentMfc from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ClassAssignmentMfc from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "alternateLink": obj.get("alternateLink") - }) - return _obj - - diff --git a/flat_api/models/class_assignment_update.py b/flat_api/models/class_assignment_update.py index 73d9412..132962b 100644 --- a/flat_api/models/class_assignment_update.py +++ b/flat_api/models/class_assignment_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,15 +19,17 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated +from flat_api.models.assignment_submission_students_mode import AssignmentSubmissionStudentsMode from flat_api.models.assignment_type import AssignmentType -from flat_api.models.class_assignment_update_google_classroom import ClassAssignmentUpdateGoogleClassroom -from flat_api.models.class_assignment_update_microsoft_graph import ClassAssignmentUpdateMicrosoftGraph +from flat_api.models.class_assignment_update_all_of_google_classroom import ClassAssignmentUpdateAllOfGoogleClassroom +from flat_api.models.class_assignment_update_all_of_microsoft_graph import ClassAssignmentUpdateAllOfMicrosoftGraph from flat_api.models.class_attachment_creation import ClassAttachmentCreation from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassAssignmentUpdate(BaseModel): """ @@ -35,23 +37,36 @@ class ClassAssignmentUpdate(BaseModel): """ # noqa: E501 type: Optional[AssignmentType] = None title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Title of the assignment") - description: Optional[StrictStr] = Field(default=None, description="Description and content of the assignment") - attachments: Optional[List[ClassAttachmentCreation]] = None + description: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Student instructions and content of the assignment (plain text)") + description_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of student instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="descriptionHtml") + teacher_instructions: Optional[Annotated[str, Field(strict=True, max_length=100000)]] = Field(default=None, description="Teacher-only instructions (plain text)", alias="teacherInstructions") + teacher_instructions_html: Optional[Annotated[str, Field(strict=True, max_length=20000000)]] = Field(default=None, description="HTML version of teacher-only instructions. Pasted images may be sent as inline base64 `data:` URIs; they are uploaded to storage and rewritten to hosted URLs on save. The final HTML is limited to 100000 characters. When provided, the plain text version will be automatically extracted for compatibility. ", alias="teacherInstructionsHtml") + attachments: Optional[List[ClassAttachmentCreation]] = Field(default=None, description="The complete attachment list. Omitting this property on an update leaves the existing attachments alone; sending it replaces them. Dropping a dedicated score from the list deletes the students' copies of it, so send the full set you want to keep rather than only the additions. Duplicates, judged by `url`, `score`, `worksheet` or `googleDriveFileId`, are discarded silently, and exceeding the per-assignment limit fails with `ASSIGNMENT_ATTACHMENTS_LIMIT`. ") nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") + restrict_play_note: Optional[StrictBool] = Field(default=None, description="Restrict the ability to get an audio feedback every time a student adds or selects a note.", alias="restrictPlayNote") + restrict_to_audio_tracks: Optional[StrictBool] = Field(default=None, description="Restrict the audio source to provided audio tracks on a score. Students won't be able to use the editor playback.", alias="restrictToAudioTracks") toolset: Optional[StrictStr] = Field(default=None, description="The id of the toolset to apply to this assignment. The toolset will be copied to the assignment as a dedicated object to prevent unexpected changes when making modifications to the template toolset. This property can be set to null to delete the linked toolset and switch back to all the tools available for this assignment. ") cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") max_points: Optional[Union[Annotated[float, Field(le=10000, strict=True, ge=0)], Annotated[int, Field(le=10000, strict=True, ge=0)]]] = Field(default=None, description="If set, the grading will be enabled for the assignement with this value as the maximum of points ", alias="maxPoints") release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") + submission_students_mode: Optional[AssignmentSubmissionStudentsMode] = Field(default=None, alias="submissionStudentsMode") + recording_type: Optional[StrictStr] = Field(default=None, description="For performance assignments: recording type that will be either 'audio' or 'video'. * `audio`: Only audio will be required during the recording. * `video`: Camera will be required during the recording. Only set when type is 'performance'. ", alias="recordingType") + allow_metronome: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to use the metronome while they are recording, helping them stay in time. Only set when type is 'performance'. ", alias="allowMetronome") + allow_backing_track: Optional[StrictBool] = Field(default=None, description="For performance assignments: Enable students to listen to the accompaniment without their instrument part while they are playing. Only set when type is 'performance'. ", alias="allowBackingTrack") + allow_speed_change: Optional[StrictBool] = Field(default=None, description="For performance assignments: whether students can adjust the playback speed of the score during recording. * `true`: Students can change the tempo/speed during practice and recording * `false`: Tempo is fixed to the original score tempo Only set when type is 'performance'. ", alias="allowSpeedChange") + free_record: Optional[StrictBool] = Field(default=None, description="For performance assignments: \"Free Record\" mode. When `true`, no score is attached to the assignment. Students freely record a varied repertoire or an ensemble performance without being constrained by a single score's structure or duration, and all score-dependent options (playback, metronome, backtracking, speed control) are hidden. Only set when type is 'performance'. ", alias="freeRecord") state: Optional[StrictStr] = Field(default=None, description="State of the assignment") due_date: Optional[datetime] = Field(default=None, description="The due date of this assignment, late submissions will be marked as paste due. If not set, the assignment won't have a due date. ", alias="dueDate") scheduled_date: Optional[datetime] = Field(default=None, description="The publication (scheduled) date of the assignment. If this one is specified, the assignment will only be listed to the teachers of the class. ", alias="scheduledDate") - google_classroom: Optional[ClassAssignmentUpdateGoogleClassroom] = Field(default=None, alias="googleClassroom") - microsoft_graph: Optional[ClassAssignmentUpdateMicrosoftGraph] = Field(default=None, alias="microsoftGraph") + google_classroom: Optional[ClassAssignmentUpdateAllOfGoogleClassroom] = Field(default=None, alias="googleClassroom") + microsoft_graph: Optional[ClassAssignmentUpdateAllOfMicrosoftGraph] = Field(default=None, alias="microsoftGraph") assignee_mode: Optional[StrictStr] = Field(default=None, description="Possible modes of assigning assignments", alias="assigneeMode") assigned_students: Optional[List[StrictStr]] = Field(default=None, description="Identifiers for the students that have access to the assignment", alias="assignedStudents") - __properties: ClassVar[List[str]] = ["type", "title", "description", "attachments", "nbPlaybackAuthorized", "toolset", "coverFile", "cover", "maxPoints", "releaseGrades", "shuffleExercises", "state", "dueDate", "scheduledDate", "googleClassroom", "microsoftGraph", "assigneeMode", "assignedStudents"] + class_group_ids: Optional[List[StrictStr]] = Field(default=None, description="Optional list of specific class group IDs to apply to the assignment. When transitioning to active state with group submission mode: - If provided: Only these specific groups will be applied - If not provided: All class groups will be applied, or randomized groups created if none exist ", alias="classGroupIds") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "title", "description", "descriptionHtml", "teacherInstructions", "teacherInstructionsHtml", "attachments", "nbPlaybackAuthorized", "restrictPlayNote", "restrictToAudioTracks", "toolset", "coverFile", "cover", "maxPoints", "releaseGrades", "shuffleExercises", "submissionStudentsMode", "recordingType", "allowMetronome", "allowBackingTrack", "allowSpeedChange", "freeRecord", "state", "dueDate", "scheduledDate", "googleClassroom", "microsoftGraph", "assigneeMode", "assignedStudents", "classGroupIds"] @field_validator('release_grades') def release_grades_validate_enum(cls, value): @@ -63,6 +78,16 @@ def release_grades_validate_enum(cls, value): raise ValueError("must be one of enum values ('auto', 'manual')") return value + @field_validator('recording_type') + def recording_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['audio', 'video']): + raise ValueError("must be one of enum values ('audio', 'video')") + return value + @field_validator('state') def state_validate_enum(cls, value): """Validates the enum""" @@ -83,11 +108,12 @@ def assignee_mode_validate_enum(cls, value): raise ValueError("must be one of enum values ('everyone', 'selected')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -96,8 +122,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -113,8 +138,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -125,9 +152,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) _items = [] if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) + for _item_attachments in self.attachments: + if _item_attachments: + _items.append(_item_attachments.to_dict()) _dict['attachments'] = _items # override the default output from pydantic by calling `to_dict()` of google_classroom if self.google_classroom: @@ -135,30 +162,10 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of microsoft_graph if self.microsoft_graph: _dict['microsoftGraph'] = self.microsoft_graph.to_dict() - # set to None if nb_playback_authorized (nullable) is None - # and model_fields_set contains the field - if self.nb_playback_authorized is None and "nb_playback_authorized" in self.model_fields_set: - _dict['nbPlaybackAuthorized'] = None - - # set to None if toolset (nullable) is None - # and model_fields_set contains the field - if self.toolset is None and "toolset" in self.model_fields_set: - _dict['toolset'] = None - - # set to None if cover_file (nullable) is None - # and model_fields_set contains the field - if self.cover_file is None and "cover_file" in self.model_fields_set: - _dict['coverFile'] = None - - # set to None if cover (nullable) is None - # and model_fields_set contains the field - if self.cover is None and "cover" in self.model_fields_set: - _dict['cover'] = None - - # set to None if max_points (nullable) is None - # and model_fields_set contains the field - if self.max_points is None and "max_points" in self.model_fields_set: - _dict['maxPoints'] = None + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value # set to None if due_date (nullable) is None # and model_fields_set contains the field @@ -170,6 +177,11 @@ def to_dict(self) -> Dict[str, Any]: if self.scheduled_date is None and "scheduled_date" in self.model_fields_set: _dict['scheduledDate'] = None + # set to None if class_group_ids (nullable) is None + # and model_fields_set contains the field + if self.class_group_ids is None and "class_group_ids" in self.model_fields_set: + _dict['classGroupIds'] = None + return _dict @classmethod @@ -185,22 +197,39 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "title": obj.get("title"), "description": obj.get("description"), + "descriptionHtml": obj.get("descriptionHtml"), + "teacherInstructions": obj.get("teacherInstructions"), + "teacherInstructionsHtml": obj.get("teacherInstructionsHtml"), "attachments": [ClassAttachmentCreation.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized"), + "restrictPlayNote": obj.get("restrictPlayNote"), + "restrictToAudioTracks": obj.get("restrictToAudioTracks"), "toolset": obj.get("toolset"), "coverFile": obj.get("coverFile"), "cover": obj.get("cover"), "maxPoints": obj.get("maxPoints"), "releaseGrades": obj.get("releaseGrades"), "shuffleExercises": obj.get("shuffleExercises"), + "submissionStudentsMode": obj.get("submissionStudentsMode"), + "recordingType": obj.get("recordingType"), + "allowMetronome": obj.get("allowMetronome"), + "allowBackingTrack": obj.get("allowBackingTrack"), + "allowSpeedChange": obj.get("allowSpeedChange"), + "freeRecord": obj.get("freeRecord"), "state": obj.get("state"), "dueDate": obj.get("dueDate"), "scheduledDate": obj.get("scheduledDate"), - "googleClassroom": ClassAssignmentUpdateGoogleClassroom.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, - "microsoftGraph": ClassAssignmentUpdateMicrosoftGraph.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, + "googleClassroom": ClassAssignmentUpdateAllOfGoogleClassroom.from_dict(obj["googleClassroom"]) if obj.get("googleClassroom") is not None else None, + "microsoftGraph": ClassAssignmentUpdateAllOfMicrosoftGraph.from_dict(obj["microsoftGraph"]) if obj.get("microsoftGraph") is not None else None, "assigneeMode": obj.get("assigneeMode"), - "assignedStudents": obj.get("assignedStudents") + "assignedStudents": obj.get("assignedStudents"), + "classGroupIds": obj.get("classGroupIds") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_assignment_update_all_of_google_classroom.py b/flat_api/models/class_assignment_update_all_of_google_classroom.py new file mode 100644 index 0000000..b203ce2 --- /dev/null +++ b/flat_api/models/class_assignment_update_all_of_google_classroom.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentUpdateAllOfGoogleClassroom(BaseModel): + """ + Google Classroom options for this assignment + """ # noqa: E501 + topic_id: Optional[StrictStr] = Field(default=None, description="Identifier of the topic where the assignment is created", alias="topicId") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["topicId"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfGoogleClassroom from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if topic_id (nullable) is None + # and model_fields_set contains the field + if self.topic_id is None and "topic_id" in self.model_fields_set: + _dict['topicId'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfGoogleClassroom from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "topicId": obj.get("topicId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/class_assignment_update_all_of_microsoft_graph.py b/flat_api/models/class_assignment_update_all_of_microsoft_graph.py new file mode 100644 index 0000000..de42c4b --- /dev/null +++ b/flat_api/models/class_assignment_update_all_of_microsoft_graph.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ClassAssignmentUpdateAllOfMicrosoftGraph(BaseModel): + """ + Microsoft Graph options for this assignment + """ # noqa: E501 + categories: Optional[List[StrictStr]] = Field(default=None, description="List of categories this assignment belongs to") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["categories"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfMicrosoftGraph from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if categories (nullable) is None + # and model_fields_set contains the field + if self.categories is None and "categories" in self.model_fields_set: + _dict['categories'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ClassAssignmentUpdateAllOfMicrosoftGraph from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "categories": obj.get("categories") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/class_assignment_update_google_classroom.py b/flat_api/models/class_assignment_update_google_classroom.py deleted file mode 100644 index e100a4e..0000000 --- a/flat_api/models/class_assignment_update_google_classroom.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ClassAssignmentUpdateGoogleClassroom(BaseModel): - """ - Google Classroom options for this assignment - """ # noqa: E501 - topic_id: Optional[StrictStr] = Field(default=None, description="Identifier of the topic where the assignment is created", alias="topicId") - __properties: ClassVar[List[str]] = ["topicId"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ClassAssignmentUpdateGoogleClassroom from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if topic_id (nullable) is None - # and model_fields_set contains the field - if self.topic_id is None and "topic_id" in self.model_fields_set: - _dict['topicId'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ClassAssignmentUpdateGoogleClassroom from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "topicId": obj.get("topicId") - }) - return _obj - - diff --git a/flat_api/models/class_assignment_update_microsoft_graph.py b/flat_api/models/class_assignment_update_microsoft_graph.py deleted file mode 100644 index 3c1efc4..0000000 --- a/flat_api/models/class_assignment_update_microsoft_graph.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from typing import Optional, Set -from typing_extensions import Self - -class ClassAssignmentUpdateMicrosoftGraph(BaseModel): - """ - Microsoft Graph options for this assignment - """ # noqa: E501 - categories: Optional[List[StrictStr]] = Field(default=None, description="List of categories this assignment belongs to") - __properties: ClassVar[List[str]] = ["categories"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ClassAssignmentUpdateMicrosoftGraph from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # set to None if categories (nullable) is None - # and model_fields_set contains the field - if self.categories is None and "categories" in self.model_fields_set: - _dict['categories'] = None - - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ClassAssignmentUpdateMicrosoftGraph from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "categories": obj.get("categories") - }) - return _obj - - diff --git a/flat_api/models/class_attachment_creation.py b/flat_api/models/class_attachment_creation.py index 48de75e..200cfc2 100644 --- a/flat_api/models/class_attachment_creation.py +++ b/flat_api/models/class_attachment_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,11 +18,12 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.media_score_sharing_mode import MediaScoreSharingMode from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassAttachmentCreation(BaseModel): """ @@ -31,11 +32,15 @@ class ClassAttachmentCreation(BaseModel): type: Optional[StrictStr] = Field(default=None, description="The type of the attachment posted: * `rich`, `photo`, `video` are attachment types that are automatically resolved from a `link` attachment. * A `flat` attachment is a score document where the unique identifier will be specified in the `score` property. Its sharing mode will be provided in the `sharingMode` property. ") score: Optional[StrictStr] = Field(default=None, description="A unique Flat score identifier. The user creating the assignment must at least have read access to the document. If the user has admin rights, new group permissions will be automatically added for the teachers and students of the class. ") worksheet: Optional[StrictStr] = Field(default=None, description="An unique worksheet identifier") - sharing_mode: Optional[MediaScoreSharingMode] = Field(default=None, alias="sharingMode") + revision: Optional[StrictStr] = Field(default=None, description="An unique revision identifier of a score") + part_uuid: Optional[StrictStr] = Field(default=None, description="The UUID of the instrument part selected for this attachment (for performance submissions)", alias="partUuid") + sharing_mode: Optional[MediaScoreSharingMode] = Field(default=MediaScoreSharingMode.READ, alias="sharingMode") lock_score_template: Optional[StrictBool] = Field(default=None, description="To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template.", alias="lockScoreTemplate") url: Optional[StrictStr] = Field(default=None, description="The URL of the attachment.") google_drive_file_id: Optional[StrictStr] = Field(default=None, description="The ID of the Google Drive File", alias="googleDriveFileId") - __properties: ClassVar[List[str]] = ["type", "score", "worksheet", "sharingMode", "lockScoreTemplate", "url", "googleDriveFileId"] + teacher_only: Optional[StrictBool] = Field(default=False, description="Flag indicating if this attachment should only be visible to teachers", alias="teacherOnly") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "score", "worksheet", "revision", "partUuid", "sharingMode", "lockScoreTemplate", "url", "googleDriveFileId", "teacherOnly"] @field_validator('type') def type_validate_enum(cls, value): @@ -43,15 +48,16 @@ def type_validate_enum(cls, value): if value is None: return value - if value not in set(['rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet', 'performance']): - raise ValueError("must be one of enum values ('rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet', 'performance')") + if value not in set(['rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet']): + raise ValueError("must be one of enum values ('rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,8 +66,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +82,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,6 +93,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -101,11 +113,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "score": obj.get("score"), "worksheet": obj.get("worksheet"), - "sharingMode": obj.get("sharingMode"), + "revision": obj.get("revision"), + "partUuid": obj.get("partUuid"), + "sharingMode": obj.get("sharingMode") if obj.get("sharingMode") is not None else MediaScoreSharingMode.READ, "lockScoreTemplate": obj.get("lockScoreTemplate"), "url": obj.get("url"), - "googleDriveFileId": obj.get("googleDriveFileId") + "googleDriveFileId": obj.get("googleDriveFileId"), + "teacherOnly": obj.get("teacherOnly") if obj.get("teacherOnly") is not None else False }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_creation.py b/flat_api/models/class_creation.py index 289e7d0..97fa899 100644 --- a/flat_api/models/class_creation.py +++ b/flat_api/models/class_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated from flat_api.models.class_grade_level import ClassGradeLevel from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassCreation(BaseModel): """ @@ -34,6 +35,7 @@ class ClassCreation(BaseModel): level: Optional[ClassGradeLevel] = None skills_focused: Optional[List[StrictStr]] = Field(default=None, description="Specific skills that will be focused in classroom", alias="skillsFocused") size: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="Number of students in the classroom") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["name", "section", "level", "skillsFocused", "size"] @field_validator('skills_focused') @@ -47,11 +49,12 @@ def skills_focused_validate_enum(cls, value): raise ValueError("each list item must be one of ('notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,8 +63,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if size (nullable) is None # and model_fields_set contains the field if self.size is None and "size" in self.model_fields_set: @@ -109,6 +118,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "skillsFocused": obj.get("skillsFocused"), "size": obj.get("size") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details.py b/flat_api/models/class_details.py index 1535638..1f738be 100644 --- a/flat_api/models/class_details.py +++ b/flat_api/models/class_details.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from flat_api.models.class_details_canvas import ClassDetailsCanvas from flat_api.models.class_details_clever import ClassDetailsClever @@ -34,19 +34,21 @@ from flat_api.models.group_details import GroupDetails from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetails(BaseModel): """ A classroom """ # noqa: E501 id: StrictStr = Field(description="The unique identifier of the class") - state: Optional[ClassState] = None - name: Optional[StrictStr] = Field(default=None, description="The name of the class") + state: ClassState + name: StrictStr = Field(description="The name of the class") section: Optional[StrictStr] = Field(default=None, description="The section of the class") description: Optional[StrictStr] = Field(default=None, description="An optionnal description for this class") organization: Optional[StrictStr] = Field(default=None, description="The unique identifier of the Organization owning this class") owner: Optional[StrictStr] = Field(default=None, description="The unique identifier of the User owning this class") - creation_date: Optional[datetime] = Field(default=None, description="The date when the class was create", alias="creationDate") + creation_date: datetime = Field(description="The date when the class was create", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="The date when the class was last modified", alias="modificationDate") enrollment_code: Optional[StrictStr] = Field(default=None, description="[Teachers only] The enrollment code that can be used by the students to join the class ", alias="enrollmentCode") theme: Optional[StrictStr] = Field(default=None, description="The theme identifier using in Flat User Interface") assignments_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of assignments created in the class", alias="assignmentsCount") @@ -63,7 +65,8 @@ class ClassDetails(BaseModel): level: Optional[ClassGradeLevel] = None skills_focused: Optional[List[StrictStr]] = Field(default=None, description="Specific skills that will be focused in classroom", alias="skillsFocused") size: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Number of students in the classroom") - __properties: ClassVar[List[str]] = ["id", "state", "name", "section", "description", "organization", "owner", "creationDate", "enrollmentCode", "theme", "assignmentsCount", "studentsGroup", "teachersGroup", "issues", "googleClassroom", "googleDrive", "microsoftGraph", "lti", "canvas", "mfc", "clever", "level", "skillsFocused", "size"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state", "name", "section", "description", "organization", "owner", "creationDate", "modificationDate", "enrollmentCode", "theme", "assignmentsCount", "studentsGroup", "teachersGroup", "issues", "googleClassroom", "googleDrive", "microsoftGraph", "lti", "canvas", "mfc", "clever", "level", "skillsFocused", "size"] @field_validator('skills_focused') def skills_focused_validate_enum(cls, value): @@ -76,11 +79,12 @@ def skills_focused_validate_enum(cls, value): raise ValueError("each list item must be one of ('notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -89,8 +93,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -106,8 +109,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -145,6 +150,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of clever if self.clever: _dict['clever'] = self.clever.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if size (nullable) is None # and model_fields_set contains the field if self.size is None and "size" in self.model_fields_set: @@ -170,6 +180,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "organization": obj.get("organization"), "owner": obj.get("owner"), "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), "enrollmentCode": obj.get("enrollmentCode"), "theme": obj.get("theme"), "assignmentsCount": obj.get("assignmentsCount"), @@ -187,6 +198,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "skillsFocused": obj.get("skillsFocused"), "size": obj.get("size") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_canvas.py b/flat_api/models/class_details_canvas.py index cd467e7..cbf2502 100644 --- a/flat_api/models/class_details_canvas.py +++ b/flat_api/models/class_details_canvas.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsCanvas(BaseModel): """ @@ -29,13 +30,15 @@ class ClassDetailsCanvas(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on Canvas") domain: Optional[StrictStr] = Field(default=None, description="Canvas instance domain (e.g. \"canvas.instructure.com\")") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "domain"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "domain": obj.get("domain") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_clever.py b/flat_api/models/class_details_clever.py index c6a3e5e..8b3e893 100644 --- a/flat_api/models/class_details_clever.py +++ b/flat_api/models/class_details_clever.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,10 +19,11 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsClever(BaseModel): """ @@ -35,6 +36,7 @@ class ClassDetailsClever(BaseModel): term_name: Optional[StrictStr] = Field(default=None, description="Name of the term when this course happens", alias="termName") term_start_date: Optional[datetime] = Field(default=None, description="Beginning date of the term", alias="termStartDate") term_end_date: Optional[datetime] = Field(default=None, description="End date of the term", alias="termEndDate") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "creationDate", "modificationDate", "subject", "termName", "termStartDate", "termEndDate"] @field_validator('subject') @@ -47,11 +49,12 @@ def subject_validate_enum(cls, value): raise ValueError("must be one of enum values ('english/language arts', 'math', 'science', 'social studies', 'language', 'homeroom/advisory', 'interventions/online learning', 'technology and engineering', 'PE and health', 'arts and music', 'other')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,8 +63,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -106,6 +115,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "termStartDate": obj.get("termStartDate"), "termEndDate": obj.get("termEndDate") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_google_classroom.py b/flat_api/models/class_details_google_classroom.py index 2a94e79..82a3bd1 100644 --- a/flat_api/models/class_details_google_classroom.py +++ b/flat_api/models/class_details_google_classroom.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsGoogleClassroom(BaseModel): """ @@ -29,13 +30,15 @@ class ClassDetailsGoogleClassroom(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="The course identifier on Google Classroom") alternate_link: Optional[StrictStr] = Field(default=None, description="Absolute link to this course in the Classroom web UI", alias="alternateLink") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "alternateLink"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "alternateLink": obj.get("alternateLink") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_google_drive.py b/flat_api/models/class_details_google_drive.py index 1386bbd..d6b9c49 100644 --- a/flat_api/models/class_details_google_drive.py +++ b/flat_api/models/class_details_google_drive.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsGoogleDrive(BaseModel): """ @@ -29,13 +30,15 @@ class ClassDetailsGoogleDrive(BaseModel): """ # noqa: E501 teacher_folder_id: Optional[StrictStr] = Field(default=None, description="[Teachers only] The Drive directory identifier of the teachers' folder ", alias="teacherFolderId") teacher_folder_alternate_link: Optional[StrictStr] = Field(default=None, description="[Teachers only] The Drive URL of the teachers' folder ", alias="teacherFolderAlternateLink") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["teacherFolderId", "teacherFolderAlternateLink"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "teacherFolderId": obj.get("teacherFolderId"), "teacherFolderAlternateLink": obj.get("teacherFolderAlternateLink") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_issues.py b/flat_api/models/class_details_issues.py index 62695e1..898f985 100644 --- a/flat_api/models/class_details_issues.py +++ b/flat_api/models/class_details_issues.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,24 +18,27 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.class_details_issues_sync_inner import ClassDetailsIssuesSyncInner from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsIssues(BaseModel): """ Detected issues for this class """ # noqa: E501 sync: Optional[List[ClassDetailsIssuesSyncInner]] = Field(default=None, description="Synchronization issues for the class") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["sync"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,10 +77,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in sync (list) _items = [] if self.sync: - for _item in self.sync: - if _item: - _items.append(_item.to_dict()) + for _item_sync in self.sync: + if _item_sync: + _items.append(_item_sync.to_dict()) _dict['sync'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -91,6 +100,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "sync": [ClassDetailsIssuesSyncInner.from_dict(_item) for _item in obj["sync"]] if obj.get("sync") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_issues_sync_inner.py b/flat_api/models/class_details_issues_sync_inner.py index 0c4d926..42c8098 100644 --- a/flat_api/models/class_details_issues_sync_inner.py +++ b/flat_api/models/class_details_issues_sync_inner.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsIssuesSyncInner(BaseModel): """ @@ -30,6 +31,7 @@ class ClassDetailsIssuesSyncInner(BaseModel): id: Optional[StrictStr] = Field(default=None, description="The account user identifier") email: Optional[StrictStr] = Field(default=None, description="The email address of the user concerned by this sync issue") reason: Optional[StrictStr] = Field(default=None, description="The reason why the account cannot be synced") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "email", "reason"] @field_validator('reason') @@ -38,15 +40,16 @@ def reason_validate_enum(cls, value): if value is None: return value - if value not in set(['otherOrgnanization', 'personalSubscription']): - raise ValueError("must be one of enum values ('otherOrgnanization', 'personalSubscription')") + if value not in set(['otherOrgnanization', 'productMigration', 'disabledAccount']): + raise ValueError("must be one of enum values ('otherOrgnanization', 'productMigration', 'disabledAccount')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -55,8 +58,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -72,8 +74,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -81,6 +85,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -97,6 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "email": obj.get("email"), "reason": obj.get("reason") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_lti.py b/flat_api/models/class_details_lti.py index 1c8c5d8..e53098e 100644 --- a/flat_api/models/class_details_lti.py +++ b/flat_api/models/class_details_lti.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,25 +18,29 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsLti(BaseModel): """ - Meta information provided by the LTI consumer + Info about LTI context (1.1 and 1.3) """ # noqa: E501 context_id: Optional[StrictStr] = Field(default=None, description="Unique context identifier provided", alias="contextId") context_title: Optional[StrictStr] = Field(default=None, description="Context title", alias="contextTitle") context_label: Optional[StrictStr] = Field(default=None, description="Context label", alias="contextLabel") - __properties: ClassVar[List[str]] = ["contextId", "contextTitle", "contextLabel"] + has_nrps_service: Optional[StrictBool] = Field(default=None, description="If true, the class has been synchronized with the LTI 1.3 NRPS 2.0 service", alias="hasNrpsService") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["contextId", "contextTitle", "contextLabel", "hasNrpsService"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,8 +95,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "contextId": obj.get("contextId"), "contextTitle": obj.get("contextTitle"), - "contextLabel": obj.get("contextLabel") + "contextLabel": obj.get("contextLabel"), + "hasNrpsService": obj.get("hasNrpsService") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_mfc.py b/flat_api/models/class_details_mfc.py index fd3b72b..f21f807 100644 --- a/flat_api/models/class_details_mfc.py +++ b/flat_api/models/class_details_mfc.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsMfc(BaseModel): """ @@ -29,13 +30,15 @@ class ClassDetailsMfc(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the course on MusicFirst Classroom") alternate_link: Optional[StrictStr] = Field(default=None, description="Link to MusicFirst Classroom class", alias="alternateLink") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "alternateLink"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "alternateLink": obj.get("alternateLink") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_details_microsoft_graph.py b/flat_api/models/class_details_microsoft_graph.py index be2ffb0..edd2e3c 100644 --- a/flat_api/models/class_details_microsoft_graph.py +++ b/flat_api/models/class_details_microsoft_graph.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassDetailsMicrosoftGraph(BaseModel): """ ClassDetailsMicrosoftGraph """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="The course identifier on Microsoft Graph") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/class_grade_level.py b/flat_api/models/class_grade_level.py index a16aeb3..112409e 100644 --- a/flat_api/models/class_grade_level.py +++ b/flat_api/models/class_grade_level.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/class_roles.py b/flat_api/models/class_roles.py index e4ce1c5..b1c6f03 100644 --- a/flat_api/models/class_roles.py +++ b/flat_api/models/class_roles.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/class_state.py b/flat_api/models/class_state.py index 3deb1c3..51d66f3 100644 --- a/flat_api/models/class_state.py +++ b/flat_api/models/class_state.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -30,6 +30,7 @@ class ClassState(str, Enum): ACTIVE = 'active' INACTIVE = 'inactive' ARCHIVED = 'archived' + DELETED = 'deleted' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flat_api/models/class_update.py b/flat_api/models/class_update.py index cd9074e..96984d2 100644 --- a/flat_api/models/class_update.py +++ b/flat_api/models/class_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated from flat_api.models.class_grade_level import ClassGradeLevel from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ClassUpdate(BaseModel): """ @@ -34,6 +35,7 @@ class ClassUpdate(BaseModel): level: Optional[ClassGradeLevel] = None skills_focused: Optional[List[StrictStr]] = Field(default=None, description="Specific skills that will be focused in classroom", alias="skillsFocused") size: Optional[Union[Annotated[float, Field(strict=True, ge=0)], Annotated[int, Field(strict=True, ge=0)]]] = Field(default=None, description="Number of students in the classroom") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["name", "section", "level", "skillsFocused", "size"] @field_validator('skills_focused') @@ -47,11 +49,12 @@ def skills_focused_validate_enum(cls, value): raise ValueError("each list item must be one of ('notation', 'sight-reading', 'performance-instrumental', 'ear-training', 'music-theory', 'composition', 'jazz-ensemble', 'music-technology', 'other')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,8 +63,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if size (nullable) is None # and model_fields_set contains the field if self.size is None and "size" in self.model_fields_set: @@ -109,6 +118,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "skillsFocused": obj.get("skillsFocused"), "size": obj.get("size") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/collection.py b/flat_api/models/collection.py index 4b0b8bf..7d8e6c1 100644 --- a/flat_api/models/collection.py +++ b/flat_api/models/collection.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,10 +19,11 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.collection_app import CollectionApp from flat_api.models.collection_capabilities import CollectionCapabilities +from flat_api.models.collection_contents import CollectionContents from flat_api.models.collection_privacy import CollectionPrivacy from flat_api.models.collection_type import CollectionType from flat_api.models.resource_collaborator import ResourceCollaborator @@ -30,32 +31,39 @@ from flat_api.models.user_public_summary import UserPublicSummary from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Collection(BaseModel): """ Collection of scores """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the collection") - title: Optional[StrictStr] = Field(default=None, description="The title of the collection") - html_url: Optional[StrictStr] = Field(default=None, description="The url where the collection can be viewed in a web browser", alias="htmlUrl") - type: Optional[CollectionType] = None - privacy: Optional[CollectionPrivacy] = None + id: StrictStr = Field(description="Unique identifier of the collection") + title: StrictStr = Field(description="The title of the collection") + html_url: StrictStr = Field(description="The url where the collection can be viewed in a web browser", alias="htmlUrl") + type: CollectionType + label_key: Optional[StrictStr] = Field(default=None, description="Product-specific translation key for the collection type. Only set for specific collection types: * For `regular` type: `playlist` (Flat) or `collection` (Flat for Education) * For `collaborations` type: `collaboration` (Flat) or `shared-scores` (Flat for Education) Not set for other collection types. ", alias="labelKey") + privacy: CollectionPrivacy sharing_key: Optional[StrictStr] = Field(default=None, description="The private sharing key of the collection (available when the `privacy` mode is set to `privateLink`)", alias="sharingKey") app: Optional[CollectionApp] = None - creation_date: Optional[datetime] = Field(default=None, description="The date when the collection was created", alias="creationDate") + creation_date: datetime = Field(description="The date when the collection was created", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="The date when the collection was last modified", alias="modificationDate") user: Optional[UserPublicSummary] = None organization: Optional[StrictStr] = Field(default=None, description="If the score has been created in an organization, the identifier of this organization. ") rights: Optional[ResourceRights] = None collaborators: Optional[List[ResourceCollaborator]] = Field(default=None, description="The list of the collaborators of the collection") + is_pinned: Optional[StrictBool] = Field(default=None, description="Whether the collection is pinned by the owner", alias="isPinned") + contents: CollectionContents capabilities: CollectionCapabilities collections: Optional[List[StrictStr]] = Field(default=None, description="The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them.") - __properties: ClassVar[List[str]] = ["id", "title", "htmlUrl", "type", "privacy", "sharingKey", "app", "creationDate", "user", "organization", "rights", "collaborators", "capabilities", "collections"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "title", "htmlUrl", "type", "labelKey", "privacy", "sharingKey", "app", "creationDate", "modificationDate", "user", "organization", "rights", "collaborators", "isPinned", "contents", "capabilities", "collections"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -64,8 +72,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -81,8 +88,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -102,13 +111,21 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in collaborators (list) _items = [] if self.collaborators: - for _item in self.collaborators: - if _item: - _items.append(_item.to_dict()) + for _item_collaborators in self.collaborators: + if _item_collaborators: + _items.append(_item_collaborators.to_dict()) _dict['collaborators'] = _items + # override the default output from pydantic by calling `to_dict()` of contents + if self.contents: + _dict['contents'] = self.contents.to_dict() # override the default output from pydantic by calling `to_dict()` of capabilities if self.capabilities: _dict['capabilities'] = self.capabilities.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -125,17 +142,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "title": obj.get("title"), "htmlUrl": obj.get("htmlUrl"), "type": obj.get("type"), - "privacy": obj.get("privacy"), + "labelKey": obj.get("labelKey"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else CollectionPrivacy.PRIVATE, "sharingKey": obj.get("sharingKey"), "app": CollectionApp.from_dict(obj["app"]) if obj.get("app") is not None else None, "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate"), "user": UserPublicSummary.from_dict(obj["user"]) if obj.get("user") is not None else None, "organization": obj.get("organization"), "rights": ResourceRights.from_dict(obj["rights"]) if obj.get("rights") is not None else None, "collaborators": [ResourceCollaborator.from_dict(_item) for _item in obj["collaborators"]] if obj.get("collaborators") is not None else None, + "isPinned": obj.get("isPinned"), + "contents": CollectionContents.from_dict(obj["contents"]) if obj.get("contents") is not None else None, "capabilities": CollectionCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, "collections": obj.get("collections") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/collection_app.py b/flat_api/models/collection_app.py index 0a63a77..c057ae5 100644 --- a/flat_api/models/collection_app.py +++ b/flat_api/models/collection_app.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CollectionApp(BaseModel): """ @@ -30,13 +31,15 @@ class CollectionApp(BaseModel): id: Optional[StrictStr] = Field(default=None, description="The app unique identifier") name: Optional[StrictStr] = Field(default=None, description="The name of the app") logo: Optional[StrictStr] = Field(default=None, description="The app logo url") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "name", "logo"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,6 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "logo": obj.get("logo") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/collection_capabilities.py b/flat_api/models/collection_capabilities.py index 0b4ab07..1d9a09e 100644 --- a/flat_api/models/collection_capabilities.py +++ b/flat_api/models/collection_capabilities.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CollectionCapabilities(BaseModel): """ @@ -32,13 +33,15 @@ class CollectionCapabilities(BaseModel): can_delete: StrictBool = Field(description="Whether the current user can delete the collection ", alias="canDelete") can_add_scores: StrictBool = Field(description="Whether the current user can add scores to the collection If this collection has the `type` `trash`, this property will be set to `false`. Use `DELETE /v2/scores/{score}` to trash a score. ", alias="canAddScores") can_delete_scores: StrictBool = Field(description="Whether the current user can delete scores from the collection If this collection has the `type` `trash`, this property will be set to `false`. Use `POST /v2/scores/{score}/untrash` to restore a score. ", alias="canDeleteScores") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["canEdit", "canShare", "canDelete", "canAddScores", "canDeleteScores"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -47,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,6 +77,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -91,6 +100,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "canAddScores": obj.get("canAddScores"), "canDeleteScores": obj.get("canDeleteScores") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/collection_contents.py b/flat_api/models/collection_contents.py new file mode 100644 index 0000000..9d8933b --- /dev/null +++ b/flat_api/models/collection_contents.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CollectionContents(BaseModel): + """ + The contents of the collection + """ # noqa: E501 + scores_count: StrictInt = Field(description="The number of scores in the collection", alias="scoresCount") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["scoresCount"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CollectionContents from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CollectionContents from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scoresCount": obj.get("scoresCount") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/collection_creation.py b/flat_api/models/collection_creation.py index 8e26784..52b8c9e 100644 --- a/flat_api/models/collection_creation.py +++ b/flat_api/models/collection_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,26 +18,29 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field -from typing import Any, ClassVar, Dict, List +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flat_api.models.collection_privacy import CollectionPrivacy from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CollectionCreation(BaseModel): """ CollectionCreation """ # noqa: E501 - title: Annotated[str, Field(min_length=1, strict=True, max_length=300)] = Field(description="The title of the collection") - privacy: CollectionPrivacy + title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=300)]] = Field(default=None, description="The title of the collection") + privacy: Optional[CollectionPrivacy] = CollectionPrivacy.PRIVATE + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "privacy"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,8 +94,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "title": obj.get("title"), - "privacy": obj.get("privacy") + "privacy": obj.get("privacy") if obj.get("privacy") is not None else CollectionPrivacy.PRIVATE }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/collection_modification.py b/flat_api/models/collection_modification.py index 7efb8b2..c1ef082 100644 --- a/flat_api/models/collection_modification.py +++ b/flat_api/models/collection_modification.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,26 +18,29 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flat_api.models.collection_privacy import CollectionPrivacy from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class CollectionModification(BaseModel): """ Edit the collection metadata """ # noqa: E501 title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=300)]] = Field(default=None, description="The title of the collection") - privacy: Optional[CollectionPrivacy] = None + privacy: Optional[CollectionPrivacy] = CollectionPrivacy.PRIVATE + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "privacy"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,8 +94,13 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "title": obj.get("title"), - "privacy": obj.get("privacy") + "privacy": obj.get("privacy") if obj.get("privacy") is not None else CollectionPrivacy.PRIVATE }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/collection_privacy.py b/flat_api/models/collection_privacy.py index aaab6c0..46d5eca 100644 --- a/flat_api/models/collection_privacy.py +++ b/flat_api/models/collection_privacy.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -21,7 +21,7 @@ class CollectionPrivacy(str, Enum): """ - The collection main privacy mode. - `private`: The collection is private and can be only accessed, modified and administred by specified collaborators users. + The collection main privacy mode. - `private`: The collection is private and can only be accessed, modified, and administered by specified collaborators. """ """ diff --git a/flat_api/models/collection_type.py b/flat_api/models/collection_type.py index 9ac98b5..7a49bda 100644 --- a/flat_api/models/collection_type.py +++ b/flat_api/models/collection_type.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -21,7 +21,7 @@ class CollectionType(str, Enum): """ - Type of the collection. The type will influence the capabilitied available on the collections and how this collection is/can be populated. + Type of the collection. The type will influence the capabilitied available on the collections and how this collection is/can be populated. - `root`: **Deprecated.** Previously the root collection of the user. The `allScores` virtual collection should be used instead. - `regular`: A regular collection created by the user. This collection can be deleted and modified by the user. - `app`: An automatically created collection containing the scores created by an app (e.g. Music Snippet) - `trash`: An automatically created collection containing the trashed scores. Virtual collections: - `allScores`: All the scores contained in the user account - `collaborations`: All shared scores by the user or someone else - `likes`: Liked scores """ """ @@ -29,10 +29,11 @@ class CollectionType(str, Enum): """ ROOT = 'root' REGULAR = 'regular' - SHAREDWITHME = 'sharedWithMe' - SHAREDWITHGROUP = 'sharedWithGroup' APP = 'app' TRASH = 'trash' + ALLSCORES = 'allScores' + COLLABORATIONS = 'collaborations' + LIKES = 'likes' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flat_api/models/create_lti_configuration200_response.py b/flat_api/models/create_lti_configuration200_response.py new file mode 100644 index 0000000..5511256 --- /dev/null +++ b/flat_api/models/create_lti_configuration200_response.py @@ -0,0 +1,155 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration import LtiConfiguration +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreateLtiConfiguration200Response(LtiConfiguration): + """ + CreateLtiConfiguration200Response + """ # noqa: E501 + registration_url: Optional[StrictStr] = Field(default=None, description="One-time registration URL (only for dynamic registration)", alias="registrationUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "consumerKey", "consumerSecret", "lms", "name", "tool", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching", "parentId", "deploymentKey", "deploymentBreakdownBy", "deploymentBreakdownId", "registrationToken", "registrationUrl", "registrationTokenUsed", "registrationCompletionDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreateLtiConfiguration200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if last_used_date (nullable) is None + # and model_fields_set contains the field + if self.last_used_date is None and "last_used_date" in self.model_fields_set: + _dict['lastUsedDate'] = None + + # set to None if registration_completion_date (nullable) is None + # and model_fields_set contains the field + if self.registration_completion_date is None and "registration_completion_date" in self.model_fields_set: + _dict['registrationCompletionDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreateLtiConfiguration200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "consumerKey": obj.get("consumerKey"), + "consumerSecret": obj.get("consumerSecret"), + "lms": obj.get("lms"), + "name": obj.get("name"), + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True, + "parentId": obj.get("parentId"), + "deploymentKey": obj.get("deploymentKey"), + "deploymentBreakdownBy": obj.get("deploymentBreakdownBy"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId"), + "registrationToken": obj.get("registrationToken"), + "registrationUrl": obj.get("registrationUrl"), + "registrationTokenUsed": obj.get("registrationTokenUsed"), + "registrationCompletionDate": obj.get("registrationCompletionDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/credit_transaction.py b/flat_api/models/credit_transaction.py new file mode 100644 index 0000000..e4ebbaf --- /dev/null +++ b/flat_api/models/credit_transaction.py @@ -0,0 +1,150 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class CreditTransaction(BaseModel): + """ + A single credit ledger entry + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the credit transaction") + type: StrictStr = Field(description="Credit category. `ai` covers every AI-powered feature.") + feature: Optional[StrictStr] = Field(default=None, description="Which product the credits relate to. Set on deductions and on the credits a refund returns, absent on credit-pack top-ups, which are not tied to a single feature. ") + amount: StrictInt = Field(description="How many credits this entry moved, signed: positive for top-ups (`+30` from a credit pack), negative for deductions (`-2` for a two-page import). Sum only entries whose `state` is `active`. ") + source: StrictStr = Field(description="Which pool the credits came from: * `subscription`: the plan's periodic allowance * `purchase`: credits bought as a pack, which do not expire with the billing period * `free_tier`: promotional grants * `support`: a manual adjustment made by Flat's support team A single import can produce two entries when it spans two pools: the plan allowance is drawn down first, and the remainder comes from `purchase`. ") + state: StrictStr = Field(description="Whether the entry still counts: * `active`: in effect * `canceled`: reversed, and no longer affecting the balance. Deductions are canceled when the import they paid for fails or is refunded. ") + job: Optional[StrictStr] = Field(default=None, description="Identifier of the import this entry belongs to, when it relates to one. Present on an import's deduction, on its reversal, and on credits returned when an import is refunded. Absent on credit-pack top-ups and manual adjustments. ") + creation_date: datetime = Field(description="When the transaction was created", alias="creationDate") + modification_date: datetime = Field(description="When the transaction was last modified", alias="modificationDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "feature", "amount", "source", "state", "job", "creationDate", "modificationDate"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ai']): + raise ValueError("must be one of enum values ('ai')") + return value + + @field_validator('feature') + def feature_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['omr']): + raise ValueError("must be one of enum values ('omr')") + return value + + @field_validator('source') + def source_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['subscription', 'purchase', 'free_tier', 'support']): + raise ValueError("must be one of enum values ('subscription', 'purchase', 'free_tier', 'support')") + return value + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['active', 'canceled']): + raise ValueError("must be one of enum values ('active', 'canceled')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of CreditTransaction from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of CreditTransaction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "feature": obj.get("feature"), + "amount": obj.get("amount"), + "source": obj.get("source"), + "state": obj.get("state"), + "job": obj.get("job"), + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/edu_library.py b/flat_api/models/edu_library.py index ef788b8..610e62b 100644 --- a/flat_api/models/edu_library.py +++ b/flat_api/models/edu_library.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,46 +18,43 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduLibrary(BaseModel): """ A Flat for Education Library """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Unique identifier of the library. This one can be used to list the underlying resources using `GET /v2/eduResources?parent={library-id}` ") - name: Optional[StrictStr] = Field(default=None, description="Name of the lirbary") - type: Optional[StrictStr] = Field(default=None, description="Type of the library") - visibility: Optional[StrictStr] = Field(default=None, description="Visibility of the library") + id: StrictStr = Field(description="Unique identifier of the library. This one can be used to list the underlying resources using `GET /v2/eduResources?parent={library-id}` ") + name: StrictStr = Field(description="Name of the lirbary") + type: StrictStr = Field(description="Type of the library") + visibility: StrictStr = Field(description="Visibility of the library") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "name", "type", "visibility"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - - if value not in set(['myResources', 'organizationResources', 'flatEduSamples']): - raise ValueError("must be one of enum values ('myResources', 'organizationResources', 'flatEduSamples')") + if value not in set(['myResources', 'organizationResources', 'flatEduContent']): + raise ValueError("must be one of enum values ('myResources', 'organizationResources', 'flatEduContent')") return value @field_validator('visibility') def visibility_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['private', 'organization', 'public']): raise ValueError("must be one of enum values ('private', 'organization', 'public')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -66,8 +63,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -83,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -92,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -109,6 +112,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "type": obj.get("type"), "visibility": obj.get("visibility") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource.py b/flat_api/models/edu_resource.py index 12f284c..0107548 100644 --- a/flat_api/models/edu_resource.py +++ b/flat_api/models/edu_resource.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,14 +19,17 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.edu_resource_capabilities import EduResourceCapabilities from flat_api.models.edu_resource_privacy import EduResourcePrivacy from flat_api.models.edu_resource_resource import EduResourceResource from flat_api.models.edu_resource_type import EduResourceType +from flat_api.models.grade import Grade +from flat_api.models.teaching_theme import TeachingTheme from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResource(BaseModel): """ @@ -35,21 +38,27 @@ class EduResource(BaseModel): id: StrictStr = Field(description="Resource unique identifier") creator: Optional[StrictStr] = Field(default=None, description="The User identifier of the resource creator") type: EduResourceType - privacy: Optional[EduResourcePrivacy] = None + privacy: Optional[EduResourcePrivacy] = EduResourcePrivacy.PRIVATE tags: Optional[List[StrictStr]] = Field(default=None, description="Specific attributes for the resource (e.g. sample resources with custom design)") parent: Optional[StrictStr] = Field(default=None, description="Identifier of the parent resource, e.g. a folder or root") title: StrictStr = Field(description="Title of the resource") + sharing_description: Optional[StrictStr] = Field(default=None, description="Sharing description of this resource", alias="sharingDescription") + sharing_description_html: Optional[StrictStr] = Field(default=None, description="HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. ", alias="sharingDescriptionHtml") creation_date: Optional[datetime] = Field(default=None, description="The date when the resource was created", alias="creationDate") update_date: Optional[datetime] = Field(default=None, description="The date when the resource was updated", alias="updateDate") resource: Optional[EduResourceResource] = None capabilities: EduResourceCapabilities - __properties: ClassVar[List[str]] = ["id", "creator", "type", "privacy", "tags", "parent", "title", "creationDate", "updateDate", "resource", "capabilities"] + subjects: Optional[List[TeachingTheme]] = Field(default=None, description="The subjects of this resource, or the subjects of the resources included in the folder") + grades: Optional[List[Grade]] = Field(default=None, description="The grades of this resource, or the grades of the resources included in the folder.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "creator", "type", "privacy", "tags", "parent", "title", "sharingDescription", "sharingDescriptionHtml", "creationDate", "updateDate", "resource", "capabilities", "subjects", "grades"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -58,8 +67,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -75,8 +83,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -90,6 +100,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of capabilities if self.capabilities: _dict['capabilities'] = self.capabilities.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -105,15 +120,24 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "creator": obj.get("creator"), "type": obj.get("type"), - "privacy": obj.get("privacy"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else EduResourcePrivacy.PRIVATE, "tags": obj.get("tags"), "parent": obj.get("parent"), "title": obj.get("title"), + "sharingDescription": obj.get("sharingDescription"), + "sharingDescriptionHtml": obj.get("sharingDescriptionHtml"), "creationDate": obj.get("creationDate"), "updateDate": obj.get("updateDate"), "resource": EduResourceResource.from_dict(obj["resource"]) if obj.get("resource") is not None else None, - "capabilities": EduResourceCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None + "capabilities": EduResourceCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, + "subjects": obj.get("subjects"), + "grades": obj.get("grades") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource_assignment_creation.py b/flat_api/models/edu_resource_assignment_creation.py new file mode 100644 index 0000000..8e88b34 --- /dev/null +++ b/flat_api/models/edu_resource_assignment_creation.py @@ -0,0 +1,103 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.assignment_type import AssignmentType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceAssignmentCreation(BaseModel): + """ + Assignment-specific creation options. Only applicable when creating a resource with `type: assignment`. If `type` is not provided, defaults to `none`. + """ # noqa: E501 + type: Optional[AssignmentType] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceAssignmentCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceAssignmentCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/edu_resource_capabilities.py b/flat_api/models/edu_resource_capabilities.py index ef71ae3..183bea9 100644 --- a/flat_api/models/edu_resource_capabilities.py +++ b/flat_api/models/edu_resource_capabilities.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, Field, StrictBool from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResourceCapabilities(BaseModel): """ @@ -30,13 +31,16 @@ class EduResourceCapabilities(BaseModel): can_edit: Optional[StrictBool] = Field(default=None, description="Whether the current user can modify this resource ", alias="canEdit") can_add_resources: Optional[StrictBool] = Field(default=None, description="Whether the current user can add resources within this resource (e.g. `assignment` inside a `folder`) ", alias="canAddResources") can_add_folders: Optional[StrictBool] = Field(default=None, description="Whether the current user can add folders within this resource (e.g. `folder` inside `root`) ", alias="canAddFolders") - __properties: ClassVar[List[str]] = ["canEdit", "canAddResources", "canAddFolders"] + can_change_privacy: Optional[StrictBool] = Field(default=None, description="Whether the current user can change the privacy of this resource (e.g. to share as `organizationPublic` or unshare it with `private`) ", alias="canChangePrivacy") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["canEdit", "canAddResources", "canAddFolders", "canChangePrivacy"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,8 +95,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "canEdit": obj.get("canEdit"), "canAddResources": obj.get("canAddResources"), - "canAddFolders": obj.get("canAddFolders") + "canAddFolders": obj.get("canAddFolders"), + "canChangePrivacy": obj.get("canChangePrivacy") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource_copy.py b/flat_api/models/edu_resource_copy.py index a131af4..5ef7a15 100644 --- a/flat_api/models/edu_resource_copy.py +++ b/flat_api/models/edu_resource_copy.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResourceCopy(BaseModel): """ Copy an education resource """ # noqa: E501 destination: StrictStr = Field(description="Unique identifier of the destination of the folder where to copy this resource. This can also be `root` to copy the resource at the root of the user resource library. ") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["destination"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "destination": obj.get("destination") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource_creation.py b/flat_api/models/edu_resource_creation.py index cc84fb4..28ef934 100644 --- a/flat_api/models/edu_resource_creation.py +++ b/flat_api/models/edu_resource_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,14 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated +from flat_api.models.edu_resource_assignment_creation import EduResourceAssignmentCreation from flat_api.models.edu_resource_type import EduResourceType from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResourceCreation(BaseModel): """ @@ -32,13 +34,18 @@ class EduResourceCreation(BaseModel): type: EduResourceType title: Annotated[str, Field(min_length=1, strict=True, max_length=1000)] = Field(description="Title of the resource") parent: Optional[StrictStr] = Field(default='root', description="Identifier of the parent resource where the new one will created, e.g. a folder id or `root`") - __properties: ClassVar[List[str]] = ["type", "title", "parent"] + sharing_description: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field(default=None, description="Sharing description of the resource", alias="sharingDescription") + sharing_description_html: Optional[Annotated[str, Field(strict=True, max_length=10000)]] = Field(default=None, description="HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. ", alias="sharingDescriptionHtml") + resource: Optional[EduResourceAssignmentCreation] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "title", "parent", "sharingDescription", "sharingDescriptionHtml", "resource"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -47,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,8 +70,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,6 +81,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of resource + if self.resource: + _dict['resource'] = self.resource.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,8 +103,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "type": obj.get("type"), "title": obj.get("title"), - "parent": obj.get("parent") if obj.get("parent") is not None else 'root' + "parent": obj.get("parent") if obj.get("parent") is not None else 'root', + "sharingDescription": obj.get("sharingDescription"), + "sharingDescriptionHtml": obj.get("sharingDescriptionHtml"), + "resource": EduResourceAssignmentCreation.from_dict(obj["resource"]) if obj.get("resource") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource_folder.py b/flat_api/models/edu_resource_folder.py new file mode 100644 index 0000000..cc923ab --- /dev/null +++ b/flat_api/models/edu_resource_folder.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.models.assignment_type import AssignmentType +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class EduResourceFolder(BaseModel): + """ + Education resources folder + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="Title of the folder") + assignments_types: Optional[List[AssignmentType]] = Field(default=None, description="The assignment type of the resources that are included in the folder,", alias="assignmentsTypes") + resources_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of resources inside the folder", alias="resourcesCount") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "assignmentsTypes", "resourcesCount"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EduResourceFolder from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EduResourceFolder from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "assignmentsTypes": obj.get("assignmentsTypes"), + "resourcesCount": obj.get("resourcesCount") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/edu_resource_lti_link.py b/flat_api/models/edu_resource_lti_link.py index ca0df97..21c2e76 100644 --- a/flat_api/models/edu_resource_lti_link.py +++ b/flat_api/models/edu_resource_lti_link.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResourceLtiLink(BaseModel): """ LTI Link details for the class """ # noqa: E501 lti_url: StrictStr = Field(description="An URL that can be used to launch LTI with this resource in a classroom.", alias="ltiUrl") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["ltiUrl"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "ltiUrl": obj.get("ltiUrl") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource_move.py b/flat_api/models/edu_resource_move.py index 3634928..8212436 100644 --- a/flat_api/models/edu_resource_move.py +++ b/flat_api/models/edu_resource_move.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResourceMove(BaseModel): """ Move an education resource """ # noqa: E501 destination: StrictStr = Field(description="Unique identifier of the destination of the folder where to move this resource. This can also be `root` to move the resource at the root of the user resource library. ") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["destination"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "destination": obj.get("destination") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource_privacy.py b/flat_api/models/edu_resource_privacy.py index e6a3b96..21354b8 100644 --- a/flat_api/models/edu_resource_privacy.py +++ b/flat_api/models/edu_resource_privacy.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/edu_resource_resource.py b/flat_api/models/edu_resource_resource.py index fd02fee..bda27cf 100644 --- a/flat_api/models/edu_resource_resource.py +++ b/flat_api/models/edu_resource_resource.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -14,124 +14,125 @@ from __future__ import annotations -import pprint -import re # noqa: F401 import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.models.assignment import Assignment +from flat_api.models.edu_resource_folder import EduResourceFolder +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional, Union -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities -from flat_api.models.assignment_type import AssignmentType -from flat_api.models.media_attachment import MediaAttachment -from typing import Optional, Set -from typing_extensions import Self +EDURESOURCERESOURCE_ONE_OF_SCHEMAS = ["Assignment", "EduResourceFolder"] class EduResourceResource(BaseModel): """ EduResourceResource - """ # noqa: E501 - id: StrictStr = Field(description="Unique identifier of the assignment") - type: AssignmentType - capabilities: AssignmentCopyResponseCapabilities - title: StrictStr = Field(description="Title of the folder") - description: Optional[StrictStr] = Field(default=None, description="Description and content of the assignment") - cover: Optional[StrictStr] = Field(default=None, description="The URL of the cover to display") - cover_file: Optional[StrictStr] = Field(default=None, description="The id of the cover to display", alias="coverFile") - attachments: List[MediaAttachment] - use_dedicated_attachments: Optional[StrictBool] = Field(default=None, description="For all assignments created after 02/2023, all the underlying resources must be dedicated and stored in the assignment. This boolean indicates that this assignment only supports dedicated attachments. ", alias="useDedicatedAttachments") - max_points: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If set, the grading will be enabled for the assignement ", alias="maxPoints") - release_grades: Optional[StrictStr] = Field(default=None, description="For worksheets, how grading will work for the assignment: - If set to `auto`, the grades will be automatically released when the student submits the submissions - If set to `manual`, the grades will only be set as `draftGrade` and will be released when the teacher returns the submissions ", alias="releaseGrades") - shuffle_exercises: Optional[StrictBool] = Field(default=None, description="Mixing worksheets exercises for each student", alias="shuffleExercises") - toolset: Optional[StrictStr] = Field(default=None, description="The id of the associated toolset") - nb_playback_authorized: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of playback authorized on the scores of the assignment.", alias="nbPlaybackAuthorized") - __properties: ClassVar[List[str]] = ["id", "type", "capabilities", "title", "description", "cover", "coverFile", "attachments", "useDedicatedAttachments", "maxPoints", "releaseGrades", "shuffleExercises", "toolset", "nbPlaybackAuthorized"] - - @field_validator('release_grades') - def release_grades_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['auto', 'manual']): - raise ValueError("must be one of enum values ('auto', 'manual')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + """ + # data type: Assignment + oneof_schema_1_validator: Optional[Assignment] = None + # data type: EduResourceFolder + oneof_schema_2_validator: Optional[EduResourceFolder] = None + actual_instance: Optional[Union[Assignment, EduResourceFolder]] = None + one_of_schemas: Set[str] = { "Assignment", "EduResourceFolder" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EduResourceResource.model_construct() + error_messages = [] + match = 0 + # validate data type: Assignment + if not isinstance(v, Assignment): + error_messages.append(f"Error! Input type `{type(v)}` is not `Assignment`") + else: + match += 1 + # validate data type: EduResourceFolder + if not isinstance(v, EduResourceFolder): + error_messages.append(f"Error! Input type `{type(v)}` is not `EduResourceFolder`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. Details: " + ", ".join(error_messages)) + else: + return v @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of EduResourceResource from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of capabilities - if self.capabilities: - _dict['capabilities'] = self.capabilities.to_dict() - # override the default output from pydantic by calling `to_dict()` of each item in attachments (list) - _items = [] - if self.attachments: - for _item in self.attachments: - if _item: - _items.append(_item.to_dict()) - _dict['attachments'] = _items - return _dict + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of EduResourceResource from a dict""" - if obj is None: + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into Assignment + try: + instance.actual_instance = Assignment.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EduResourceFolder + try: + instance.actual_instance = EduResourceFolder.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 EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EduResourceResource with oneOf schemas: Assignment, EduResourceFolder. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], Assignment, EduResourceFolder]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: return None - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "type": obj.get("type"), - "capabilities": AssignmentCopyResponseCapabilities.from_dict(obj["capabilities"]) if obj.get("capabilities") is not None else None, - "title": obj.get("title"), - "description": obj.get("description"), - "cover": obj.get("cover"), - "coverFile": obj.get("coverFile"), - "attachments": [MediaAttachment.from_dict(_item) for _item in obj["attachments"]] if obj.get("attachments") is not None else None, - "useDedicatedAttachments": obj.get("useDedicatedAttachments"), - "maxPoints": obj.get("maxPoints"), - "releaseGrades": obj.get("releaseGrades"), - "shuffleExercises": obj.get("shuffleExercises"), - "toolset": obj.get("toolset"), - "nbPlaybackAuthorized": obj.get("nbPlaybackAuthorized") - }) - return _obj + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/flat_api/models/edu_resource_type.py b/flat_api/models/edu_resource_type.py index ad64940..ca62b58 100644 --- a/flat_api/models/edu_resource_type.py +++ b/flat_api/models/edu_resource_type.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/edu_resource_update.py b/flat_api/models/edu_resource_update.py index fee1b4d..b509e85 100644 --- a/flat_api/models/edu_resource_update.py +++ b/flat_api/models/edu_resource_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,26 +18,35 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flat_api.models.edu_resource_privacy import EduResourcePrivacy +from flat_api.models.grade import Grade +from flat_api.models.teaching_theme import TeachingTheme from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResourceUpdate(BaseModel): """ Update of an education resource """ # noqa: E501 title: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=1000)]] = Field(default=None, description="Title of the resource") - privacy: Optional[EduResourcePrivacy] = None - __properties: ClassVar[List[str]] = ["title", "privacy"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + sharing_description: Optional[Annotated[str, Field(strict=True, max_length=400)]] = Field(default=None, description="Sharing description of the resource", alias="sharingDescription") + sharing_description_html: Optional[Annotated[str, Field(strict=True, max_length=10000)]] = Field(default=None, description="HTML version of sharing description with rich text formatting. Supports safe HTML tags: p, br, strong, b, em, i, u, a. ", alias="sharingDescriptionHtml") + privacy: Optional[EduResourcePrivacy] = EduResourcePrivacy.PRIVATE + subjects: Optional[List[TeachingTheme]] = Field(default=None, description="The subjects of this resource, or the subjects of the resources included in the folder") + grades: Optional[List[Grade]] = Field(default=None, description="The grades of this resource, or the grades of the resources included in the folder.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "sharingDescription", "sharingDescriptionHtml", "privacy", "subjects", "grades"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +55,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +71,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,8 +100,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "title": obj.get("title"), - "privacy": obj.get("privacy") + "sharingDescription": obj.get("sharingDescription"), + "sharingDescriptionHtml": obj.get("sharingDescriptionHtml"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else EduResourcePrivacy.PRIVATE, + "subjects": obj.get("subjects"), + "grades": obj.get("grades") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/edu_resource_use_in_class.py b/flat_api/models/edu_resource_use_in_class.py index dfb5cd1..2a2c70e 100644 --- a/flat_api/models/edu_resource_use_in_class.py +++ b/flat_api/models/edu_resource_use_in_class.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class EduResourceUseInClass(BaseModel): """ @@ -29,13 +30,15 @@ class EduResourceUseInClass(BaseModel): """ # noqa: E501 classroom: StrictStr = Field(description="The destination classroom where the resource will be copied.") assignment: Optional[StrictStr] = Field(default=None, description="An optional destination assignment where the original assignement will be copied. Must be a draft.") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["classroom", "assignment"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "classroom": obj.get("classroom"), "assignment": obj.get("assignment") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/flat_error_response.py b/flat_api/models/flat_error_response.py index 9f1ef9c..cd87fc5 100644 --- a/flat_api/models/flat_error_response.py +++ b/flat_api/models/flat_error_response.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class FlatErrorResponse(BaseModel): """ @@ -31,13 +32,16 @@ class FlatErrorResponse(BaseModel): message: StrictStr = Field(description="A printable message for this error") id: Optional[StrictStr] = Field(default=None, description="An unique error identifier generated for the request") param: Optional[StrictStr] = Field(default=None, description="The related parameter that caused the error") - __properties: ClassVar[List[str]] = ["code", "message", "id", "param"] + provider_message: Optional[StrictStr] = Field(default=None, description="The untranslated error message returned by an external provider (e.g. Google Classroom), when the error originates from one. Only set on errors forwarded from a third party. Meant for support and IT: display it alongside `message`, never in place of it. `message` is the localized, user-facing text; this field is raw provider output and is always in English. ", alias="providerMessage") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "message", "id", "param", "providerMessage"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +77,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,8 +97,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "code": obj.get("code"), "message": obj.get("message"), "id": obj.get("id"), - "param": obj.get("param") + "param": obj.get("param"), + "providerMessage": obj.get("providerMessage") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/flat_locales.py b/flat_api/models/flat_locales.py deleted file mode 100644 index 8e4ce7e..0000000 --- a/flat_api/models/flat_locales.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -from __future__ import annotations -import json -from enum import Enum -from typing_extensions import Self - - -class FlatLocales(str, Enum): - """ - The user language - """ - - """ - allowed enum values - """ - EN = 'en' - EN_MINUS_GB = 'en-GB' - ES = 'es' - FR = 'fr' - DE = 'de' - IT = 'it' - JA = 'ja' - JA_MINUS_HIRA = 'ja-HIRA' - KO = 'ko' - NL = 'nl' - PL = 'pl' - PT = 'pt' - PT_MINUS_BR = 'pt-BR' - RO = 'ro' - RU = 'ru' - SV = 'sv' - TR = 'tr' - ZH_MINUS_HANS = 'zh-Hans' - - @classmethod - def from_json(cls, json_str: str) -> Self: - """Create an instance of FlatLocales from a JSON string""" - return cls(json.loads(json_str)) - - diff --git a/flat_api/models/google_classroom_coursework.py b/flat_api/models/google_classroom_coursework.py index 208777a..cb8191c 100644 --- a/flat_api/models/google_classroom_coursework.py +++ b/flat_api/models/google_classroom_coursework.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GoogleClassroomCoursework(BaseModel): """ @@ -31,13 +32,15 @@ class GoogleClassroomCoursework(BaseModel): state: Optional[StrictStr] = Field(default=None, description="State of the coursework") alternate_link: Optional[StrictStr] = Field(default=None, description="Absolute link to this coursework in the Classroom web UI", alias="alternateLink") topic_id: Optional[StrictStr] = Field(default=None, description="Identifier of the topic where the assignment is created", alias="topicId") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "state", "alternateLink", "topicId"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if topic_id (nullable) is None # and model_fields_set contains the field if self.topic_id is None and "topic_id" in self.model_fields_set: @@ -94,6 +103,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "alternateLink": obj.get("alternateLink"), "topicId": obj.get("topicId") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/google_classroom_submission.py b/flat_api/models/google_classroom_submission.py index 66b6c49..6975dde 100644 --- a/flat_api/models/google_classroom_submission.py +++ b/flat_api/models/google_classroom_submission.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GoogleClassroomSubmission(BaseModel): """ @@ -30,13 +31,15 @@ class GoogleClassroomSubmission(BaseModel): id: StrictStr = Field(description="Identifier of the coursework submission assigned by Classroom") state: StrictStr = Field(description="State of the submission on Google Classroom") alternate_link: StrictStr = Field(description="Absolute link to this coursework in the Classroom web UI", alias="alternateLink") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "state", "alternateLink"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,6 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "state": obj.get("state"), "alternateLink": obj.get("alternateLink") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/grade.py b/flat_api/models/grade.py new file mode 100644 index 0000000..16a122a --- /dev/null +++ b/flat_api/models/grade.py @@ -0,0 +1,49 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class Grade(str, Enum): + """ + Class grade of the resource + """ + + """ + allowed enum values + """ + ENUM_1 = '1' + ENUM_2 = '2' + ENUM_3 = '3' + ENUM_4 = '4' + ENUM_5 = '5' + ENUM_6 = '6' + ENUM_7 = '7' + ENUM_8 = '8' + ENUM_9 = '9' + ENUM_10 = '10' + ENUM_11 = '11' + ENUM_12 = '12' + UNIVERSITY = 'university' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of Grade from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/models/group.py b/flat_api/models/group.py index 9ec1aab..8d55928 100644 --- a/flat_api/models/group.py +++ b/flat_api/models/group.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,10 +19,12 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.models.group_type import GroupType from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Group(BaseModel): """ @@ -30,28 +32,20 @@ class Group(BaseModel): """ # noqa: E501 id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the group") name: Optional[StrictStr] = Field(default=None, description="The display name of the group") - type: Optional[StrictStr] = Field(default=None, description="The type of the group: * `generic`: A group created by a Flat user * `classTeachers`: A group created automaticaly by Flat that contains the teachers of a class * `classStudents`: A group created automaticaly by Flat that contains the studnets of a class ") + type: Optional[GroupType] = None users_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of users in this group", alias="usersCount") read_only: Optional[StrictBool] = Field(default=None, description="`True` if the group is set in read-only ", alias="readOnly") organization: Optional[StrictStr] = Field(default=None, description="If the group is related to an organization, this field will contain the unique identifier of the organization ") creation_date: Optional[datetime] = Field(default=None, description="The creation date of the group", alias="creationDate") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "name", "type", "usersCount", "readOnly", "organization", "creationDate"] - @field_validator('type') - def type_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['generic', 'classTeachers', 'classStudents']): - raise ValueError("must be one of enum values ('generic', 'classTeachers', 'classStudents')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +70,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -106,6 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "organization": obj.get("organization"), "creationDate": obj.get("creationDate") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/group_creation.py b/flat_api/models/group_creation.py new file mode 100644 index 0000000..cbcbe9d --- /dev/null +++ b/flat_api/models/group_creation.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class GroupCreation(BaseModel): + """ + GroupCreation + """ # noqa: E501 + type: StrictStr = Field(description="Type of group (currently only classStudentsSubGroup is supported)") + classroom: StrictStr = Field(description="Classroom ID") + name: Optional[StrictStr] = Field(default=None, description="Name of the group (optional - auto-generated if not provided). **Special names:** * `edu:testing-students`: Creates a group tagged for test student accounts. The display name will be localized (e.g., \"Test Students\") and the group will be tagged with `edu:testing-students`. ") + members: Optional[List[StrictStr]] = Field(default=None, description="Array of student IDs to add to the group") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "classroom", "name", "members"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['classStudentsSubGroup']): + raise ValueError("must be one of enum values ('classStudentsSubGroup')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GroupCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GroupCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "classroom": obj.get("classroom"), + "name": obj.get("name"), + "members": obj.get("members") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/group_details.py b/flat_api/models/group_details.py index b4ab092..8c39caf 100644 --- a/flat_api/models/group_details.py +++ b/flat_api/models/group_details.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,30 +19,37 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from flat_api.models.group_type import GroupType from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class GroupDetails(BaseModel): """ The details of a group """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the group") - name: Optional[StrictStr] = Field(default=None, description="The displayable name of the group") - type: Optional[GroupType] = None + id: StrictStr = Field(description="The unique identifier of the group") + name: StrictStr = Field(description="The displayable name of the group") + type: GroupType organization: Optional[StrictStr] = Field(default=None, description="The unique identifier of the Organization owning the group") - creation_date: Optional[datetime] = Field(default=None, description="The date when the group was create", alias="creationDate") - users_count: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of students in this group", alias="usersCount") - read_only: Optional[StrictBool] = Field(default=None, description="`true` if the properties and members of this group are in in read-only ", alias="readOnly") - __properties: ClassVar[List[str]] = ["id", "name", "type", "organization", "creationDate", "usersCount", "readOnly"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + classroom: Optional[StrictStr] = Field(default=None, description="The unique identifier of the classroom owning the group. Only available for groups of type 'classromStudentsSubGroup' or 'assignmentStudentsSubGroup'") + assignment: Optional[StrictStr] = Field(default=None, description="The unique identifier of the assignment owning the group. Only available for groups of type 'assignmentStudentsSubGroup'.") + parent: Optional[StrictStr] = Field(default=None, description="The unique identifier of the parent class group. Only available for groups of type 'assignmentStudentsSubGroup'. May be null if the parent class group was deleted.") + creation_date: datetime = Field(description="The date when the group was create", alias="creationDate") + users_count: Union[StrictFloat, StrictInt] = Field(description="The number of students in this group", alias="usersCount") + read_only: StrictBool = Field(description="`true` if the properties and members of this group are in in read-only ", alias="readOnly") + tags: List[StrictStr] = Field(description="Tags for categorizing groups. * `edu:testing-students`: Marks this group as containing test student accounts ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "type", "organization", "classroom", "assignment", "parent", "creationDate", "usersCount", "readOnly", "tags"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -51,8 +58,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -68,8 +74,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -77,6 +85,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -93,10 +106,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "type": obj.get("type"), "organization": obj.get("organization"), + "classroom": obj.get("classroom"), + "assignment": obj.get("assignment"), + "parent": obj.get("parent"), "creationDate": obj.get("creationDate"), "usersCount": obj.get("usersCount"), - "readOnly": obj.get("readOnly") + "readOnly": obj.get("readOnly"), + "tags": obj.get("tags") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/group_type.py b/flat_api/models/group_type.py index 14673fc..c9e76a9 100644 --- a/flat_api/models/group_type.py +++ b/flat_api/models/group_type.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -21,7 +21,7 @@ class GroupType(str, Enum): """ - The type of the group + The type of the group: * `generic`: A group created by a Flat user * `classTeachers`: A group created automaticaly by Flat that contains the teachers of a class * `classStudents`: A group created automaticaly by Flat that contains the studnets of a class * `classStudentsSubGroup`: Manually created sub-group of students of a class. * `assignmentStudentsSubGroup`: Manually created Sub-group of students of a class, in relation to a specific assignment. """ """ @@ -30,6 +30,8 @@ class GroupType(str, Enum): GENERIC = 'generic' CLASSTEACHERS = 'classTeachers' CLASSSTUDENTS = 'classStudents' + CLASSSTUDENTSSUBGROUP = 'classStudentsSubGroup' + ASSIGNMENTSTUDENTSSUBGROUP = 'assignmentStudentsSubGroup' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flat_api/models/license_mode.py b/flat_api/models/license_mode.py index b40035a..7758678 100644 --- a/flat_api/models/license_mode.py +++ b/flat_api/models/license_mode.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/license_sources.py b/flat_api/models/license_sources.py index a7622a3..0ab0988 100644 --- a/flat_api/models/license_sources.py +++ b/flat_api/models/license_sources.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/lms_name.py b/flat_api/models/lms_name.py index 05c5964..5648b1b 100644 --- a/flat_api/models/lms_name.py +++ b/flat_api/models/lms_name.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/lti_configuration.py b/flat_api/models/lti_configuration.py new file mode 100644 index 0000000..203d4c7 --- /dev/null +++ b/flat_api/models/lti_configuration.py @@ -0,0 +1,142 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.models.lti_configuration1p1 import LtiConfiguration1p1 +from flat_api.models.lti_configuration1p3 import LtiConfiguration1p3 +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LTICONFIGURATION_ONE_OF_SCHEMAS = ["LtiConfiguration1p1", "LtiConfiguration1p3"] + +class LtiConfiguration(BaseModel): + """ + LTI configuration details (unified 1.1 and 1.3) + """ + # data type: LtiConfiguration1p1 + oneof_schema_1_validator: Optional[LtiConfiguration1p1] = None + # data type: LtiConfiguration1p3 + oneof_schema_2_validator: Optional[LtiConfiguration1p3] = None + actual_instance: Optional[Union[LtiConfiguration1p1, LtiConfiguration1p3]] = None + one_of_schemas: Set[str] = { "LtiConfiguration1p1", "LtiConfiguration1p3" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + 'createLtiConfiguration_200_response': 'CreateLtiConfiguration200Response' + } + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LtiConfiguration.model_construct() + error_messages = [] + match = 0 + # validate data type: LtiConfiguration1p1 + if not isinstance(v, LtiConfiguration1p1): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p1`") + else: + match += 1 + # validate data type: LtiConfiguration1p3 + if not isinstance(v, LtiConfiguration1p3): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LtiConfiguration1p1 + try: + instance.actual_instance = LtiConfiguration1p1.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfiguration1p3 + try: + instance.actual_instance = LtiConfiguration1p3.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 LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfiguration with oneOf schemas: LtiConfiguration1p1, LtiConfiguration1p3. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfiguration1p1, LtiConfiguration1p3]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/models/lti_configuration1p1.py b/flat_api/models/lti_configuration1p1.py new file mode 100644 index 0000000..d581bf3 --- /dev/null +++ b/flat_api/models/lti_configuration1p1.py @@ -0,0 +1,148 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration1p1_all_of_tool import LtiConfiguration1p1AllOfTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p1(BaseModel): + """ + LtiConfiguration1p1 + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.1)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + consumer_key: Optional[StrictStr] = Field(default=None, description="LTI 1.1 consumer key", alias="consumerKey") + consumer_secret: Optional[StrictStr] = Field(default=None, description="LTI 1.1 consumer secret (only included for admins)", alias="consumerSecret") + lms: Optional[StrictStr] = Field(default=None, description="LMS type") + name: Optional[StrictStr] = Field(default=None, description="Configuration name") + tool: Optional[LtiConfiguration1p1AllOfTool] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "consumerKey", "consumerSecret", "lms", "name", "tool"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p1']): + raise ValueError("must be one of enum values ('1p1')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "consumerKey": obj.get("consumerKey"), + "consumerSecret": obj.get("consumerSecret"), + "lms": obj.get("lms"), + "name": obj.get("name"), + "tool": LtiConfiguration1p1AllOfTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p1_all_of_tool.py b/flat_api/models/lti_configuration1p1_all_of_tool.py new file mode 100644 index 0000000..39bbbbc --- /dev/null +++ b/flat_api/models/lti_configuration1p1_all_of_tool.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p1AllOfTool(BaseModel): + """ + Platform/tool product information + """ # noqa: E501 + product: Optional[StrictStr] = Field(default=None, description="Product family code (e.g., canvas, moodle, schoology)") + version: Optional[StrictStr] = Field(default=None, description="Platform version string") + instance_name: Optional[StrictStr] = Field(default=None, description="Instance display name", alias="instanceName") + instance_guid: Optional[StrictStr] = Field(default=None, description="Unique instance identifier", alias="instanceGuid") + instance_contact: Optional[StrictStr] = Field(default=None, description="Contact email or handle for the instance", alias="instanceContact") + instance_domain: Optional[StrictStr] = Field(default=None, description="Instance root domain", alias="instanceDomain") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["product", "version", "instanceName", "instanceGuid", "instanceContact", "instanceDomain"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1AllOfTool from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p1AllOfTool from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "product": obj.get("product"), + "version": obj.get("version"), + "instanceName": obj.get("instanceName"), + "instanceGuid": obj.get("instanceGuid"), + "instanceContact": obj.get("instanceContact"), + "instanceDomain": obj.get("instanceDomain") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3.py b/flat_api/models/lti_configuration1p3.py new file mode 100644 index 0000000..55442b3 --- /dev/null +++ b/flat_api/models/lti_configuration1p3.py @@ -0,0 +1,152 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.models.lti_configuration1p3_deployment import LtiConfiguration1p3Deployment +from flat_api.models.lti_configuration1p3_dynamic import LtiConfiguration1p3Dynamic +from flat_api.models.lti_configuration1p3_manual import LtiConfiguration1p3Manual +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LTICONFIGURATION1P3_ONE_OF_SCHEMAS = ["LtiConfiguration1p3Deployment", "LtiConfiguration1p3Dynamic", "LtiConfiguration1p3Manual"] + +class LtiConfiguration1p3(BaseModel): + """ + LTI 1.3 configuration details + """ + # data type: LtiConfiguration1p3Manual + oneof_schema_1_validator: Optional[LtiConfiguration1p3Manual] = None + # data type: LtiConfiguration1p3Deployment + oneof_schema_2_validator: Optional[LtiConfiguration1p3Deployment] = None + # data type: LtiConfiguration1p3Dynamic + oneof_schema_3_validator: Optional[LtiConfiguration1p3Dynamic] = None + actual_instance: Optional[Union[LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual]] = None + one_of_schemas: Set[str] = { "LtiConfiguration1p3Deployment", "LtiConfiguration1p3Dynamic", "LtiConfiguration1p3Manual" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LtiConfiguration1p3.model_construct() + error_messages = [] + match = 0 + # validate data type: LtiConfiguration1p3Manual + if not isinstance(v, LtiConfiguration1p3Manual): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3Manual`") + else: + match += 1 + # validate data type: LtiConfiguration1p3Deployment + if not isinstance(v, LtiConfiguration1p3Deployment): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3Deployment`") + else: + match += 1 + # validate data type: LtiConfiguration1p3Dynamic + if not isinstance(v, LtiConfiguration1p3Dynamic): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfiguration1p3Dynamic`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LtiConfiguration1p3Manual + try: + instance.actual_instance = LtiConfiguration1p3Manual.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfiguration1p3Deployment + try: + instance.actual_instance = LtiConfiguration1p3Deployment.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfiguration1p3Dynamic + try: + instance.actual_instance = LtiConfiguration1p3Dynamic.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 LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfiguration1p3 with oneOf schemas: LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfiguration1p3Deployment, LtiConfiguration1p3Dynamic, LtiConfiguration1p3Manual]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/models/lti_configuration1p3_base.py b/flat_api/models/lti_configuration1p3_base.py new file mode 100644 index 0000000..3fc4f00 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_base.py @@ -0,0 +1,158 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Base(BaseModel): + """ + LtiConfiguration1p3Base + """ # noqa: E501 + mode: Optional[StrictStr] = Field(default=None, description="LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-manual', '1p3-deployment', '1p3-dynamic']): + raise ValueError("must be one of enum values ('1p3-manual', '1p3-deployment', '1p3-dynamic')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Base from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Base from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_base_supported_services.py b/flat_api/models/lti_configuration1p3_base_supported_services.py new file mode 100644 index 0000000..e76b494 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_base_supported_services.py @@ -0,0 +1,118 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration1p3_base_supported_services_ags import LtiConfiguration1p3BaseSupportedServicesAgs +from flat_api.models.lti_configuration1p3_base_supported_services_deep_linking import LtiConfiguration1p3BaseSupportedServicesDeepLinking +from flat_api.models.lti_configuration1p3_base_supported_services_nrps import LtiConfiguration1p3BaseSupportedServicesNrps +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServices(BaseModel): + """ + LTI services support information + """ # noqa: E501 + ags: Optional[LtiConfiguration1p3BaseSupportedServicesAgs] = None + nrps: Optional[LtiConfiguration1p3BaseSupportedServicesNrps] = None + deep_linking: Optional[LtiConfiguration1p3BaseSupportedServicesDeepLinking] = Field(default=None, alias="deepLinking") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["ags", "nrps", "deepLinking"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServices from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of ags + if self.ags: + _dict['ags'] = self.ags.to_dict() + # override the default output from pydantic by calling `to_dict()` of nrps + if self.nrps: + _dict['nrps'] = self.nrps.to_dict() + # override the default output from pydantic by calling `to_dict()` of deep_linking + if self.deep_linking: + _dict['deepLinking'] = self.deep_linking.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServices from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ags": LtiConfiguration1p3BaseSupportedServicesAgs.from_dict(obj["ags"]) if obj.get("ags") is not None else None, + "nrps": LtiConfiguration1p3BaseSupportedServicesNrps.from_dict(obj["nrps"]) if obj.get("nrps") is not None else None, + "deepLinking": LtiConfiguration1p3BaseSupportedServicesDeepLinking.from_dict(obj["deepLinking"]) if obj.get("deepLinking") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_base_supported_services_ags.py b/flat_api/models/lti_configuration1p3_base_supported_services_ags.py new file mode 100644 index 0000000..30cc3b5 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_base_supported_services_ags.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServicesAgs(BaseModel): + """ + Assignment and Grade Services support + """ # noqa: E501 + available: Optional[StrictBool] = Field(default=None, description="Whether AGS claims were detected in launches from this platform") + version: Optional[StrictStr] = Field(default=None, description="AGS version supported (e.g., \"2.0\")") + enabled: Optional[StrictBool] = Field(default=None, description="Whether we have AGS enabled for this platform") + lineitems_url: Optional[StrictStr] = Field(default=None, description="Base URL for line items operations as provided by the platform", alias="lineitemsUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["available", "version", "enabled", "lineitemsUrl"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesAgs from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesAgs from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "version": obj.get("version"), + "enabled": obj.get("enabled"), + "lineitemsUrl": obj.get("lineitemsUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.py b/flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.py new file mode 100644 index 0000000..a92f835 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_base_supported_services_deep_linking.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServicesDeepLinking(BaseModel): + """ + Deep Linking support + """ # noqa: E501 + available: Optional[StrictBool] = Field(default=None, description="Whether Deep Linking claims were detected in launches from this platform") + version: Optional[StrictStr] = Field(default=None, description="Deep Linking version supported (e.g., \"2.0\")") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["available", "version"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesDeepLinking from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesDeepLinking from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "version": obj.get("version") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_base_supported_services_nrps.py b/flat_api/models/lti_configuration1p3_base_supported_services_nrps.py new file mode 100644 index 0000000..580fff9 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_base_supported_services_nrps.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseSupportedServicesNrps(BaseModel): + """ + Names and Role Provisioning Services support + """ # noqa: E501 + available: Optional[StrictBool] = Field(default=None, description="Whether NRPS claims were detected in launches from this platform") + version: Optional[StrictStr] = Field(default=None, description="NRPS version supported (e.g., \"2.0\")") + enabled: Optional[StrictBool] = Field(default=None, description="Whether we have NRPS enabled for this platform") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["available", "version", "enabled"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesNrps from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseSupportedServicesNrps from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "available": obj.get("available"), + "version": obj.get("version"), + "enabled": obj.get("enabled") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_base_tool.py b/flat_api/models/lti_configuration1p3_base_tool.py new file mode 100644 index 0000000..9fd38e6 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_base_tool.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3BaseTool(BaseModel): + """ + Platform/tool product information + """ # noqa: E501 + product: Optional[StrictStr] = Field(default=None, description="Product family code (e.g., canvas, moodle, schoology)") + version: Optional[StrictStr] = Field(default=None, description="Platform version string") + instance_name: Optional[StrictStr] = Field(default=None, description="Instance name (e.g., 'My University Canvas')", alias="instanceName") + instance_guid: Optional[StrictStr] = Field(default=None, description="Unique instance identifier", alias="instanceGuid") + instance_contact: Optional[StrictStr] = Field(default=None, description="Contact email or handle for the instance", alias="instanceContact") + instance_domain: Optional[StrictStr] = Field(default=None, description="Instance root domain", alias="instanceDomain") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["product", "version", "instanceName", "instanceGuid", "instanceContact", "instanceDomain"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseTool from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3BaseTool from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "product": obj.get("product"), + "version": obj.get("version"), + "instanceName": obj.get("instanceName"), + "instanceGuid": obj.get("instanceGuid"), + "instanceContact": obj.get("instanceContact"), + "instanceDomain": obj.get("instanceDomain") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_deployment.py b/flat_api/models/lti_configuration1p3_deployment.py new file mode 100644 index 0000000..2cfdbd2 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_deployment.py @@ -0,0 +1,200 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Deployment(BaseModel): + """ + LtiConfiguration1p3Deployment + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.3)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + mode: Optional[StrictStr] = Field(default=None, description="Deployment-based LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + parent_id: Optional[StrictStr] = Field(default=None, description="Parent configuration ID (for deployment-based configs)", alias="parentId") + deployment_key: Optional[StrictStr] = Field(default=None, description="Deployment key (e.g., schoology, classlink)", alias="deploymentKey") + deployment_breakdown_by: Optional[StrictStr] = Field(default=None, description="Custom claim used for tenant identification (parent platforms only, read-only)", alias="deploymentBreakdownBy") + deployment_breakdown_id: Optional[StrictStr] = Field(default=None, description="Value of the custom claim that identifies this specific tenant (child platforms only)", alias="deploymentBreakdownId") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching", "parentId", "deploymentKey", "deploymentBreakdownBy", "deploymentBreakdownId"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3']): + raise ValueError("must be one of enum values ('1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-deployment']): + raise ValueError("must be one of enum values ('1p3-deployment')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Deployment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Deployment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True, + "parentId": obj.get("parentId"), + "deploymentKey": obj.get("deploymentKey"), + "deploymentBreakdownBy": obj.get("deploymentBreakdownBy"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_dynamic.py b/flat_api/models/lti_configuration1p3_dynamic.py new file mode 100644 index 0000000..d83afe1 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_dynamic.py @@ -0,0 +1,205 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Dynamic(BaseModel): + """ + LtiConfiguration1p3Dynamic + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.3)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + mode: Optional[StrictStr] = Field(default=None, description="Dynamic registration LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + registration_token: Optional[StrictStr] = Field(default=None, description="Only included for admins", alias="registrationToken") + registration_url: Optional[StrictStr] = Field(default=None, description="Dynamic registration URL (only included for admins when available)", alias="registrationUrl") + registration_token_used: Optional[StrictBool] = Field(default=None, description="Whether dynamic registration token has been used", alias="registrationTokenUsed") + registration_completion_date: Optional[datetime] = Field(default=None, description="Date when dynamic registration completed (null when not completed)", alias="registrationCompletionDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching", "registrationToken", "registrationUrl", "registrationTokenUsed", "registrationCompletionDate"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3']): + raise ValueError("must be one of enum values ('1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-dynamic']): + raise ValueError("must be one of enum values ('1p3-dynamic')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Dynamic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if registration_completion_date (nullable) is None + # and model_fields_set contains the field + if self.registration_completion_date is None and "registration_completion_date" in self.model_fields_set: + _dict['registrationCompletionDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Dynamic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True, + "registrationToken": obj.get("registrationToken"), + "registrationUrl": obj.get("registrationUrl"), + "registrationTokenUsed": obj.get("registrationTokenUsed"), + "registrationCompletionDate": obj.get("registrationCompletionDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration1p3_manual.py b/flat_api/models/lti_configuration1p3_manual.py new file mode 100644 index 0000000..cfb5044 --- /dev/null +++ b/flat_api/models/lti_configuration1p3_manual.py @@ -0,0 +1,192 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration1p3_base_supported_services import LtiConfiguration1p3BaseSupportedServices +from flat_api.models.lti_configuration1p3_base_tool import LtiConfiguration1p3BaseTool +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfiguration1p3Manual(BaseModel): + """ + LtiConfiguration1p3Manual + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version (1.3)", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + mode: Optional[StrictStr] = Field(default=None, description="Manual LTI 1.3 configuration mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment ID linking the tool to a tenant/class (varies by platform)", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="OAuth2 token endpoint (for AGS/NRPS)", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="OIDC authorization/login endpoint", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint (public keys)", alias="jwksUrl") + deployment_mode: Optional[StrictStr] = Field(default=None, description="Deployment mode (single for organization-specific, multi for shared parent platforms)", alias="deploymentMode") + supported_services: Optional[LtiConfiguration1p3BaseSupportedServices] = Field(default=None, alias="supportedServices") + tool: Optional[LtiConfiguration1p3BaseTool] = None + public_keyset_url: Optional[StrictStr] = Field(default=None, description="Public keyset URL for the platform to retrieve Flat's public keys", alias="publicKeysetUrl") + initiate_login_url: Optional[StrictStr] = Field(default=None, description="URL for the platform to initiate LTI login", alias="initiateLoginUrl") + redirect_uris: Optional[List[StrictStr]] = Field(default=None, description="Allowed redirect URIs for LTI launches", alias="redirectUris") + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status", "mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "deploymentMode", "supportedServices", "tool", "publicKeysetUrl", "initiateLoginUrl", "redirectUris", "enableEmailMatching"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3']): + raise ValueError("must be one of enum values ('1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['1p3-manual']): + raise ValueError("must be one of enum values ('1p3-manual')") + return value + + @field_validator('deployment_mode') + def deployment_mode_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['single', 'multi']): + raise ValueError("must be one of enum values ('single', 'multi')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Manual from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of supported_services + if self.supported_services: + _dict['supportedServices'] = self.supported_services.to_dict() + # override the default output from pydantic by calling `to_dict()` of tool + if self.tool: + _dict['tool'] = self.tool.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfiguration1p3Manual from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status"), + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "deploymentMode": obj.get("deploymentMode"), + "supportedServices": LtiConfiguration1p3BaseSupportedServices.from_dict(obj["supportedServices"]) if obj.get("supportedServices") is not None else None, + "tool": LtiConfiguration1p3BaseTool.from_dict(obj["tool"]) if obj.get("tool") is not None else None, + "publicKeysetUrl": obj.get("publicKeysetUrl"), + "initiateLoginUrl": obj.get("initiateLoginUrl"), + "redirectUris": obj.get("redirectUris"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_base.py b/flat_api/models/lti_configuration_base.py new file mode 100644 index 0000000..876e041 --- /dev/null +++ b/flat_api/models/lti_configuration_base.py @@ -0,0 +1,139 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationBase(BaseModel): + """ + LtiConfigurationBase + """ # noqa: E501 + id: StrictStr = Field(description="Configuration ID") + lti_version: StrictStr = Field(description="LTI version", alias="ltiVersion") + organization_id: Optional[StrictStr] = Field(default=None, description="Organization ID", alias="organizationId") + organization_name: Optional[StrictStr] = Field(default=None, description="Organization name", alias="organizationName") + creator_id: Optional[StrictStr] = Field(default=None, description="ID of the user who created this configuration", alias="creatorId") + creation_date: datetime = Field(description="Configuration creation date", alias="creationDate") + last_used_date: Optional[datetime] = Field(default=None, description="Last time this configuration was used", alias="lastUsedDate") + status: Optional[StrictStr] = Field(default=None, description="Configuration status indicator") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "ltiVersion", "organizationId", "organizationName", "creatorId", "creationDate", "lastUsedDate", "status"] + + @field_validator('lti_version') + def lti_version_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p1', '1p3']): + raise ValueError("must be one of enum values ('1p1', '1p3')") + return value + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['ready-to-use', 'in-use', 'incomplete-setup']): + raise ValueError("must be one of enum values ('ready-to-use', 'in-use', 'incomplete-setup')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationBase from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if last_used_date (nullable) is None + # and model_fields_set contains the field + if self.last_used_date is None and "last_used_date" in self.model_fields_set: + _dict['lastUsedDate'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationBase from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "ltiVersion": obj.get("ltiVersion"), + "organizationId": obj.get("organizationId"), + "organizationName": obj.get("organizationName"), + "creatorId": obj.get("creatorId"), + "creationDate": obj.get("creationDate"), + "lastUsedDate": obj.get("lastUsedDate"), + "status": obj.get("status") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_create.py b/flat_api/models/lti_configuration_create.py new file mode 100644 index 0000000..896994e --- /dev/null +++ b/flat_api/models/lti_configuration_create.py @@ -0,0 +1,169 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from flat_api.models.lti_configuration_create1p1 import LtiConfigurationCreate1p1 +from flat_api.models.lti_configuration_create1p3_deployment import LtiConfigurationCreate1p3Deployment +from flat_api.models.lti_configuration_create1p3_dynamic import LtiConfigurationCreate1p3Dynamic +from flat_api.models.lti_configuration_create1p3_manual import LtiConfigurationCreate1p3Manual +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +LTICONFIGURATIONCREATE_ONE_OF_SCHEMAS = ["LtiConfigurationCreate1p1", "LtiConfigurationCreate1p3Deployment", "LtiConfigurationCreate1p3Dynamic", "LtiConfigurationCreate1p3Manual"] + +class LtiConfigurationCreate(BaseModel): + """ + Request to create a new LTI configuration (unified 1.1 and 1.3) + """ + # data type: LtiConfigurationCreate1p1 + oneof_schema_1_validator: Optional[LtiConfigurationCreate1p1] = None + # data type: LtiConfigurationCreate1p3Dynamic + oneof_schema_2_validator: Optional[LtiConfigurationCreate1p3Dynamic] = None + # data type: LtiConfigurationCreate1p3Deployment + oneof_schema_3_validator: Optional[LtiConfigurationCreate1p3Deployment] = None + # data type: LtiConfigurationCreate1p3Manual + oneof_schema_4_validator: Optional[LtiConfigurationCreate1p3Manual] = None + actual_instance: Optional[Union[LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual]] = None + one_of_schemas: Set[str] = { "LtiConfigurationCreate1p1", "LtiConfigurationCreate1p3Deployment", "LtiConfigurationCreate1p3Dynamic", "LtiConfigurationCreate1p3Manual" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = LtiConfigurationCreate.model_construct() + error_messages = [] + match = 0 + # validate data type: LtiConfigurationCreate1p1 + if not isinstance(v, LtiConfigurationCreate1p1): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p1`") + else: + match += 1 + # validate data type: LtiConfigurationCreate1p3Dynamic + if not isinstance(v, LtiConfigurationCreate1p3Dynamic): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p3Dynamic`") + else: + match += 1 + # validate data type: LtiConfigurationCreate1p3Deployment + if not isinstance(v, LtiConfigurationCreate1p3Deployment): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p3Deployment`") + else: + match += 1 + # validate data type: LtiConfigurationCreate1p3Manual + if not isinstance(v, LtiConfigurationCreate1p3Manual): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationCreate1p3Manual`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into LtiConfigurationCreate1p1 + try: + instance.actual_instance = LtiConfigurationCreate1p1.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfigurationCreate1p3Dynamic + try: + instance.actual_instance = LtiConfigurationCreate1p3Dynamic.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfigurationCreate1p3Deployment + try: + instance.actual_instance = LtiConfigurationCreate1p3Deployment.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into LtiConfigurationCreate1p3Manual + try: + instance.actual_instance = LtiConfigurationCreate1p3Manual.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 LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfigurationCreate with oneOf schemas: LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfigurationCreate1p1, LtiConfigurationCreate1p3Deployment, LtiConfigurationCreate1p3Dynamic, LtiConfigurationCreate1p3Manual]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/models/lti_configuration_create1p1.py b/flat_api/models/lti_configuration_create1p1.py new file mode 100644 index 0000000..32e8ea9 --- /dev/null +++ b/flat_api/models/lti_configuration_create1p1.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p1(BaseModel): + """ + LTI 1.1 manual configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.1 manual creation mode") + name: Optional[StrictStr] = Field(default=None, description="Display name for LTI 1.1 credentials") + lms: Optional[StrictStr] = Field(default=None, description="LMS identifier for LTI 1.1 credentials") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "name", "lms"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p1-manual']): + raise ValueError("must be one of enum values ('1p1-manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p1 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "name": obj.get("name"), + "lms": obj.get("lms") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_create1p3_deployment.py b/flat_api/models/lti_configuration_create1p3_deployment.py new file mode 100644 index 0000000..8a261d9 --- /dev/null +++ b/flat_api/models/lti_configuration_create1p3_deployment.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3Deployment(BaseModel): + """ + LTI 1.3 deployment-based configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.3 deployment-based creation mode") + deployment_type: StrictStr = Field(description="Parent platform key (e.g., canvas, blackboard, schoology, classlink)", alias="deploymentType") + deployment_id: StrictStr = Field(description="Deployment identifier provided by the platform", alias="deploymentId") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id for the tenant; required for ClassLink deployments", alias="clientId") + deployment_breakdown_id: Optional[StrictStr] = Field(default=None, description="Value of the custom claim that identifies this specific tenant (for multi-tenant platforms like Schoology)", alias="deploymentBreakdownId") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "deploymentType", "deploymentId", "clientId", "deploymentBreakdownId"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3-deployment']): + raise ValueError("must be one of enum values ('1p3-deployment')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Deployment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Deployment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "deploymentType": obj.get("deploymentType"), + "deploymentId": obj.get("deploymentId"), + "clientId": obj.get("clientId"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_create1p3_dynamic.py b/flat_api/models/lti_configuration_create1p3_dynamic.py new file mode 100644 index 0000000..d5240bf --- /dev/null +++ b/flat_api/models/lti_configuration_create1p3_dynamic.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.lti_configuration_create1p3_dynamic_platform_info import LtiConfigurationCreate1p3DynamicPlatformInfo +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3Dynamic(BaseModel): + """ + LTI 1.3 dynamic registration configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.3 dynamic registration mode") + platform_info: Optional[LtiConfigurationCreate1p3DynamicPlatformInfo] = Field(default=None, alias="platformInfo") + locale: Optional[StrictStr] = Field(default=None, description="Optional locale code for registration URL. Input values will be automatically normalized to a supported locale code.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "platformInfo", "locale"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3-dynamic']): + raise ValueError("must be one of enum values ('1p3-dynamic')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Dynamic from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of platform_info + if self.platform_info: + _dict['platformInfo'] = self.platform_info.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Dynamic from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "platformInfo": LtiConfigurationCreate1p3DynamicPlatformInfo.from_dict(obj["platformInfo"]) if obj.get("platformInfo") is not None else None, + "locale": obj.get("locale") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_create1p3_dynamic_platform_info.py b/flat_api/models/lti_configuration_create1p3_dynamic_platform_info.py new file mode 100644 index 0000000..546fa43 --- /dev/null +++ b/flat_api/models/lti_configuration_create1p3_dynamic_platform_info.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3DynamicPlatformInfo(BaseModel): + """ + Optional platform information for dynamic registration + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="Platform display name") + url: Optional[StrictStr] = Field(default=None, description="Optional platform homepage or admin URL for reference") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name", "url"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3DynamicPlatformInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3DynamicPlatformInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "url": obj.get("url") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_create1p3_manual.py b/flat_api/models/lti_configuration_create1p3_manual.py new file mode 100644 index 0000000..c52d1a1 --- /dev/null +++ b/flat_api/models/lti_configuration_create1p3_manual.py @@ -0,0 +1,125 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationCreate1p3Manual(BaseModel): + """ + LTI 1.3 manual configuration creation + """ # noqa: E501 + mode: StrictStr = Field(description="LTI 1.3 manual creation mode") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment identifier provided by the platform", alias="deploymentId") + access_token_url: Optional[StrictStr] = Field(default=None, description="Platform access token endpoint URL", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="Platform OIDC authorization endpoint URL", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint URL for public keys", alias="jwksUrl") + enable_email_matching: Optional[StrictBool] = Field(default=None, description="Enable email-based user matching during LTI authentication", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["mode", "platformIss", "platformName", "clientId", "deploymentId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "enableEmailMatching"] + + @field_validator('mode') + def mode_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['1p3-manual']): + raise ValueError("must be one of enum values ('1p3-manual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Manual from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationCreate1p3Manual from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "mode": obj.get("mode"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "deploymentId": obj.get("deploymentId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "enableEmailMatching": obj.get("enableEmailMatching") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_update.py b/flat_api/models/lti_configuration_update.py new file mode 100644 index 0000000..04e7ac8 --- /dev/null +++ b/flat_api/models/lti_configuration_update.py @@ -0,0 +1,135 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Optional +from flat_api.models.lti_configuration_update_deployment import LtiConfigurationUpdateDeployment +from flat_api.models.lti_configuration_update_standalone import LtiConfigurationUpdateStandalone +from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict +from typing_extensions import Literal, Self +from pydantic import Field + +LTICONFIGURATIONUPDATE_ANY_OF_SCHEMAS = ["LtiConfigurationUpdateDeployment", "LtiConfigurationUpdateStandalone"] + +class LtiConfigurationUpdate(BaseModel): + """ + Update an existing LTI 1.3 configuration (deployment clone or standalone) + """ + + # data type: LtiConfigurationUpdateDeployment + anyof_schema_1_validator: Optional[LtiConfigurationUpdateDeployment] = None + # data type: LtiConfigurationUpdateStandalone + anyof_schema_2_validator: Optional[LtiConfigurationUpdateStandalone] = None + if TYPE_CHECKING: + actual_instance: Optional[Union[LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone]] = None + else: + actual_instance: Any = None + any_of_schemas: Set[str] = { "LtiConfigurationUpdateDeployment", "LtiConfigurationUpdateStandalone" } + + model_config = { + "validate_assignment": True, + "protected_namespaces": (), + } + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_anyof(cls, v): + instance = LtiConfigurationUpdate.model_construct() + error_messages = [] + # validate data type: LtiConfigurationUpdateDeployment + if not isinstance(v, LtiConfigurationUpdateDeployment): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationUpdateDeployment`") + else: + return v + + # validate data type: LtiConfigurationUpdateStandalone + if not isinstance(v, LtiConfigurationUpdateStandalone): + error_messages.append(f"Error! Input type `{type(v)}` is not `LtiConfigurationUpdateStandalone`") + else: + return v + + if error_messages: + # no match + raise ValueError("No match found when setting the actual_instance in LtiConfigurationUpdate with anyOf schemas: LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Dict[str, Any]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + # anyof_schema_1_validator: Optional[LtiConfigurationUpdateDeployment] = None + try: + instance.actual_instance = LtiConfigurationUpdateDeployment.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # anyof_schema_2_validator: Optional[LtiConfigurationUpdateStandalone] = None + try: + instance.actual_instance = LtiConfigurationUpdateStandalone.from_json(json_str) + return instance + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if error_messages: + # no match + raise ValueError("No match found when deserializing the JSON string into LtiConfigurationUpdate with anyOf schemas: LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], LtiConfigurationUpdateDeployment, LtiConfigurationUpdateStandalone]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/flat_api/models/lti_configuration_update_deployment.py b/flat_api/models/lti_configuration_update_deployment.py new file mode 100644 index 0000000..910c8eb --- /dev/null +++ b/flat_api/models/lti_configuration_update_deployment.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationUpdateDeployment(BaseModel): + """ + Update fields allowed for deployment-based configurations + """ # noqa: E501 + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment identifier provided by the platform", alias="deploymentId") + deployment_breakdown_id: Optional[StrictStr] = Field(default=None, description="Specific tenant identifier for multi-tenant platforms", alias="deploymentBreakdownId") + enable_email_matching: Optional[StrictBool] = Field(default=None, description="Enable email-based user matching during LTI authentication", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["deploymentId", "deploymentBreakdownId", "enableEmailMatching"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateDeployment from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateDeployment from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "deploymentId": obj.get("deploymentId"), + "deploymentBreakdownId": obj.get("deploymentBreakdownId"), + "enableEmailMatching": obj.get("enableEmailMatching") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_configuration_update_standalone.py b/flat_api/models/lti_configuration_update_standalone.py new file mode 100644 index 0000000..b21686a --- /dev/null +++ b/flat_api/models/lti_configuration_update_standalone.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class LtiConfigurationUpdateStandalone(BaseModel): + """ + Update fields allowed for standalone (manual/dynamic) configurations + """ # noqa: E501 + deployment_id: Optional[StrictStr] = Field(default=None, description="Deployment identifier provided by the platform", alias="deploymentId") + platform_iss: Optional[StrictStr] = Field(default=None, description="Platform issuer URL", alias="platformIss") + platform_name: Optional[StrictStr] = Field(default=None, description="Platform display name", alias="platformName") + client_id: Optional[StrictStr] = Field(default=None, description="OAuth2 client_id allocated by the platform", alias="clientId") + access_token_url: Optional[StrictStr] = Field(default=None, description="Platform access token endpoint URL", alias="accessTokenUrl") + authorization_url: Optional[StrictStr] = Field(default=None, description="Platform OIDC authorization endpoint URL", alias="authorizationUrl") + jwks_url: Optional[StrictStr] = Field(default=None, description="Platform JWKS endpoint URL for public keys", alias="jwksUrl") + enable_email_matching: Optional[StrictBool] = Field(default=None, description="Enable email-based user matching during LTI authentication", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["deploymentId", "platformIss", "platformName", "clientId", "accessTokenUrl", "authorizationUrl", "jwksUrl", "enableEmailMatching"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateStandalone from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of LtiConfigurationUpdateStandalone from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "deploymentId": obj.get("deploymentId"), + "platformIss": obj.get("platformIss"), + "platformName": obj.get("platformName"), + "clientId": obj.get("clientId"), + "accessTokenUrl": obj.get("accessTokenUrl"), + "authorizationUrl": obj.get("authorizationUrl"), + "jwksUrl": obj.get("jwksUrl"), + "enableEmailMatching": obj.get("enableEmailMatching") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/lti_credentials.py b/flat_api/models/lti_credentials.py index ccc7666..f46f973 100644 --- a/flat_api/models/lti_credentials.py +++ b/flat_api/models/lti_credentials.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,11 +19,12 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.lms_name import LmsName from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class LtiCredentials(BaseModel): """ @@ -38,13 +39,16 @@ class LtiCredentials(BaseModel): last_usage: Optional[datetime] = Field(default=None, description="The last time these credentials were used", alias="lastUsage") consumer_key: Optional[StrictStr] = Field(default=None, description="OAuth 1 Consumer Key", alias="consumerKey") consumer_secret: Optional[StrictStr] = Field(default=None, description="OAuth 1 Consumer Secret", alias="consumerSecret") - __properties: ClassVar[List[str]] = ["id", "name", "lms", "organization", "creator", "creationDate", "lastUsage", "consumerKey", "consumerSecret"] + enable_email_matching: Optional[StrictBool] = Field(default=True, description="Enable email-based user matching during LTI authentication. When true (default): If a user with the same email exists in the organization, they will be matched and logged in instead of creating a new account. When false: Email matching is disabled. Only LTI ID matching is used, which means multiple LTI users can share the same email address and have separate Flat accounts. This is useful for cases like siblings sharing a parent email in the LMS. ", alias="enableEmailMatching") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "name", "lms", "organization", "creator", "creationDate", "lastUsage", "consumerKey", "consumerSecret", "enableEmailMatching"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -53,8 +57,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -70,8 +73,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -99,8 +109,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "creationDate": obj.get("creationDate"), "lastUsage": obj.get("lastUsage"), "consumerKey": obj.get("consumerKey"), - "consumerSecret": obj.get("consumerSecret") + "consumerSecret": obj.get("consumerSecret"), + "enableEmailMatching": obj.get("enableEmailMatching") if obj.get("enableEmailMatching") is not None else True }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/lti_credentials_creation.py b/flat_api/models/lti_credentials_creation.py index ccf8c9f..e854a3b 100644 --- a/flat_api/models/lti_credentials_creation.py +++ b/flat_api/models/lti_credentials_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List from typing_extensions import Annotated from flat_api.models.lms_name import LmsName from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class LtiCredentialsCreation(BaseModel): """ @@ -31,13 +32,15 @@ class LtiCredentialsCreation(BaseModel): """ # noqa: E501 name: Annotated[str, Field(strict=True, max_length=300)] = Field(description="Name of the couple of credentials") lms: LmsName + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["name", "lms"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,6 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "name": obj.get("name"), "lms": obj.get("lms") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/media_attachment.py b/flat_api/models/media_attachment.py index 147504d..a47101f 100644 --- a/flat_api/models/media_attachment.py +++ b/flat_api/models/media_attachment.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,11 +18,12 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union from flat_api.models.media_score_sharing_mode import MediaScoreSharingMode from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class MediaAttachment(BaseModel): """ @@ -34,13 +35,14 @@ class MediaAttachment(BaseModel): worksheet: Optional[StrictStr] = Field(default=None, description="An unique worksheet identifier") dedicated: Optional[StrictBool] = Field(default=None, description="True if the resource is dedicated for the assignment (for scores and worksheets), meaning on the user-side this one is stored in the assignment") track: Optional[StrictStr] = Field(default=None, description="A unique track identifier") - sharing_mode: Optional[MediaScoreSharingMode] = Field(default=None, alias="sharingMode") + part_uuid: Optional[StrictStr] = Field(default=None, description="The UUID of the instrument part selected for this attachment (for performance submissions)", alias="partUuid") + sharing_mode: Optional[MediaScoreSharingMode] = Field(default=MediaScoreSharingMode.READ, alias="sharingMode") lock_score_template: Optional[StrictBool] = Field(default=None, description="To be used with a score attached in `sharingMode` `copy` (score used as template). If true, students won't be able to change the original notes of the template.", alias="lockScoreTemplate") title: Optional[StrictStr] = Field(default=None, description="The resolved title of the attachment") description: Optional[StrictStr] = Field(default=None, description="The resolved description of the attachment") html: Optional[StrictStr] = Field(default=None, description="If the attachment type is `rich` or `video`, the HTML code of the media to display ") - html_width: Optional[StrictStr] = Field(default=None, description="If the `html` is available, the width of the widget", alias="htmlWidth") - html_height: Optional[StrictStr] = Field(default=None, description="If the `html` is available, the height of the widget", alias="htmlHeight") + html_width: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If the `html` is available, the width of the widget", alias="htmlWidth") + html_height: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="If the `html` is available, the height of the widget", alias="htmlHeight") url: Optional[StrictStr] = Field(default=None, description="The url of the attachment") thumbnail_url: Optional[StrictStr] = Field(default=None, description="If the attachment type is `rich`, `video`, `photo` or `link`, a displayable thumbnail for this attachment ", alias="thumbnailUrl") thumbnail_width: Optional[StrictInt] = Field(default=None, description="If the `thumbnailUrl` is available, the width of the thumbnail ", alias="thumbnailWidth") @@ -50,20 +52,23 @@ class MediaAttachment(BaseModel): icon_url: Optional[StrictStr] = Field(default=None, description="The URL of the icon", alias="iconUrl") mime_type: Optional[StrictStr] = Field(default=None, description="The mine type of the file", alias="mimeType") google_drive_file_id: Optional[StrictStr] = Field(default=None, description="The ID of the Google Drive File", alias="googleDriveFileId") - __properties: ClassVar[List[str]] = ["type", "score", "revision", "worksheet", "dedicated", "track", "sharingMode", "lockScoreTemplate", "title", "description", "html", "htmlWidth", "htmlHeight", "url", "thumbnailUrl", "thumbnailWidth", "thumbnailHeight", "authorName", "authorUrl", "iconUrl", "mimeType", "googleDriveFileId"] + teacher_only: Optional[StrictBool] = Field(default=False, description="If true, this attachment is only visible to teachers. When students view the assignment, attachments with this flag will be filtered out. ", alias="teacherOnly") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["type", "score", "revision", "worksheet", "dedicated", "track", "partUuid", "sharingMode", "lockScoreTemplate", "title", "description", "html", "htmlWidth", "htmlHeight", "url", "thumbnailUrl", "thumbnailWidth", "thumbnailHeight", "authorName", "authorUrl", "iconUrl", "mimeType", "googleDriveFileId", "teacherOnly"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value not in set(['rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet', 'performance']): - raise ValueError("must be one of enum values ('rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet', 'performance')") + if value not in set(['rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet']): + raise ValueError("must be one of enum values ('rich', 'photo', 'video', 'link', 'flat', 'googleDrive', 'worksheet')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -72,8 +77,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -89,8 +93,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -98,6 +104,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -116,7 +127,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "worksheet": obj.get("worksheet"), "dedicated": obj.get("dedicated"), "track": obj.get("track"), - "sharingMode": obj.get("sharingMode"), + "partUuid": obj.get("partUuid"), + "sharingMode": obj.get("sharingMode") if obj.get("sharingMode") is not None else MediaScoreSharingMode.READ, "lockScoreTemplate": obj.get("lockScoreTemplate"), "title": obj.get("title"), "description": obj.get("description"), @@ -131,8 +143,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "authorUrl": obj.get("authorUrl"), "iconUrl": obj.get("iconUrl"), "mimeType": obj.get("mimeType"), - "googleDriveFileId": obj.get("googleDriveFileId") + "googleDriveFileId": obj.get("googleDriveFileId"), + "teacherOnly": obj.get("teacherOnly") if obj.get("teacherOnly") is not None else False }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/media_score_sharing_mode.py b/flat_api/models/media_score_sharing_mode.py index 543a9c3..90e7e14 100644 --- a/flat_api/models/media_score_sharing_mode.py +++ b/flat_api/models/media_score_sharing_mode.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/microsoft_graph_assignment.py b/flat_api/models/microsoft_graph_assignment.py index 06fb106..299edef 100644 --- a/flat_api/models/microsoft_graph_assignment.py +++ b/flat_api/models/microsoft_graph_assignment.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,26 +18,53 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class MicrosoftGraphAssignment(BaseModel): """ - A Microsoft Teams asignment + A Microsoft Teams assignment """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="Identifier of the assignement assigned by Microsoft Teams") - state: Optional[StrictStr] = Field(default=None, description="State of the assignment") - alternate_link: Optional[StrictStr] = Field(default=None, description="Absolute link to this assignement in the Microsoft Teams web UI", alias="alternateLink") + id: Optional[StrictStr] = Field(default=None, description="Identifier of the assignment assigned by Microsoft Teams") + state: Optional[StrictStr] = Field(default=None, description="State of the assignment on Microsoft Teams. * `draft`: Assignment is in draft mode * `scheduled`: Assignment is scheduled to be published at a future date * `published`: Assignment has been published to students * `assigned`: Assignment has been assigned (legacy status) * `inactive`: Assignment is inactive ") + alternate_link: Optional[StrictStr] = Field(default=None, description="Absolute link to this assignment in the Microsoft Teams web UI", alias="alternateLink") + assign_date_time: Optional[datetime] = Field(default=None, description="The date when the assignment will become active on Microsoft Teams. If set to a future date, the assignment will have status `scheduled` and won't be visible to students until this date. ", alias="assignDateTime") categories: Optional[List[StrictStr]] = Field(default=None, description="List of categories where this assignment is published under") - __properties: ClassVar[List[str]] = ["id", "state", "alternateLink", "categories"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + assign_to_type: Optional[StrictStr] = Field(default=None, description="Recipient configuration for this assignment on Microsoft Teams. * `class`: Assignment is visible to all students in the class * `individual`: Assignment is visible only to specific assigned students ", alias="assignToType") + assigned_students_ms_ids: Optional[List[StrictStr]] = Field(default=None, description="When assignToType is 'individual', array of Microsoft Azure user IDs of students assigned to this assignment. These are the students who can see and submit to this assignment on Teams. ", alias="assignedStudentsMsIds") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "state", "alternateLink", "assignDateTime", "categories", "assignToType", "assignedStudentsMsIds"] + + @field_validator('state') + def state_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['draft', 'scheduled', 'published', 'assigned', 'inactive']): + raise ValueError("must be one of enum values ('draft', 'scheduled', 'published', 'assigned', 'inactive')") + return value + + @field_validator('assign_to_type') + def assign_to_type_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['class', 'individual']): + raise ValueError("must be one of enum values ('class', 'individual')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +73,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +89,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +100,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,8 +120,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "state": obj.get("state"), "alternateLink": obj.get("alternateLink"), - "categories": obj.get("categories") + "assignDateTime": obj.get("assignDateTime"), + "categories": obj.get("categories"), + "assignToType": obj.get("assignToType"), + "assignedStudentsMsIds": obj.get("assignedStudentsMsIds") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/microsoft_graph_submission.py b/flat_api/models/microsoft_graph_submission.py index 789dd09..8014efe 100644 --- a/flat_api/models/microsoft_graph_submission.py +++ b/flat_api/models/microsoft_graph_submission.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class MicrosoftGraphSubmission(BaseModel): """ @@ -29,13 +30,15 @@ class MicrosoftGraphSubmission(BaseModel): """ # noqa: E501 id: StrictStr = Field(description="Identifier of the submission assigned by Microsoft Teams") state: StrictStr = Field(description="State of the submission") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "state"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "state": obj.get("state") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/omr_capabilities.py b/flat_api/models/omr_capabilities.py new file mode 100644 index 0000000..997cb27 --- /dev/null +++ b/flat_api/models/omr_capabilities.py @@ -0,0 +1,138 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.omr_job_output import OmrJobOutput +from flat_api.models.omr_locale_details import OmrLocaleDetails +from flat_api.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrCapabilities(BaseModel): + """ + What the account or app can do, for client feature-detection. + """ # noqa: E501 + steps: List[OmrStepName] = Field(description="Interactive steps this server supports.") + formats: List[StrictStr] = Field(description="Export formats available via `getOmrJobExport`.") + outputs: List[OmrJobOutput] = Field(description="Output destinations the account can use when creating a job.") + max_files: StrictInt = Field(description="Maximum number of input files that can be added to a single job.", alias="maxFiles") + max_pages: StrictInt = Field(description="Maximum number of pages allowed across all input files of a single job.", alias="maxPages") + max_parallel_jobs: StrictInt = Field(description="Maximum number of OMR jobs that can run in parallel for this account.", alias="maxParallelJobs") + max_file_size: StrictInt = Field(description="Maximum size of a single file, in bytes.", alias="maxFileSize") + accepted_mime_types: List[StrictStr] = Field(description="MIME types accepted for input files: PDF, plus the raster image formats. Drive the file picker from this list rather than hardcoding it, so newly supported formats need no client release. A file is identified by its content, so its declared type and its extension do not have to match. A multi-page input counts as several pages against `maxPages` and is charged accordingly. That covers PDFs and, among the image formats, multi-page TIFF and animated GIF/WebP. ", alias="acceptedMimeTypes") + accepted_extensions: List[StrictStr] = Field(description="Filename extensions the accepted types appear under, for building a file picker. Use these alongside `acceptedMimeTypes` in an `accept` attribute: browsers and native file dialogs filter unreliably on some of the image types, so a valid file can be greyed out when only its MIME type is offered. Longer than `acceptedMimeTypes`, because one type arrives under several extensions (`.jpg` and `.jpeg`, `.tif` and `.tiff`, `.heic` and `.heif`). Picker metadata only. A file is identified by its content, so its extension never decides whether an upload is accepted. ", alias="acceptedExtensions") + cost_per_page: Optional[StrictInt] = Field(default=None, description="Credits charged per page.", alias="costPerPage") + remaining_credits: Optional[StrictInt] = Field(default=None, description="OMR credits remaining for the account.", alias="remainingCredits") + retention_days: Optional[StrictInt] = Field(default=None, description="How many days a `musicxml` job's uploaded files and results are kept before erasure. Reflects the account's own period when one has been set, otherwise the platform default. Read-only: contact support to change it. Jobs with `output: library` are not covered by the retention policy and are unaffected by this value. ", alias="retentionDays") + locales: List[StrictStr] = Field(description="Locales selectable for OCR, as BCP 47 codes sorted alphabetically. These are the locales the recognition pipeline can actually read, which is neither the list of Flat interface locales nor a fixed set: new languages are added over time. Clients should default to the user's own locale when it appears here. ") + locales_details: List[OmrLocaleDetails] = Field(description="The same locales as `locales`, each with its English display name, sorted alphabetically by `name` and ready to bind to a language picker. Prefer this over `locales` when rendering a selector: it saves clients from shipping their own code-to-label table. ", alias="localesDetails") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["steps", "formats", "outputs", "maxFiles", "maxPages", "maxParallelJobs", "maxFileSize", "acceptedMimeTypes", "acceptedExtensions", "costPerPage", "remainingCredits", "retentionDays", "locales", "localesDetails"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrCapabilities from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in locales_details (list) + _items = [] + if self.locales_details: + for _item_locales_details in self.locales_details: + if _item_locales_details: + _items.append(_item_locales_details.to_dict()) + _dict['localesDetails'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrCapabilities from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "steps": obj.get("steps"), + "formats": obj.get("formats"), + "outputs": obj.get("outputs"), + "maxFiles": obj.get("maxFiles"), + "maxPages": obj.get("maxPages"), + "maxParallelJobs": obj.get("maxParallelJobs"), + "maxFileSize": obj.get("maxFileSize"), + "acceptedMimeTypes": obj.get("acceptedMimeTypes"), + "acceptedExtensions": obj.get("acceptedExtensions"), + "costPerPage": obj.get("costPerPage"), + "remainingCredits": obj.get("remainingCredits"), + "retentionDays": obj.get("retentionDays"), + "locales": obj.get("locales"), + "localesDetails": [OmrLocaleDetails.from_dict(_item) for _item in obj["localesDetails"]] if obj.get("localesDetails") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_details_step_data.py b/flat_api/models/omr_details_step_data.py new file mode 100644 index 0000000..41eddc2 --- /dev/null +++ b/flat_api/models/omr_details_step_data.py @@ -0,0 +1,121 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.omr_detected_instrument import OmrDetectedInstrument +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrDetailsStepData(BaseModel): + """ + Detected score details for review (the \"Check your score details\" screen). The worker produces `title` and `instruments` from assembly; the language is not detected and is not part of this payload (the client reads the job's `locales`, set at creation). + """ # noqa: E501 + step: StrictStr = Field(description="Discriminator for `OmrPendingStep.data`; always `details` for this payload.") + title: Optional[StrictStr] = Field(default=None, description="OCR-detected work title.") + instruments: List[OmrDetectedInstrument] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["step", "title", "instruments"] + + @field_validator('step') + def step_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['details']): + raise ValueError("must be one of enum values ('details')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrDetailsStepData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instruments (list) + _items = [] + if self.instruments: + for _item_instruments in self.instruments: + if _item_instruments: + _items.append(_item_instruments.to_dict()) + _dict['instruments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrDetailsStepData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "step": obj.get("step"), + "title": obj.get("title"), + "instruments": [OmrDetectedInstrument.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_details_submission.py b/flat_api/models/omr_details_submission.py new file mode 100644 index 0000000..329d972 --- /dev/null +++ b/flat_api/models/omr_details_submission.py @@ -0,0 +1,111 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from flat_api.models.omr_instrument_override import OmrInstrumentOverride +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrDetailsSubmission(BaseModel): + """ + Overrides for the `details` step. Omitted fields keep the server's detected values. + """ # noqa: E501 + step: StrictStr = Field(description="Discriminator for `OmrStepSubmission`; always `details` for this submission.") + title: Optional[Annotated[str, Field(strict=True, max_length=500)]] = Field(default=None, description="Override the detected work title.") + main_language: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=35)]] = Field(default=None, description="Override the main language (BCP 47) used for lyric and text reading on resume. Defaults to the job locale (`locales`); set this to correct it on the review screen. ", alias="mainLanguage") + instruments: Optional[Annotated[List[OmrInstrumentOverride], Field(max_length=200)]] = Field(default=None, description="Per-part overrides, each matched to a detected part by `index`.") + __properties: ClassVar[List[str]] = ["step", "title", "mainLanguage", "instruments"] + + @field_validator('step') + def step_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['details']): + raise ValueError("must be one of enum values ('details')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrDetailsSubmission from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instruments (list) + _items = [] + if self.instruments: + for _item_instruments in self.instruments: + if _item_instruments: + _items.append(_item_instruments.to_dict()) + _dict['instruments'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrDetailsSubmission from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "step": obj.get("step"), + "title": obj.get("title"), + "mainLanguage": obj.get("mainLanguage"), + "instruments": [OmrInstrumentOverride.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None + }) + return _obj + + diff --git a/flat_api/models/omr_detected_instrument.py b/flat_api/models/omr_detected_instrument.py new file mode 100644 index 0000000..e6e19e5 --- /dev/null +++ b/flat_api/models/omr_detected_instrument.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrDetectedInstrument(BaseModel): + """ + One detected part. + """ # noqa: E501 + index: StrictInt = Field(description="0-based position of the part in the score.") + part_name: Optional[StrictStr] = Field(default=None, description="Verbatim part name read from the score.", alias="partName") + instrument_id: Optional[StrictStr] = Field(default=None, description="Flat instrument ID in dotted `.` form, for example `brass.horn` or `vocals.voice-oohs`. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments). Always the canonical (non-premium) ID.", alias="instrumentId") + instrument_name: Optional[StrictStr] = Field(default=None, description="Localized display name, resolved server-side so the client needs no instruments dictionary.", alias="instrumentName") + midi_program: Optional[StrictInt] = Field(default=None, description="General MIDI program number.", alias="midiProgram") + transpose_key: Optional[StrictStr] = Field(default=None, description="Transposition or written key shown in the UI, for example `F` for Horn in F.", alias="transposeKey") + resolved_confidence: Optional[StrictStr] = Field(default=None, description="Server confidence in the resolved instrument match.", alias="resolvedConfidence") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["index", "partName", "instrumentId", "instrumentName", "midiProgram", "transposeKey", "resolvedConfidence"] + + @field_validator('resolved_confidence') + def resolved_confidence_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['high', 'medium', 'low']): + raise ValueError("must be one of enum values ('high', 'medium', 'low')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrDetectedInstrument from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrDetectedInstrument from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index": obj.get("index"), + "partName": obj.get("partName"), + "instrumentId": obj.get("instrumentId"), + "instrumentName": obj.get("instrumentName"), + "midiProgram": obj.get("midiProgram"), + "transposeKey": obj.get("transposeKey"), + "resolvedConfidence": obj.get("resolvedConfidence") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_imported_metadata.py b/flat_api/models/omr_imported_metadata.py new file mode 100644 index 0000000..38a8ae4 --- /dev/null +++ b/flat_api/models/omr_imported_metadata.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrImportedMetadata(BaseModel): + """ + Metadata extracted from the recognized score. + """ # noqa: E501 + instruments: Optional[List[StrictStr]] = Field(default=None, description="Instrument IDs of the assembled parts.") + number_measures: Optional[StrictInt] = Field(default=None, description="Number of measures in the recognized score.", alias="numberMeasures") + main_tempo_qpm: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Main tempo, in quarter notes per minute.", alias="mainTempoQpm") + main_key_signature: Optional[StrictInt] = Field(default=None, description="Main key signature as a fifths count (negative for flats, positive for sharps, 0 for C major / A minor).", alias="mainKeySignature") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["instruments", "numberMeasures", "mainTempoQpm", "mainKeySignature"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrImportedMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrImportedMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "instruments": obj.get("instruments"), + "numberMeasures": obj.get("numberMeasures"), + "mainTempoQpm": obj.get("mainTempoQpm"), + "mainKeySignature": obj.get("mainKeySignature") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_instrument_override.py b/flat_api/models/omr_instrument_override.py new file mode 100644 index 0000000..984298c --- /dev/null +++ b/flat_api/models/omr_instrument_override.py @@ -0,0 +1,108 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, field_validator +from typing import Any, ClassVar, Dict, Optional +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrInstrumentOverride(BaseModel): + """ + Override for a single detected part, matched by `index`. Omitted fields keep the detected value. To set the instrument you may use **either** `instrumentId` (Flat's instrument id) **or** `midiProgram` (a standard General MIDI program) — whichever your integration prefers; you do not need both. If both are sent, `instrumentId` wins; otherwise `midiProgram` is resolved to the matching instrument; otherwise the detected instrument is kept. `transposeKey` and `partName` apply independently on top. + """ # noqa: E501 + index: Annotated[int, Field(strict=True, ge=0)] = Field(description="0-based position of the part to override, matching the `index` of the detected part.") + instrument_id: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=100)]] = Field(default=None, description="Override the resolved instrument with this Flat instrument id, for example `brass.horn`. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments) for valid values. Both the dotted `.` form (`brass.horn`) and the bare instrument key (`horn`) are accepted. Use this or `midiProgram`. Takes precedence over `midiProgram` when both are set. ", alias="instrumentId") + part_name: Optional[Annotated[str, Field(strict=True, max_length=200)]] = Field(default=None, description="Override the part name.", alias="partName") + transpose_key: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="Override the transposition / written key: a pitch class as a letter `A`-`G` with an optional accidental. For example `F` for Horn in F or `Bb` for a B flat clarinet. The accidental may be ASCII `b` (flat) or `#` (sharp), or the Unicode music glyphs `♭` (U+266D) and `♯` (U+266F). Unicode accidentals are normalized to their ASCII equivalent, so `B♭` is stored and returned as `Bb`. ", alias="transposeKey") + midi_program: Optional[Annotated[int, Field(le=127, strict=True, ge=0)]] = Field(default=None, description="Override the instrument with a standard General MIDI program number (0-127), resolved server-side to the matching Flat instrument. Use this when you do not want to map Flat instrument ids. Ignored if `instrumentId` is also set. ", alias="midiProgram") + __properties: ClassVar[List[str]] = ["index", "instrumentId", "partName", "transposeKey", "midiProgram"] + + @field_validator('transpose_key', mode="before") + def transpose_key_validate_regular_expression(cls, value): + """Validates the regular expression""" + if value is None: + return value + + if isinstance(value, str) and not re.match(r"^[A-G][b♭#♯]?$", value): + raise ValueError(r"must validate the regular expression /^[A-G][b♭#♯]?$/") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrInstrumentOverride from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrInstrumentOverride from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "index": obj.get("index"), + "instrumentId": obj.get("instrumentId"), + "partName": obj.get("partName"), + "transposeKey": obj.get("transposeKey"), + "midiProgram": obj.get("midiProgram") + }) + return _obj + + diff --git a/flat_api/models/omr_job.py b/flat_api/models/omr_job.py new file mode 100644 index 0000000..7b76ff7 --- /dev/null +++ b/flat_api/models/omr_job.py @@ -0,0 +1,162 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.omr_imported_metadata import OmrImportedMetadata +from flat_api.models.omr_job_file_metadata import OmrJobFileMetadata +from flat_api.models.omr_job_output import OmrJobOutput +from flat_api.models.omr_job_progress import OmrJobProgress +from flat_api.models.omr_job_result import OmrJobResult +from flat_api.models.omr_job_retention import OmrJobRetention +from flat_api.models.omr_job_status import OmrJobStatus +from flat_api.models.omr_pending_step import OmrPendingStep +from flat_api.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJob(BaseModel): + """ + OmrJob + """ # noqa: E501 + id: StrictStr = Field(description="Unique identifier of the OMR job.") + status: OmrJobStatus + output: OmrJobOutput + interactive_steps: List[OmrStepName] = Field(description="Steps this job pauses at for client input, echoing the value set at creation.", alias="interactiveSteps") + locales: Optional[List[StrictStr]] = Field(default=None, description="Locale hints (BCP 47) the job was created with, used for OCR and as the default main language at the `details` step. ") + current_step: Optional[OmrStepName] = Field(default=None, description="The pending step when `status` is `awaitingInput`. Omitted otherwise.", alias="currentStep") + pending_step: Optional[OmrPendingStep] = Field(default=None, alias="pendingStep") + estimated_credits: Optional[StrictInt] = Field(default=None, description="Credits that will be or were charged at start (page-based), so a client can show a confirmation before charging.", alias="estimatedCredits") + progress: Optional[OmrJobProgress] = None + original_file_metadata: Optional[OmrJobFileMetadata] = Field(default=None, alias="originalFileMetadata") + imported_metadata: Optional[OmrImportedMetadata] = Field(default=None, alias="importedMetadata") + result: Optional[OmrJobResult] = None + retention: Optional[OmrJobRetention] = None + error_code: Optional[StrictStr] = Field(default=None, description="Stable, engine-agnostic failure code, present when `status` is `error`. Branch on this for custom handling, and render `errorMessage` for the user-facing text. This is an open string: new codes may be added over time, so keep a generic fallback and never hardcode an exhaustive switch. Current values: * `NO_MUSIC_DETECTED`: no musical content found (poor scan, rotated page, or tablature). * `CORRUPTED_FILE`: the input file is corrupted and could not be read. * `UNSUPPORTED_FORMAT`: the file format or notation is not supported yet. * `UNSUPPORTED_TABLATURE`: the file is guitar tablature, not supported yet. * `ENCRYPTED_PDF`: the PDF is password-protected. * `TOO_LARGE`: the document is too large or has an unusual shape to process. * `ENGINE_TIMEOUT`: recognition took longer than expected and was stopped. * `GENERIC`: unspecified failure. ", alias="errorCode") + error_message: Optional[StrictStr] = Field(default=None, description="Localized, user-facing error message, present when `status` is `error`. Rendered in the caller's locale and safe to display as-is. Pair with `errorCode` for branching. ", alias="errorMessage") + creation_date: Optional[datetime] = Field(default=None, description="When the job was created.", alias="creationDate") + modification_date: Optional[datetime] = Field(default=None, description="When the job was last updated.", alias="modificationDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "status", "output", "interactiveSteps", "locales", "currentStep", "pendingStep", "estimatedCredits", "progress", "originalFileMetadata", "importedMetadata", "result", "retention", "errorCode", "errorMessage", "creationDate", "modificationDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJob from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of pending_step + if self.pending_step: + _dict['pendingStep'] = self.pending_step.to_dict() + # override the default output from pydantic by calling `to_dict()` of progress + if self.progress: + _dict['progress'] = self.progress.to_dict() + # override the default output from pydantic by calling `to_dict()` of original_file_metadata + if self.original_file_metadata: + _dict['originalFileMetadata'] = self.original_file_metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of imported_metadata + if self.imported_metadata: + _dict['importedMetadata'] = self.imported_metadata.to_dict() + # override the default output from pydantic by calling `to_dict()` of result + if self.result: + _dict['result'] = self.result.to_dict() + # override the default output from pydantic by calling `to_dict()` of retention + if self.retention: + _dict['retention'] = self.retention.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJob from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "status": obj.get("status"), + "output": obj.get("output") if obj.get("output") is not None else OmrJobOutput.LIBRARY, + "interactiveSteps": obj.get("interactiveSteps"), + "locales": obj.get("locales"), + "currentStep": obj.get("currentStep"), + "pendingStep": OmrPendingStep.from_dict(obj["pendingStep"]) if obj.get("pendingStep") is not None else None, + "estimatedCredits": obj.get("estimatedCredits"), + "progress": OmrJobProgress.from_dict(obj["progress"]) if obj.get("progress") is not None else None, + "originalFileMetadata": OmrJobFileMetadata.from_dict(obj["originalFileMetadata"]) if obj.get("originalFileMetadata") is not None else None, + "importedMetadata": OmrImportedMetadata.from_dict(obj["importedMetadata"]) if obj.get("importedMetadata") is not None else None, + "result": OmrJobResult.from_dict(obj["result"]) if obj.get("result") is not None else None, + "retention": OmrJobRetention.from_dict(obj["retention"]) if obj.get("retention") is not None else None, + "errorCode": obj.get("errorCode"), + "errorMessage": obj.get("errorMessage"), + "creationDate": obj.get("creationDate"), + "modificationDate": obj.get("modificationDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_creation.py b/flat_api/models/omr_job_creation.py new file mode 100644 index 0000000..3bfdf71 --- /dev/null +++ b/flat_api/models/omr_job_creation.py @@ -0,0 +1,124 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.omr_job_input_file import OmrJobInputFile +from flat_api.models.omr_job_output import OmrJobOutput +from flat_api.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobCreation(BaseModel): + """ + Parameters to create an OMR job. Send without `files` to create a draft (then add files with `addOmrJobFile` and run `startOmrJob`), or include `files` and `autoStart: true` to import in a single request. + """ # noqa: E501 + output: Optional[OmrJobOutput] = OmrJobOutput.LIBRARY + interactive_steps: Optional[List[OmrStepName]] = Field(default=None, description="Steps at which the pipeline should pause for this client. Omit or send `[]` for a fully automatic import. The server only pauses at the steps listed here; declare only steps your client can actually render. ", alias="interactiveSteps") + locales: Optional[List[StrictStr]] = Field(default=None, description="Locale hints (BCP 47) to improve text and lyric detection, for example `[\"ja\", \"en\"]`. The first entry drives the OCR reader. This is the input hint; the detected main language is confirmed later at the `details` step. ") + collection: Optional[StrictStr] = Field(default=None, description="Target collection ID. Only used when `output` is `library`.") + idempotency_key: Optional[StrictStr] = Field(default=None, description="Optional client-supplied key. A retry with the same key returns the existing job instead of creating a duplicate, for safe retries on flaky networks. ", alias="idempotencyKey") + files: Optional[List[OmrJobInputFile]] = Field(default=None, description="Optional inline inputs for a one-shot import. For multi-image or mobile capture, omit this and use `addOmrJobFile`.") + auto_start: Optional[StrictBool] = Field(default=None, description="Start processing immediately. Only valid when `files` is provided.", alias="autoStart") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["output", "interactiveSteps", "locales", "collection", "idempotencyKey", "files", "autoStart"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobCreation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in files (list) + _items = [] + if self.files: + for _item_files in self.files: + if _item_files: + _items.append(_item_files.to_dict()) + _dict['files'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobCreation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "output": obj.get("output") if obj.get("output") is not None else OmrJobOutput.LIBRARY, + "interactiveSteps": obj.get("interactiveSteps"), + "locales": obj.get("locales"), + "collection": obj.get("collection"), + "idempotencyKey": obj.get("idempotencyKey"), + "files": [OmrJobInputFile.from_dict(_item) for _item in obj["files"]] if obj.get("files") is not None else None, + "autoStart": obj.get("autoStart") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_file_metadata.py b/flat_api/models/omr_job_file_metadata.py new file mode 100644 index 0000000..5401ef8 --- /dev/null +++ b/flat_api/models/omr_job_file_metadata.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobFileMetadata(BaseModel): + """ + Metadata about the uploaded input. + """ # noqa: E501 + number_of_pages: Optional[StrictInt] = Field(default=None, description="Total number of pages across all input files.", alias="numberOfPages") + file_count: Optional[StrictInt] = Field(default=None, description="Number of input files attached.", alias="fileCount") + filename: Optional[StrictStr] = Field(default=None, description="Original filename of the input as uploaded (of the first file when several were combined).") + file_size: Optional[StrictInt] = Field(default=None, description="Combined size of the input files, in bytes.", alias="fileSize") + mime_type: Optional[StrictStr] = Field(default=None, description="MIME type of the input (of the first file when several were combined).", alias="mimeType") + file_extension: Optional[StrictStr] = Field(default=None, description="File extension of the input, without the leading dot (for example `pdf`).", alias="fileExtension") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["numberOfPages", "fileCount", "filename", "fileSize", "mimeType", "fileExtension"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobFileMetadata from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobFileMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "numberOfPages": obj.get("numberOfPages"), + "fileCount": obj.get("fileCount"), + "filename": obj.get("filename"), + "fileSize": obj.get("fileSize"), + "mimeType": obj.get("mimeType"), + "fileExtension": obj.get("fileExtension") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_file_upload.py b/flat_api/models/omr_job_file_upload.py new file mode 100644 index 0000000..cc126d1 --- /dev/null +++ b/flat_api/models/omr_job_file_upload.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobFileUpload(BaseModel): + """ + One image or PDF added to a draft job. + """ # noqa: E501 + file: Union[StrictBytes, StrictStr] = Field(description="File data, base64-encoded. The type is read from the content itself, so no declared MIME type or filename extension is needed. Accepted types are listed by `getOmrCapabilities` in `acceptedMimeTypes`. ") + filename: Optional[StrictStr] = Field(default=None, description="Optional original filename, kept for display.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["file", "filename"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobFileUpload from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobFileUpload from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file": obj.get("file"), + "filename": obj.get("filename") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_file_upload_result.py b/flat_api/models/omr_job_file_upload_result.py new file mode 100644 index 0000000..a134b66 --- /dev/null +++ b/flat_api/models/omr_job_file_upload_result.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobFileUploadResult(BaseModel): + """ + Result of adding a file to a draft job. + """ # noqa: E501 + file_index: Optional[StrictInt] = Field(default=None, description="0-based index assigned to the uploaded file.", alias="fileIndex") + file_count: Optional[StrictInt] = Field(default=None, description="Total number of files now attached to the job.", alias="fileCount") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["fileIndex", "fileCount"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobFileUploadResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobFileUploadResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "fileIndex": obj.get("fileIndex"), + "fileCount": obj.get("fileCount") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_input_file.py b/flat_api/models/omr_job_input_file.py new file mode 100644 index 0000000..9436102 --- /dev/null +++ b/flat_api/models/omr_job_input_file.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBytes, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobInputFile(BaseModel): + """ + A single image or PDF input, base64-encoded. + """ # noqa: E501 + file: Union[StrictBytes, StrictStr] = Field(description="File data, base64-encoded. The type is read from the content itself, so no declared MIME type or filename extension is needed. Accepted types are listed by `getOmrCapabilities` in `acceptedMimeTypes`. ") + filename: Optional[StrictStr] = Field(default=None, description="Optional original filename, kept for display.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["file", "filename"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobInputFile from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobInputFile from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "file": obj.get("file"), + "filename": obj.get("filename") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_output.py b/flat_api/models/omr_job_output.py new file mode 100644 index 0000000..0c56c06 --- /dev/null +++ b/flat_api/models/omr_job_output.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OmrJobOutput(str, Enum): + """ + Where the result of the job goes. * `library`: import the result into the Flat Library and create a score (default). * `musicxml`: finalize the result only, downloadable via `getOmrJobExport`. No score is created, for third-party integrations that do not use the Library. + """ + + """ + allowed enum values + """ + LIBRARY = 'library' + MUSICXML = 'musicxml' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OmrJobOutput from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/models/omr_job_progress.py b/flat_api/models/omr_job_progress.py new file mode 100644 index 0000000..7fb0288 --- /dev/null +++ b/flat_api/models/omr_job_progress.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobProgress(BaseModel): + """ + Live progress while the job is processing. + """ # noqa: E501 + percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Completion percentage (0-100).") + text: Optional[StrictStr] = Field(default=None, description="Localized progress message, ready to display.") + key: Optional[StrictStr] = Field(default=None, description="Stable progress key (for example `OMR_QUEUED`, `OMR_PROCESSING_PAGE`, `OMR_CREATING_SCORE`), for matching the current phase in a stepper UI independent of locale. ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["percent", "text", "key"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobProgress from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobProgress from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "percent": obj.get("percent"), + "text": obj.get("text"), + "key": obj.get("key") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_result.py b/flat_api/models/omr_job_result.py new file mode 100644 index 0000000..d93b0e5 --- /dev/null +++ b/flat_api/models/omr_job_result.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobResult(BaseModel): + """ + The outcome of a finished job. Present when `status` is `done`. + """ # noqa: E501 + score: Optional[StrictStr] = Field(default=None, description="Created score ID, when `output` is `library`.") + exports: Optional[List[StrictStr]] = Field(default=None, description="Formats available via `getOmrJobExport`, for example `[\"musicxml\", \"mxl\", \"midi\"]`.") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["score", "exports"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobResult from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobResult from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "score": obj.get("score"), + "exports": obj.get("exports") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_retention.py b/flat_api/models/omr_job_retention.py new file mode 100644 index 0000000..edb00b5 --- /dev/null +++ b/flat_api/models/omr_job_retention.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrJobRetention(BaseModel): + """ + Data-retention state of the job. Present only on jobs whose `output` is `musicxml`. Jobs imported into the Flat library are part of your library content, are not covered by this policy, and omit this object entirely. Erasure is performed by a periodic cleanup pass, so the files are removed shortly after `expiryDate` rather than exactly on it. Plan for the deadline, not the instant. + """ # noqa: E501 + expiry_date: datetime = Field(description="When this job's uploaded files and recognition results become eligible for erasure. Fixed when the job is created: changing the account's retention period does not move the deadline of jobs that already exist. ", alias="expiryDate") + expired_date: Optional[datetime] = Field(default=None, description="When the job's stored files were actually erased. Present only once that happened. An expired job keeps the `status` it finished with and stays listable, but its `result` is no longer served and downloads fail with `OMR_JOB_EXPIRED`. ", alias="expiredDate") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["expiryDate", "expiredDate"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrJobRetention from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrJobRetention from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "expiryDate": obj.get("expiryDate"), + "expiredDate": obj.get("expiredDate") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_job_status.py b/flat_api/models/omr_job_status.py new file mode 100644 index 0000000..9552bf2 --- /dev/null +++ b/flat_api/models/omr_job_status.py @@ -0,0 +1,42 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OmrJobStatus(str, Enum): + """ + Public, client-facing status of the job, derived from the internal job and task state. * `draft`: created, files can still be added; not yet started or charged. * `processing`: the pipeline is running. * `awaitingInput`: paused on the `currentStep`, waiting for the client to submit it. * `done`: finished. See `result`. * `error`: failed. See `errorCode`. * `canceled`: canceled by the client. + """ + + """ + allowed enum values + """ + DRAFT = 'draft' + PROCESSING = 'processing' + AWAITINGINPUT = 'awaitingInput' + DONE = 'done' + ERROR = 'error' + CANCELED = 'canceled' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OmrJobStatus from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/models/omr_locale_details.py b/flat_api/models/omr_locale_details.py new file mode 100644 index 0000000..6541760 --- /dev/null +++ b/flat_api/models/omr_locale_details.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrLocaleDetails(BaseModel): + """ + An OCR-selectable locale with its English name. + """ # noqa: E501 + code: StrictStr = Field(description="BCP 47 locale code. Always one of the codes listed in `locales`.", json_schema_extra={"examples": ["vi"]}) + name: StrictStr = Field(description="English name of the language, for display in a picker.", json_schema_extra={"examples": ["Vietnamese"]}) + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["code", "name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrLocaleDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrLocaleDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "name": obj.get("name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_pending_step.py b/flat_api/models/omr_pending_step.py new file mode 100644 index 0000000..66a3fe4 --- /dev/null +++ b/flat_api/models/omr_pending_step.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from flat_api.models.omr_details_step_data import OmrDetailsStepData +from flat_api.models.omr_step_name import OmrStepName +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class OmrPendingStep(BaseModel): + """ + The step currently awaiting client input. The `data` shape is keyed by `step`. + """ # noqa: E501 + step: OmrStepName + data: OmrDetailsStepData + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["step", "data"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of OmrPendingStep from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of data + if self.data: + _dict['data'] = self.data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of OmrPendingStep from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "step": obj.get("step"), + "data": OmrDetailsStepData.from_dict(obj["data"]) if obj.get("data") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/omr_step_name.py b/flat_api/models/omr_step_name.py new file mode 100644 index 0000000..cdc12c5 --- /dev/null +++ b/flat_api/models/omr_step_name.py @@ -0,0 +1,37 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class OmrStepName(str, Enum): + """ + Interactive pipeline step. Forward-compatible: new values may be added over time. Only steps a client lists in `interactiveSteps` can pause that client's job; any step a client does not list (including future ones) is auto-resolved by the server. * `details`: confirm or adjust the detected title, main language and instruments before assembly. Pauses after note recognition, so resuming re-runs only the cheap assembly and finalize stages. + """ + + """ + allowed enum values + """ + DETAILS = 'details' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of OmrStepName from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/models/organization_invitation.py b/flat_api/models/organization_invitation.py index f2a3812..bf6d1e7 100644 --- a/flat_api/models/organization_invitation.py +++ b/flat_api/models/organization_invitation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,11 +19,12 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.organization_roles import OrganizationRoles from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class OrganizationInvitation(BaseModel): """ @@ -36,15 +37,18 @@ class OrganizationInvitation(BaseModel): custom_code: Optional[StrictStr] = Field(description="Enrollment code to use when joining this organization", alias="customCode") email: Optional[StrictStr] = Field(default=None, description="The email address this invitation was sent to") invited_by: Optional[StrictStr] = Field(default=None, description="The unique identifier of the User who created this invitation", alias="invitedBy") + html_url: Optional[StrictStr] = Field(default=None, description="URL to join the organization using this invitation", alias="htmlUrl") allow_multiple_use: StrictBool = Field(description="If true, the invitation can be used multiple times. If false, the invitation can only be used once. ", alias="allowMultipleUse") used_by: Optional[List[StrictStr]] = Field(default=None, description="List of users who used this invitation", alias="usedBy") - __properties: ClassVar[List[str]] = ["id", "creationDate", "organization", "organizationRole", "customCode", "email", "invitedBy", "allowMultipleUse", "usedBy"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "creationDate", "organization", "organizationRole", "customCode", "email", "invitedBy", "htmlUrl", "allowMultipleUse", "usedBy"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -53,8 +57,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -70,8 +73,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -79,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if custom_code (nullable) is None # and model_fields_set contains the field if self.custom_code is None and "custom_code" in self.model_fields_set: @@ -103,9 +113,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "customCode": obj.get("customCode"), "email": obj.get("email"), "invitedBy": obj.get("invitedBy"), + "htmlUrl": obj.get("htmlUrl"), "allowMultipleUse": obj.get("allowMultipleUse"), "usedBy": obj.get("usedBy") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/organization_invitation_creation.py b/flat_api/models/organization_invitation_creation.py index db09d76..a86e925 100644 --- a/flat_api/models/organization_invitation_creation.py +++ b/flat_api/models/organization_invitation_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class OrganizationInvitationCreation(BaseModel): """ @@ -29,6 +30,7 @@ class OrganizationInvitationCreation(BaseModel): """ # noqa: E501 email: Optional[StrictStr] = Field(default=None, description="The email address you want to send the invitation to") organization_role: Optional[StrictStr] = Field(default='teacher', description="User's Organization Role", alias="organizationRole") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["email", "organizationRole"] @field_validator('organization_role') @@ -37,15 +39,16 @@ def organization_role_validate_enum(cls, value): if value is None: return value - if value not in set(['admin', 'teacher']): - raise ValueError("must be one of enum values ('admin', 'teacher')") + if value not in set(['admin', 'teacher', 'accountAdmin']): + raise ValueError("must be one of enum values ('admin', 'teacher', 'accountAdmin')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -54,8 +57,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -71,8 +73,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -95,6 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "email": obj.get("email"), "organizationRole": obj.get("organizationRole") if obj.get("organizationRole") is not None else 'teacher' }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/organization_roles.py b/flat_api/models/organization_roles.py index 6b6ed95..3b45067 100644 --- a/flat_api/models/organization_roles.py +++ b/flat_api/models/organization_roles.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -28,7 +28,7 @@ class OrganizationRoles(str, Enum): allowed enum values """ ADMIN = 'admin' - BILLING = 'billing' + ACCOUNTADMIN = 'accountAdmin' TEACHER = 'teacher' USER = 'user' diff --git a/flat_api/models/organization_user_access_token_creation.py b/flat_api/models/organization_user_access_token_creation.py index 91c6cdb..d61a820 100644 --- a/flat_api/models/organization_user_access_token_creation.py +++ b/flat_api/models/organization_user_access_token_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,24 +18,27 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field from typing import Any, ClassVar, Dict, List from flat_api.models.app_scopes import AppScopes from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class OrganizationUserAccessTokenCreation(BaseModel): """ Creation of a delegated API access token for an organization user """ # noqa: E501 scopes: List[AppScopes] = Field(description="List of requested scopes for this credential") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["scopes"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -84,6 +93,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "scopes": obj.get("scopes") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/rename_group_request.py b/flat_api/models/rename_group_request.py new file mode 100644 index 0000000..5b397fc --- /dev/null +++ b/flat_api/models/rename_group_request.py @@ -0,0 +1,102 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class RenameGroupRequest(BaseModel): + """ + RenameGroupRequest + """ # noqa: E501 + name: StrictStr = Field(description="New name for the group") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["name"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RenameGroupRequest from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RenameGroupRequest from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/resource_collaborator.py b/flat_api/models/resource_collaborator.py index 2ac6008..c12da4e 100644 --- a/flat_api/models/resource_collaborator.py +++ b/flat_api/models/resource_collaborator.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,21 +19,22 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.group import Group from flat_api.models.user_public import UserPublic from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ResourceCollaborator(BaseModel): """ - ResourceCollaborator + A collaborator of a score. The `userEmail` and `group` are only available if the requesting user is a collaborator of the related score (in this case these permissions will eventualy not be listed and exposed publicly). """ # noqa: E501 acl_read: StrictBool = Field(description="`True` if the current user can read the current document ", alias="aclRead") acl_write: StrictBool = Field(description="`True` if the current user can modify the current document. If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclWrite") acl_admin: StrictBool = Field(description="`True` if the current user can manage the current document (i.e. share, delete) If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclAdmin") - is_collaborator: StrictBool = Field(description="`True` if the current user is a collaborator of the current document (direct or via group). ", alias="isCollaborator") + is_collaborator: Optional[StrictBool] = Field(default=False, description="`True` if the current user is a collaborator of the current document (direct or via group). ", alias="isCollaborator") collaborator_type: Optional[StrictStr] = Field(default=None, description="The type of the collaborator for the resource ", alias="collaboratorType") id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the permission") var_date: Optional[datetime] = Field(default=None, description="The date when the permission was added", alias="date") @@ -43,6 +44,7 @@ class ResourceCollaborator(BaseModel): group: Optional[Group] = None user_email: Optional[StrictStr] = Field(default=None, description="If the collaborator is not a user of Flat yet, this field will contain their email. ", alias="userEmail") invited: Optional[StrictBool] = Field(default=None, description="If this property is `true`, this is still a pending invitation ") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["aclRead", "aclWrite", "aclAdmin", "isCollaborator", "collaboratorType", "id", "date", "score", "collection", "user", "group", "userEmail", "invited"] @field_validator('collaborator_type') @@ -55,11 +57,12 @@ def collaborator_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('owner', 'user', 'group')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -68,8 +71,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -85,8 +87,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -100,6 +104,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of group if self.group: _dict['group'] = self.group.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -126,6 +135,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "userEmail": obj.get("userEmail"), "invited": obj.get("invited") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/resource_collaborator_creation.py b/flat_api/models/resource_collaborator_creation.py index f8a5af1..ab56cf7 100644 --- a/flat_api/models/resource_collaborator_creation.py +++ b/flat_api/models/resource_collaborator_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ResourceCollaboratorCreation(BaseModel): """ @@ -34,13 +35,15 @@ class ResourceCollaboratorCreation(BaseModel): acl_read: Optional[StrictBool] = Field(default=True, description="`True` if the related user can read the score. (probably true if the user has a permission on the document). ", alias="aclRead") acl_write: Optional[StrictBool] = Field(default=False, description="`True` if the related user can modify the score. ", alias="aclWrite") acl_admin: Optional[StrictBool] = Field(default=False, description="`True` if the related user can can manage the current document, i.e. changing the document permissions and deleting the document ", alias="aclAdmin") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["user", "group", "userEmail", "userToken", "aclRead", "aclWrite", "aclAdmin"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -49,8 +52,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -66,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -75,6 +79,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -95,6 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "aclWrite": obj.get("aclWrite") if obj.get("aclWrite") is not None else False, "aclAdmin": obj.get("aclAdmin") if obj.get("aclAdmin") is not None else False }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/resource_rights.py b/flat_api/models/resource_rights.py index e25a256..edcaeff 100644 --- a/flat_api/models/resource_rights.py +++ b/flat_api/models/resource_rights.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ResourceRights(BaseModel): """ @@ -30,8 +31,9 @@ class ResourceRights(BaseModel): acl_read: StrictBool = Field(description="`True` if the current user can read the current document ", alias="aclRead") acl_write: StrictBool = Field(description="`True` if the current user can modify the current document. If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclWrite") acl_admin: StrictBool = Field(description="`True` if the current user can manage the current document (i.e. share, delete) If this is a right of a Collection, the capabilities of the associated user can be lower than this permission, check out the `capabilities` property as the end-user to have the complete possibilities with the collection. ", alias="aclAdmin") - is_collaborator: StrictBool = Field(description="`True` if the current user is a collaborator of the current document (direct or via group). ", alias="isCollaborator") + is_collaborator: Optional[StrictBool] = Field(default=False, description="`True` if the current user is a collaborator of the current document (direct or via group). ", alias="isCollaborator") collaborator_type: Optional[StrictStr] = Field(default=None, description="The type of the collaborator for the resource ", alias="collaboratorType") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["aclRead", "aclWrite", "aclAdmin", "isCollaborator", "collaboratorType"] @field_validator('collaborator_type') @@ -44,11 +46,12 @@ def collaborator_type_validate_enum(cls, value): raise ValueError("must be one of enum values ('owner', 'user', 'group')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -57,8 +60,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -74,8 +76,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -83,6 +87,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -101,6 +110,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "isCollaborator": obj.get("isCollaborator") if obj.get("isCollaborator") is not None else False, "collaboratorType": obj.get("collaboratorType") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_comment.py b/flat_api/models/score_comment.py index a298c99..8c9eef7 100644 --- a/flat_api/models/score_comment.py +++ b/flat_api/models/score_comment.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,50 +19,50 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.score_comment_context import ScoreCommentContext from flat_api.models.score_comment_moderation import ScoreCommentModeration from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreComment(BaseModel): """ Comment added on a sheet music """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The comment unique identifier") - type: Optional[StrictStr] = Field(default=None, description="The type of the comment") - user: Optional[StrictStr] = Field(default=None, description="The author unique identifier") - score: Optional[StrictStr] = Field(default=None, description="The unique identifier of the score where the comment was posted") + id: StrictStr = Field(description="The comment unique identifier") + type: StrictStr = Field(description="The type of the comment") + user: StrictStr = Field(description="The author unique identifier") + score: StrictStr = Field(description="The unique identifier of the score where the comment was posted") revision: Optional[StrictStr] = Field(default=None, description="The unique identifier of revision the comment was posted") reply_to: Optional[StrictStr] = Field(default=None, description="When the comment is a reply to another comment, the unique identifier of the parent comment ", alias="replyTo") - var_date: Optional[datetime] = Field(default=None, description="The date when the comment was posted", alias="date") + var_date: datetime = Field(description="The date when the comment was posted", alias="date") modification_date: Optional[datetime] = Field(default=None, description="The date of the last comment modification", alias="modificationDate") - comment: Optional[StrictStr] = Field(default=None, description="The comment text that can includes mentions using the following format: `@[id:username]`. ") - raw_comment: Optional[StrictStr] = Field(default=None, description="A raw version of the comment, that can be displayed without parsing the mentions. ", alias="rawComment") + comment: StrictStr = Field(description="The comment text that can includes mentions using the following format: `@[id:username]`. ") + raw_comment: StrictStr = Field(description="A raw version of the comment, that can be displayed without parsing the mentions. ", alias="rawComment") context: Optional[ScoreCommentContext] = None mentions: Optional[List[StrictStr]] = Field(default=None, description="The list of user identifier mentioned on the score") resolved: Optional[StrictBool] = Field(default=None, description="For inline comments, the comment can be marked as resolved and will be hidden in the future responses ") resolved_by: Optional[StrictStr] = Field(default=None, description="If the user is marked as resolved, this will contain the unique identifier of the User who marked this comment as resolved ", alias="resolvedBy") moderation: Optional[ScoreCommentModeration] = None spam: Optional[StrictBool] = Field(default=None, description="`true if the message has been detected as spam and hidden from other users ") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "type", "user", "score", "revision", "replyTo", "date", "modificationDate", "comment", "rawComment", "context", "mentions", "resolved", "resolvedBy", "moderation", "spam"] @field_validator('type') def type_validate_enum(cls, value): """Validates the enum""" - if value is None: - return value - if value not in set(['document', 'inline']): raise ValueError("must be one of enum values ('document', 'inline')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -71,8 +71,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -88,8 +87,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -103,6 +104,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of moderation if self.moderation: _dict['moderation'] = self.moderation.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -132,6 +138,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "moderation": ScoreCommentModeration.from_dict(obj["moderation"]) if obj.get("moderation") is not None else None, "spam": obj.get("spam") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_comment_context.py b/flat_api/models/score_comment_context.py index a8185d9..c5a2e64 100644 --- a/flat_api/models/score_comment_context.py +++ b/flat_api/models/score_comment_context.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreCommentContext(BaseModel): """ @@ -35,13 +36,15 @@ class ScoreCommentContext(BaseModel): stop_time_pos: Union[StrictFloat, StrictInt] = Field(alias="stopTimePos") start_dpq: Union[StrictFloat, StrictInt] = Field(alias="startDpq") stop_dpq: Union[StrictFloat, StrictInt] = Field(alias="stopDpq") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["partUuid", "staffIdx", "staffUuid", "measureUuids", "startTimePos", "stopTimePos", "startDpq", "stopDpq"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -50,8 +53,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -67,8 +69,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -76,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -97,6 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "startDpq": obj.get("startDpq"), "stopDpq": obj.get("stopDpq") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_comment_creation.py b/flat_api/models/score_comment_creation.py index 5b2c980..b49de54 100644 --- a/flat_api/models/score_comment_creation.py +++ b/flat_api/models/score_comment_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,29 +18,32 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.score_comment_context import ScoreCommentContext from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreCommentCreation(BaseModel): """ Creation of a comment """ # noqa: E501 - revision: Optional[StrictStr] = Field(default=None, description="The unique indentifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. ") + revision: Optional[StrictStr] = Field(default=None, description="The unique identifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. ") comment: StrictStr = Field(description="The comment text that can includes mentions using the following format: `@[id:username]`. ") raw_comment: Optional[StrictStr] = Field(default=None, description="A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set. ", alias="rawComment") mentions: Optional[List[StrictStr]] = Field(default=None, description="The list of user identifiers mentioned in this comment") reply_to: Optional[StrictStr] = Field(default=None, description="When the comment is a reply to another comment, the unique identifier of the parent comment ", alias="replyTo") context: Optional[ScoreCommentContext] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["revision", "comment", "rawComment", "mentions", "replyTo", "context"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -49,8 +52,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -66,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +82,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of context if self.context: _dict['context'] = self.context.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -97,6 +106,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "replyTo": obj.get("replyTo"), "context": ScoreCommentContext.from_dict(obj["context"]) if obj.get("context") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_comment_moderation.py b/flat_api/models/score_comment_moderation.py index ced5e95..71918c5 100644 --- a/flat_api/models/score_comment_moderation.py +++ b/flat_api/models/score_comment_moderation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreCommentModeration(BaseModel): """ @@ -29,6 +30,7 @@ class ScoreCommentModeration(BaseModel): """ # noqa: E501 hidden: Optional[StrictBool] = Field(default=None, description="If true, this comment will be hidden from other users") reason: Optional[StrictStr] = Field(default=None, description="If the comment is hidden, the reason why this one has been moderated") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["hidden", "reason"] @field_validator('reason') @@ -41,11 +43,12 @@ def reason_validate_enum(cls, value): raise ValueError("must be one of enum values ('spam', 'inappropriate')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -54,8 +57,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -71,8 +73,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,6 +84,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -95,6 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hidden": obj.get("hidden"), "reason": obj.get("reason") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_comment_update.py b/flat_api/models/score_comment_update.py index ef245d0..7591f27 100644 --- a/flat_api/models/score_comment_update.py +++ b/flat_api/models/score_comment_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,28 +18,31 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flat_api.models.score_comment_context import ScoreCommentContext from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreCommentUpdate(BaseModel): """ Update of a comment """ # noqa: E501 - revision: Optional[StrictStr] = Field(default=None, description="The unique indentifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. ") + revision: Optional[StrictStr] = Field(default=None, description="The unique identifier of the revision of the score where the comment was added. If this property is unspecified or contains \"last\", the API will automatically take the last revision created. ") comment: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=10000)]] = Field(default=None, description="The comment text that can includes mentions using the following format: `@[id:username]`. ") raw_comment: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=10000)]] = Field(default=None, description="A raw version of the comment, that can be displayed without the mentions. If you use mentions, this property must be set. ", alias="rawComment") context: Optional[ScoreCommentContext] = None + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["revision", "comment", "rawComment", "context"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -48,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,8 +67,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -77,6 +81,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of context if self.context: _dict['context'] = self.context.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -94,6 +103,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "rawComment": obj.get("rawComment"), "context": ScoreCommentContext.from_dict(obj["context"]) if obj.get("context") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_comments_counts.py b/flat_api/models/score_comments_counts.py index e468184..eff64ff 100644 --- a/flat_api/models/score_comments_counts.py +++ b/flat_api/models/score_comments_counts.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,26 +18,30 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreCommentsCounts(BaseModel): """ - A computed version of the total, unique, weekly and monthly number of comments added on the documents (this doesn't include inline comments). + A computed version of the total, unique, weekly, monthly and yearly number of comments added on the documents (this doesn't include inline comments). """ # noqa: E501 total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of comments added to the score") unique: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The unique (1/user) number of comments added to the score") weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The weekly unique number of comments added to the score") monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The monthly unique number of comments added to the score") - __properties: ClassVar[List[str]] = ["total", "unique", "weekly", "monthly"] + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The yearly unique number of comments added to the score") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "unique", "weekly", "monthly", "yearly"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,6 +77,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,8 +97,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "total": obj.get("total"), "unique": obj.get("unique"), "weekly": obj.get("weekly"), - "monthly": obj.get("monthly") + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_creation.py b/flat_api/models/score_creation.py index 9d3716b..687951b 100644 --- a/flat_api/models/score_creation.py +++ b/flat_api/models/score_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -14,110 +14,139 @@ from __future__ import annotations -import pprint -import re # noqa: F401 import json - -from pydantic import BaseModel, Field, StrictStr, field_validator -from typing import Any, ClassVar, Dict, List, Optional +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional from flat_api.models.score_creation_builder_data import ScoreCreationBuilderData -from flat_api.models.score_privacy import ScorePrivacy -from flat_api.models.score_source import ScoreSource -from typing import Optional, Set -from typing_extensions import Self +from flat_api.models.score_creation_file_import import ScoreCreationFileImport +from flat_api.models.score_creation_google_drive_import import ScoreCreationGoogleDriveImport +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +SCORECREATION_ONE_OF_SCHEMAS = ["ScoreCreationBuilderData", "ScoreCreationFileImport", "ScoreCreationGoogleDriveImport"] class ScoreCreation(BaseModel): """ ScoreCreation - """ # noqa: E501 - title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") - privacy: Optional[ScorePrivacy] = None - collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will be stored in the `root` directory. ") - google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") - builder_data: Optional[ScoreCreationBuilderData] = Field(default=None, alias="builderData") - filename: Optional[StrictStr] = Field(default=None, description="If this is an imported file, its filename") - data: Optional[StrictStr] = Field(default=None, description="The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file. Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. ") - data_encoding: Optional[StrictStr] = Field(default=None, description="The optional encoding of the score data. This property must match the encoding used for the `data` property.", alias="dataEncoding") - source: Optional[ScoreSource] = None - __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder", "builderData", "filename", "data", "dataEncoding", "source"] - - @field_validator('data_encoding') - def data_encoding_validate_enum(cls, value): - """Validates the enum""" - if value is None: - return value - - if value not in set(['base64']): - raise ValueError("must be one of enum values ('base64')") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + """ + # data type: ScoreCreationBuilderData + oneof_schema_1_validator: Optional[ScoreCreationBuilderData] = None + # data type: ScoreCreationFileImport + oneof_schema_2_validator: Optional[ScoreCreationFileImport] = None + # data type: ScoreCreationGoogleDriveImport + oneof_schema_3_validator: Optional[ScoreCreationGoogleDriveImport] = None + actual_instance: Optional[Union[ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport]] = None + one_of_schemas: Set[str] = { "ScoreCreationBuilderData", "ScoreCreationFileImport", "ScoreCreationGoogleDriveImport" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + 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`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = ScoreCreation.model_construct() + error_messages = [] + match = 0 + # validate data type: ScoreCreationBuilderData + if not isinstance(v, ScoreCreationBuilderData): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScoreCreationBuilderData`") + else: + match += 1 + # validate data type: ScoreCreationFileImport + if not isinstance(v, ScoreCreationFileImport): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScoreCreationFileImport`") + else: + match += 1 + # validate data type: ScoreCreationGoogleDriveImport + if not isinstance(v, ScoreCreationGoogleDriveImport): + error_messages.append(f"Error! Input type `{type(v)}` is not `ScoreCreationGoogleDriveImport`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. Details: " + ", ".join(error_messages)) + else: + return v @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ScoreCreation from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of builder_data - if self.builder_data: - _dict['builderData'] = self.builder_data.to_dict() - # override the default output from pydantic by calling `to_dict()` of source - if self.source: - _dict['source'] = self.source.to_dict() - return _dict + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScoreCreation from a dict""" - if obj is None: + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # deserialize data into ScoreCreationBuilderData + try: + instance.actual_instance = ScoreCreationBuilderData.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScoreCreationFileImport + try: + instance.actual_instance = ScoreCreationFileImport.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into ScoreCreationGoogleDriveImport + try: + instance.actual_instance = ScoreCreationGoogleDriveImport.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 ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into ScoreCreation with oneOf schemas: ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport. 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" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], ScoreCreationBuilderData, ScoreCreationFileImport, ScoreCreationGoogleDriveImport]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: return None - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "title": obj.get("title"), - "privacy": obj.get("privacy"), - "collection": obj.get("collection"), - "googleDriveFolder": obj.get("googleDriveFolder"), - "builderData": ScoreCreationBuilderData.from_dict(obj["builderData"]) if obj.get("builderData") is not None else None, - "filename": obj.get("filename"), - "data": obj.get("data"), - "dataEncoding": obj.get("dataEncoding"), - "source": ScoreSource.from_dict(obj["source"]) if obj.get("source") is not None else None - }) - return _obj + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) diff --git a/flat_api/models/score_creation_builder_data.py b/flat_api/models/score_creation_builder_data.py index 51f3dcc..da6c6a5 100644 --- a/flat_api/models/score_creation_builder_data.py +++ b/flat_api/models/score_creation_builder_data.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,26 +18,32 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from flat_api.models.score_creation_builder_data_layout_data import ScoreCreationBuilderDataLayoutData -from flat_api.models.score_creation_builder_data_score_data import ScoreCreationBuilderDataScoreData +from flat_api.models.score_creation_builder_data_all_of_builder_data import ScoreCreationBuilderDataAllOfBuilderData +from flat_api.models.score_privacy import ScorePrivacy from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreCreationBuilderData(BaseModel): """ ScoreCreationBuilderData """ # noqa: E501 - score_data: ScoreCreationBuilderDataScoreData = Field(alias="scoreData") - layout_data: Optional[ScoreCreationBuilderDataLayoutData] = Field(default=None, alias="layoutData") - __properties: ClassVar[List[str]] = ["scoreData", "layoutData"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + builder_data: ScoreCreationBuilderDataAllOfBuilderData = Field(alias="builderData") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder", "builderData"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -46,8 +52,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -63,8 +68,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -72,12 +79,14 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # override the default output from pydantic by calling `to_dict()` of score_data - if self.score_data: - _dict['scoreData'] = self.score_data.to_dict() - # override the default output from pydantic by calling `to_dict()` of layout_data - if self.layout_data: - _dict['layoutData'] = self.layout_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of builder_data + if self.builder_data: + _dict['builderData'] = self.builder_data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,9 +99,17 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "scoreData": ScoreCreationBuilderDataScoreData.from_dict(obj["scoreData"]) if obj.get("scoreData") is not None else None, - "layoutData": ScoreCreationBuilderDataLayoutData.from_dict(obj["layoutData"]) if obj.get("layoutData") is not None else None + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder"), + "builderData": ScoreCreationBuilderDataAllOfBuilderData.from_dict(obj["builderData"]) if obj.get("builderData") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_creation_builder_data_all_of_builder_data.py b/flat_api/models/score_creation_builder_data_all_of_builder_data.py new file mode 100644 index 0000000..972e1d9 --- /dev/null +++ b/flat_api/models/score_creation_builder_data_all_of_builder_data.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.score_creation_builder_data_all_of_builder_data_layout_data import ScoreCreationBuilderDataAllOfBuilderDataLayoutData +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data import ScoreCreationBuilderDataAllOfBuilderDataScoreData +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationBuilderDataAllOfBuilderData(BaseModel): + """ + ScoreCreationBuilderDataAllOfBuilderData + """ # noqa: E501 + score_data: ScoreCreationBuilderDataAllOfBuilderDataScoreData = Field(alias="scoreData") + layout_data: Optional[ScoreCreationBuilderDataAllOfBuilderDataLayoutData] = Field(default=None, alias="layoutData") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["scoreData", "layoutData"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of score_data + if self.score_data: + _dict['scoreData'] = self.score_data.to_dict() + # override the default output from pydantic by calling `to_dict()` of layout_data + if self.layout_data: + _dict['layoutData'] = self.layout_data.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "scoreData": ScoreCreationBuilderDataAllOfBuilderDataScoreData.from_dict(obj["scoreData"]) if obj.get("scoreData") is not None else None, + "layoutData": ScoreCreationBuilderDataAllOfBuilderDataLayoutData.from_dict(obj["layoutData"]) if obj.get("layoutData") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.py b/flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.py new file mode 100644 index 0000000..8c1a30e --- /dev/null +++ b/flat_api/models/score_creation_builder_data_all_of_builder_data_layout_data.py @@ -0,0 +1,126 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationBuilderDataAllOfBuilderDataLayoutData(BaseModel): + """ + Control the appearance of the score. If missing, default values are used. + """ # noqa: E501 + notes_spacing_coeff: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="A float value >= 1 that controls the spacing between notes.", alias="notesSpacingCoeff") + length_unit: Optional[StrictStr] = Field(default='cm', description="The unit to use for layout customizations", alias="lengthUnit") + page_height: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The height of the page in chosen unit (`lengthUnit`).", alias="pageHeight") + page_width: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The width of the page in chosen unit (`lengthUnit`).", alias="pageWidth") + page_margin_top: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The top margin of the page in chosen unit (`lengthUnit`).", alias="pageMarginTop") + page_margin_bottom: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The bottom margin of the page in chosen unit (`lengthUnit`).", alias="pageMarginBottom") + page_margin_left: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The left margin of the page in chosen unit (`lengthUnit`).", alias="pageMarginLeft") + page_margin_right: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The right margin of the page in chosen unit (`lengthUnit`).", alias="pageMarginRight") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["notesSpacingCoeff", "lengthUnit", "pageHeight", "pageWidth", "pageMarginTop", "pageMarginBottom", "pageMarginLeft", "pageMarginRight"] + + @field_validator('length_unit') + def length_unit_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['cm', 'inch']): + raise ValueError("must be one of enum values ('cm', 'inch')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataLayoutData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "notesSpacingCoeff": obj.get("notesSpacingCoeff"), + "lengthUnit": obj.get("lengthUnit") if obj.get("lengthUnit") is not None else 'cm', + "pageHeight": obj.get("pageHeight"), + "pageWidth": obj.get("pageWidth"), + "pageMarginTop": obj.get("pageMarginTop"), + "pageMarginBottom": obj.get("pageMarginBottom"), + "pageMarginLeft": obj.get("pageMarginLeft"), + "pageMarginRight": obj.get("pageMarginRight") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.py b/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.py new file mode 100644 index 0000000..5213b3f --- /dev/null +++ b/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data.py @@ -0,0 +1,120 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from flat_api.models.score_creation_builder_data_all_of_builder_data_score_data_instruments import ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationBuilderDataAllOfBuilderDataScoreData(BaseModel): + """ + ScoreCreationBuilderDataAllOfBuilderDataScoreData + """ # noqa: E501 + use_tab_staff: Optional[StrictBool] = Field(default=None, description="true if the TAB staff is displayed with fretted instruments", alias="useTabStaff") + use_chord_grid: Optional[StrictBool] = Field(default=None, description="true if the chord grid must be displayed with fretted instruments", alias="useChordGrid") + fifths: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The key signature of the score (expressed between -7 and 7). Major C is used when the value is not provided.") + nb_beats: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of beats in the measure", alias="nbBeats") + beat_type: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The duration of a beat in the measure", alias="beatType") + instruments: List[ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments] = Field(description="The list of instruments to add to the score. See the [Instrument IDs reference](https://flat.io/developers/docs/api/instruments) for the possible values for `group` and `instrument` (also available as the [`@flat/instruments`](https://www.npmjs.com/package/@flat/instruments) package). ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["useTabStaff", "useChordGrid", "fifths", "nbBeats", "beatType", "instruments"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in instruments (list) + _items = [] + if self.instruments: + for _item_instruments in self.instruments: + if _item_instruments: + _items.append(_item_instruments.to_dict()) + _dict['instruments'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "useTabStaff": obj.get("useTabStaff"), + "useChordGrid": obj.get("useChordGrid"), + "fifths": obj.get("fifths"), + "nbBeats": obj.get("nbBeats"), + "beatType": obj.get("beatType"), + "instruments": [ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py b/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py new file mode 100644 index 0000000..f60153a --- /dev/null +++ b/flat_api/models/score_creation_builder_data_all_of_builder_data_score_data_instruments.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments(BaseModel): + """ + ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments + """ # noqa: E501 + group: StrictStr = Field(description="The of the instrument group (e.g. `keyboards`, `brass`)") + instrument: StrictStr = Field(description="The identifier of the instrument (e.g. `piano`, `trumpet`)") + long_name: Optional[StrictStr] = Field(default=None, description="The full name of the instrument", alias="longName") + short_name: Optional[StrictStr] = Field(default=None, description="The abbreviation of the name of the instrument", alias="shortName") + has_quarter_tone: Optional[StrictBool] = Field(default=None, description="True if the part can use quarter tone (prevent the part to have a TAB/chord grid)", alias="hasQuarterTone") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["group", "instrument", "longName", "shortName", "hasQuarterTone"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationBuilderDataAllOfBuilderDataScoreDataInstruments from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "group": obj.get("group"), + "instrument": obj.get("instrument"), + "longName": obj.get("longName"), + "shortName": obj.get("shortName"), + "hasQuarterTone": obj.get("hasQuarterTone") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_builder_data_score_data.py b/flat_api/models/score_creation_builder_data_score_data.py deleted file mode 100644 index 94423f3..0000000 --- a/flat_api/models/score_creation_builder_data_score_data.py +++ /dev/null @@ -1,106 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Optional, Union -from flat_api.models.score_creation_builder_data_score_data_instruments_inner import ScoreCreationBuilderDataScoreDataInstrumentsInner -from typing import Optional, Set -from typing_extensions import Self - -class ScoreCreationBuilderDataScoreData(BaseModel): - """ - ScoreCreationBuilderDataScoreData - """ # noqa: E501 - use_tab_staff: Optional[StrictBool] = Field(default=None, description="true if the TAB staff is displayed with fretted instruments", alias="useTabStaff") - use_chord_grid: Optional[StrictBool] = Field(default=None, description="true if the chord grid must be displayed with fretted instruments", alias="useChordGrid") - fifths: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The key signature of the score (expressed between -7 and 7). Major C is used when the value is not provided.") - nb_beats: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of beats in the measure", alias="nbBeats") - beat_type: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The duration of a beat in the measure", alias="beatType") - instruments: List[ScoreCreationBuilderDataScoreDataInstrumentsInner] = Field(description="The list of instruments to add to the score. See https://prod.flat-cdn.com/fixtures/instruments_en.json for the possible values for `group` and `instrument`. ") - __properties: ClassVar[List[str]] = ["useTabStaff", "useChordGrid", "fifths", "nbBeats", "beatType", "instruments"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of ScoreCreationBuilderDataScoreData from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - # override the default output from pydantic by calling `to_dict()` of each item in instruments (list) - _items = [] - if self.instruments: - for _item in self.instruments: - if _item: - _items.append(_item.to_dict()) - _dict['instruments'] = _items - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of ScoreCreationBuilderDataScoreData from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "useTabStaff": obj.get("useTabStaff"), - "useChordGrid": obj.get("useChordGrid"), - "fifths": obj.get("fifths"), - "nbBeats": obj.get("nbBeats"), - "beatType": obj.get("beatType"), - "instruments": [ScoreCreationBuilderDataScoreDataInstrumentsInner.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None - }) - return _obj - - diff --git a/flat_api/models/score_creation_common.py b/flat_api/models/score_creation_common.py new file mode 100644 index 0000000..9b79f84 --- /dev/null +++ b/flat_api/models/score_creation_common.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.score_privacy import ScorePrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationCommon(BaseModel): + """ + ScoreCreationCommon + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationCommon from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationCommon from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_file_import.py b/flat_api/models/score_creation_file_import.py new file mode 100644 index 0000000..7051ff9 --- /dev/null +++ b/flat_api/models/score_creation_file_import.py @@ -0,0 +1,127 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.score_privacy import ScorePrivacy +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationFileImport(BaseModel): + """ + ScoreCreationFileImport + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + filename: Optional[StrictStr] = Field(default=None, description="If this is an imported file, its filename") + data: StrictStr = Field(description="The data of the score file. See the `POST /scores` endpoint description for the full list of supported formats. Binary payloads (e.g. compressed MusicXML, MIDI, Guitar Pro) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. ") + data_encoding: Optional[StrictStr] = Field(default=None, description="The optional encoding of the score data. This property must match the encoding used for the `data` property.", alias="dataEncoding") + supports_tasks: Optional[StrictBool] = Field(default=None, description="Set this to `true` if the client supports asynchronous task flows. When importing a score that requires OMR processing (a PDF or a page image), the API will return a 202 Accepted response along with a task reference. The client can then check the task status using the endpoint `GET /v2/tasks/{task}`. ", alias="supportsTasks") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder", "filename", "data", "dataEncoding", "supportsTasks"] + + @field_validator('data_encoding') + def data_encoding_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['base64']): + raise ValueError("must be one of enum values ('base64')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationFileImport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationFileImport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder"), + "filename": obj.get("filename"), + "data": obj.get("data"), + "dataEncoding": obj.get("dataEncoding"), + "supportsTasks": obj.get("supportsTasks") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_google_drive_import.py b/flat_api/models/score_creation_google_drive_import.py new file mode 100644 index 0000000..0a340de --- /dev/null +++ b/flat_api/models/score_creation_google_drive_import.py @@ -0,0 +1,115 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.score_privacy import ScorePrivacy +from flat_api.models.score_source import ScoreSource +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreCreationGoogleDriveImport(BaseModel): + """ + ScoreCreationGoogleDriveImport + """ # noqa: E501 + title: Optional[StrictStr] = Field(default=None, description="The title of the new score. If the title is too long, the API may trim this one. If this title is not specified, the API will try to (in this order): - Use the title contained in the file (e.g. [`movement-title`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-movement-title.htm) or [`credit-words`](https://usermanuals.musicxml.com/MusicXML/Content/EL-MusicXML-credit-words.htm) for [MusicXML](http://www.musicxml.com/) files). - Use the name of the file for files from a specified `source` (e.g. Google Drive) or the one in the `filename` property - Set a default title (e.g. \"New Music Score\") ") + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be created. If no collection identifier is provided, the score will not be added to any collection and will only be visible in the `allScores` virtual collection. ") + google_drive_folder: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and this properties is specified, the file will be created in this directory. The currently user creating the file must be granted to write in this directory. ", alias="googleDriveFolder") + source: ScoreSource + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "privacy", "collection", "googleDriveFolder", "source"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreCreationGoogleDriveImport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of source + if self.source: + _dict['source'] = self.source.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreCreationGoogleDriveImport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "collection": obj.get("collection"), + "googleDriveFolder": obj.get("googleDriveFolder"), + "source": ScoreSource.from_dict(obj["source"]) if obj.get("source") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_creation_type.py b/flat_api/models/score_creation_type.py index f512b5a..27d1340 100644 --- a/flat_api/models/score_creation_type.py +++ b/flat_api/models/score_creation_type.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -30,7 +30,6 @@ class ScoreCreationType(str, Enum): ORIGINAL = 'original' ARRANGEMENT = 'arrangement' OTHER = 'other' - NULL = 'null' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flat_api/models/score_details.py b/flat_api/models/score_details.py index 97e7882..ecf80a9 100644 --- a/flat_api/models/score_details.py +++ b/flat_api/models/score_details.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,13 +19,14 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union from typing_extensions import Annotated from flat_api.models.resource_collaborator import ResourceCollaborator from flat_api.models.resource_rights import ResourceRights from flat_api.models.score_comments_counts import ScoreCommentsCounts from flat_api.models.score_creation_type import ScoreCreationType +from flat_api.models.score_details_all_of_me import ScoreDetailsAllOfMe from flat_api.models.score_license import ScoreLicense from flat_api.models.score_likes_counts import ScoreLikesCounts from flat_api.models.score_plays_counts import ScorePlaysCounts @@ -34,10 +35,11 @@ from flat_api.models.user_public import UserPublic from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreDetails(BaseModel): """ - ScoreDetails + The score and all its details """ # noqa: E501 id: StrictStr = Field(description="The unique identifier of the score") sharing_key: Optional[StrictStr] = Field(default=None, description="The private sharing key of the score (available when the `privacy` mode is set to `privateLink`)", alias="sharingKey") @@ -45,6 +47,7 @@ class ScoreDetails(BaseModel): privacy: ScorePrivacy user: UserPublic html_url: StrictStr = Field(description="The url where the score can be viewed in a web browser", alias="htmlUrl") + edit_html_url: StrictStr = Field(description="The url where the score can be edited in a web browser", alias="editHtmlUrl") subtitle: Optional[StrictStr] = Field(default=None, description="Subtitle of the score") lyricist: Optional[StrictStr] = Field(default=None, description="Lyricist of the score") arranger: Optional[StrictStr] = Field(default=None, description="Arranger of the score") @@ -59,28 +62,33 @@ class ScoreDetails(BaseModel): main_tempo_qpm: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The main tempo of the score (in QPM)", alias="mainTempoQpm") main_key_signature: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The main key signature of the score (expressed between -7 and 7).", alias="mainKeySignature") rights: Optional[ResourceRights] = None - collaborators: Optional[List[ResourceCollaborator]] = Field(default=None, description="The list of the collaborators of the score") - creation_date: Optional[datetime] = Field(default=None, description="The date when the score was created", alias="creationDate") + collaborators: List[ResourceCollaborator] = Field(description="The list of the collaborators of the score") + creation_date: datetime = Field(description="The date when the score was created", alias="creationDate") modification_date: Optional[datetime] = Field(default=None, description="The date of the last revision of the score", alias="modificationDate") publication_date: Optional[datetime] = Field(default=None, description="The date when the score was published on Flat", alias="publicationDate") + scheduled_deletion_date: Optional[datetime] = Field(default=None, description="The date when the score will be definitively deleted. This date can be in the past if the score will be deleted at the next deletion batch, in this case you can display something like \"Deleted shortly\". Schedule: * For all paying users, the scores will be definitively deleted after 90 days. * For free users, the scores are no longer available after 24 hours, an can be restored with a paying account up to 90 days. ", alias="scheduledDeletionDate") highlighted_date: Optional[datetime] = Field(default=None, description="The date when the score was highlighted (featured) on our community", alias="highlightedDate") organization: Optional[StrictStr] = Field(default=None, description="If the score has been created in an organization, the identifier of this organization. This property is especially used with the score privacy `organizationPublic`. ") parent_score: Optional[StrictStr] = Field(default=None, description="If the score has been forked, the unique identifier of the parent score. ", alias="parentScore") - instruments: Optional[List[StrictStr]] = Field(default=None, description="An array of the instrument identifiers used in the last version of the score. This is mainly used to display a list of the instruments in the Flat's UI or instruments icons. The format of the strings is `{instrument-group}.{instrument-id}`. ") - samples: Optional[List[StrictStr]] = Field(default=None, description="An array of the audio samples identifiers used the different score parts. The format of the strings is `{instrument-group}.{sample-id}`. ") + instruments: List[StrictStr] = Field(description="An array of the instrument identifiers used in the last version of the score. This is mainly used to display a list of the instruments in the Flat's UI or instruments icons. The format of the strings is `{instrument-group}.{instrument-id}`. ") + instruments_names: List[StrictStr] = Field(description="An array of the instrument names used in the last version of the score. This list is localized and ready-to-display and will match the indexes from the `instruments` list. ", alias="instrumentsNames") + samples: List[StrictStr] = Field(description="An array of the audio samples identifiers used the different score parts. The format of the strings is `{instrument-group}.{sample-id}`. ") google_drive_file_id: Optional[StrictStr] = Field(default=None, description="If the user uses Google Drive and the score exists on Google Drive, this field will contain the unique identifier of the Flat score on Google Drive. You can access the document using the url: `https://drive.google.com/open?id={googleDriveFileId}` ", alias="googleDriveFileId") likes: Optional[ScoreLikesCounts] = None comments: Optional[ScoreCommentsCounts] = None views: Optional[ScoreViewsCounts] = None plays: Optional[ScorePlaysCounts] = None collections: Optional[List[StrictStr]] = Field(default=None, description="The List of parent collections, which includes all the collections this score is included. Please note that you might not have access to all of them.") - __properties: ClassVar[List[str]] = ["id", "sharingKey", "title", "privacy", "user", "htmlUrl", "subtitle", "lyricist", "arranger", "composer", "description", "tags", "creationType", "license", "licenseText", "durationTime", "numberMeasures", "mainTempoQpm", "mainKeySignature", "rights", "collaborators", "creationDate", "modificationDate", "publicationDate", "highlightedDate", "organization", "parentScore", "instruments", "samples", "googleDriveFileId", "likes", "comments", "views", "plays", "collections"] + me: Optional[ScoreDetailsAllOfMe] = None + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "sharingKey", "title", "privacy", "user", "htmlUrl", "editHtmlUrl", "subtitle", "lyricist", "arranger", "composer", "description", "tags", "creationType", "license", "licenseText", "durationTime", "numberMeasures", "mainTempoQpm", "mainKeySignature", "rights", "collaborators", "creationDate", "modificationDate", "publicationDate", "scheduledDeletionDate", "highlightedDate", "organization", "parentScore", "instruments", "instrumentsNames", "samples", "googleDriveFileId", "likes", "comments", "views", "plays", "collections", "me"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -89,8 +97,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -106,8 +113,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -124,9 +133,9 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in collaborators (list) _items = [] if self.collaborators: - for _item in self.collaborators: - if _item: - _items.append(_item.to_dict()) + for _item_collaborators in self.collaborators: + if _item_collaborators: + _items.append(_item_collaborators.to_dict()) _dict['collaborators'] = _items # override the default output from pydantic by calling `to_dict()` of likes if self.likes: @@ -140,6 +149,14 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of plays if self.plays: _dict['plays'] = self.plays.to_dict() + # override the default output from pydantic by calling `to_dict()` of me + if self.me: + _dict['me'] = self.me.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if creation_type (nullable) is None # and model_fields_set contains the field if self.creation_type is None and "creation_type" in self.model_fields_set: @@ -165,9 +182,10 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "id": obj.get("id"), "sharingKey": obj.get("sharingKey"), "title": obj.get("title"), - "privacy": obj.get("privacy"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, "user": UserPublic.from_dict(obj["user"]) if obj.get("user") is not None else None, "htmlUrl": obj.get("htmlUrl"), + "editHtmlUrl": obj.get("editHtmlUrl"), "subtitle": obj.get("subtitle"), "lyricist": obj.get("lyricist"), "arranger": obj.get("arranger"), @@ -186,18 +204,26 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "creationDate": obj.get("creationDate"), "modificationDate": obj.get("modificationDate"), "publicationDate": obj.get("publicationDate"), + "scheduledDeletionDate": obj.get("scheduledDeletionDate"), "highlightedDate": obj.get("highlightedDate"), "organization": obj.get("organization"), "parentScore": obj.get("parentScore"), "instruments": obj.get("instruments"), + "instrumentsNames": obj.get("instrumentsNames"), "samples": obj.get("samples"), "googleDriveFileId": obj.get("googleDriveFileId"), "likes": ScoreLikesCounts.from_dict(obj["likes"]) if obj.get("likes") is not None else None, "comments": ScoreCommentsCounts.from_dict(obj["comments"]) if obj.get("comments") is not None else None, "views": ScoreViewsCounts.from_dict(obj["views"]) if obj.get("views") is not None else None, "plays": ScorePlaysCounts.from_dict(obj["plays"]) if obj.get("plays") is not None else None, - "collections": obj.get("collections") + "collections": obj.get("collections"), + "me": ScoreDetailsAllOfMe.from_dict(obj["me"]) if obj.get("me") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_details_all_of_me.py b/flat_api/models/score_details_all_of_me.py new file mode 100644 index 0000000..8899e4c --- /dev/null +++ b/flat_api/models/score_details_all_of_me.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreDetailsAllOfMe(BaseModel): + """ + Information about the authenticated user and this score + """ # noqa: E501 + is_liked: StrictBool = Field(description="True if the current user likes this score", alias="isLiked") + is_in_library: StrictBool = Field(description="True if the score is stored in one of the user's collections", alias="isInLibrary") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["isLiked", "isInLibrary"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreDetailsAllOfMe from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreDetailsAllOfMe from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "isLiked": obj.get("isLiked"), + "isInLibrary": obj.get("isInLibrary") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_fork.py b/flat_api/models/score_fork.py index ebb3ecb..1ef11e3 100644 --- a/flat_api/models/score_fork.py +++ b/flat_api/models/score_fork.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,25 +18,28 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreFork(BaseModel): """ Options to fork the score """ # noqa: E501 - collection: Optional[StrictStr] = Field(default='root', description="Unique identifier of a collection where the score will be copied. If no collection identifier is provided, the score will be stored in the `root` directory. If null is provided, the score won't be added to any collections ") + collection: Optional[StrictStr] = Field(default=None, description="Unique identifier of a collection where the score will be copied. If no collection identifier is provided, a virtual collection is used, or `null` is provided, the score won't be added to any collection and will only be visible in the `allScores` virtual collection. ") google_drive_disabled: Optional[StrictBool] = Field(default=False, description="If set to `true`, the API won't create the score on Google Drive ", alias="googleDriveDisabled") keep_original_title: Optional[StrictBool] = Field(default=None, description="Option to keep the original title of the score (i.e. don't prepend it with \"Copy of \", or add the student name in assignment usage). ", alias="keepOriginalTitle") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["collection", "googleDriveDisabled", "keepOriginalTitle"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if collection (nullable) is None # and model_fields_set contains the field if self.collection is None and "collection" in self.model_fields_set: @@ -88,10 +97,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "collection": obj.get("collection") if obj.get("collection") is not None else 'root', + "collection": obj.get("collection"), "googleDriveDisabled": obj.get("googleDriveDisabled") if obj.get("googleDriveDisabled") is not None else False, "keepOriginalTitle": obj.get("keepOriginalTitle") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_license.py b/flat_api/models/score_license.py index 03cb73c..3295c4b 100644 --- a/flat_api/models/score_license.py +++ b/flat_api/models/score_license.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -35,7 +35,6 @@ class ScoreLicense(str, Enum): CC_MINUS_BY_MINUS_NC = 'cc-by-nc' CC_MINUS_BY_MINUS_NC_MINUS_SA = 'cc-by-nc-sa' CC_MINUS_BY_MINUS_NC_MINUS_ND = 'cc-by-nc-nd' - NULL = 'null' @classmethod def from_json(cls, json_str: str) -> Self: diff --git a/flat_api/models/score_likes_counts.py b/flat_api/models/score_likes_counts.py index b002e3a..37d2d3a 100644 --- a/flat_api/models/score_likes_counts.py +++ b/flat_api/models/score_likes_counts.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,25 +18,29 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt -from typing import Any, ClassVar, Dict, List, Union +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreLikesCounts(BaseModel): """ - A computed version of the weekly, monthly and total of number of likes for a score + A computed version of the weekly, monthly, yearly and total number of likes for a score """ # noqa: E501 - total: Union[StrictFloat, StrictInt] = Field(description="The total number of likes of the score") - weekly: Union[StrictFloat, StrictInt] = Field(description="The number of new likes during the last week") - monthly: Union[StrictFloat, StrictInt] = Field(description="The number of new likes during the last month") - __properties: ClassVar[List[str]] = ["total", "weekly", "monthly"] + total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of likes of the score") + weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of new likes during the last week") + monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of new likes during the last month") + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of new likes during the last year") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "weekly", "monthly", "yearly"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,10 +93,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ - "total": obj.get("total") if obj.get("total") is not None else 0, - "weekly": obj.get("weekly") if obj.get("weekly") is not None else 0, - "monthly": obj.get("monthly") if obj.get("monthly") is not None else 0 + "total": obj.get("total"), + "weekly": obj.get("weekly"), + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_modification.py b/flat_api/models/score_modification.py index 7e871ef..4316324 100644 --- a/flat_api/models/score_modification.py +++ b/flat_api/models/score_modification.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,7 +18,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flat_api.models.score_creation_type import ScoreCreationType @@ -26,6 +26,7 @@ from flat_api.models.score_privacy import ScorePrivacy from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreModification(BaseModel): """ @@ -36,30 +37,32 @@ class ScoreModification(BaseModel): composer: Optional[StrictStr] = Field(default=None, description="The composer of the score") lyricist: Optional[StrictStr] = Field(default=None, description="The lyricist of the score") arranger: Optional[StrictStr] = Field(default=None, description="The arranger of the score") - privacy: Optional[ScorePrivacy] = None + privacy: Optional[ScorePrivacy] = ScorePrivacy.PRIVATE sharing_key: Optional[Annotated[str, Field(strict=True)]] = Field(default=None, description="When using the `privacy` mode `privateLink`, this property can be used to set a custom sharing key, otherwise a new key will be generated.", alias="sharingKey") description: Optional[Annotated[str, Field(strict=True, max_length=2000)]] = Field(default=None, description="Description of the creation") tags: Optional[List[StrictStr]] = Field(default=None, description="Tags describing the score") creation_type: Optional[ScoreCreationType] = Field(default=None, alias="creationType") license: Optional[ScoreLicense] = None license_text: Optional[StrictStr] = Field(default=None, description="The rights info written on the score", alias="licenseText") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "subtitle", "composer", "lyricist", "arranger", "privacy", "sharingKey", "description", "tags", "creationType", "license", "licenseText"] - @field_validator('sharing_key') + @field_validator('sharing_key', mode="before") def sharing_key_validate_regular_expression(cls, value): """Validates the regular expression""" if value is None: return value - if not re.match(r"^[a-f0-9]{128}$", value): + if isinstance(value, str) and not re.match(r"^[a-f0-9]{128}$", value): raise ValueError(r"must validate the regular expression /^[a-f0-9]{128}$/") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -68,8 +71,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -85,8 +87,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -94,6 +98,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if subtitle (nullable) is None # and model_fields_set contains the field if self.subtitle is None and "subtitle" in self.model_fields_set: @@ -151,7 +160,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "composer": obj.get("composer"), "lyricist": obj.get("lyricist"), "arranger": obj.get("arranger"), - "privacy": obj.get("privacy"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, "sharingKey": obj.get("sharingKey"), "description": obj.get("description"), "tags": obj.get("tags"), @@ -159,6 +168,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "license": obj.get("license"), "licenseText": obj.get("licenseText") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_plays_counts.py b/flat_api/models/score_plays_counts.py index d9280b9..9ddca5e 100644 --- a/flat_api/models/score_plays_counts.py +++ b/flat_api/models/score_plays_counts.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,25 +18,29 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScorePlaysCounts(BaseModel): """ - A computed version of the total, weekly, and monthly number of plays of the score + A computed version of the total, weekly, monthly, and yearly number of plays of the score """ # noqa: E501 total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of plays of the score") weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The weekly number of plays of the score") monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The monthly number of plays of the score") - __properties: ClassVar[List[str]] = ["total", "weekly", "monthly"] + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The yearly number of plays of the score") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "weekly", "monthly", "yearly"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,8 +95,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "total": obj.get("total"), "weekly": obj.get("weekly"), - "monthly": obj.get("monthly") + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_privacy.py b/flat_api/models/score_privacy.py index d93f865..83b6f76 100644 --- a/flat_api/models/score_privacy.py +++ b/flat_api/models/score_privacy.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/score_revision.py b/flat_api/models/score_revision.py index cfbec2b..7502b34 100644 --- a/flat_api/models/score_revision.py +++ b/flat_api/models/score_revision.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,31 +19,35 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.score_revision_statistics import ScoreRevisionStatistics from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreRevision(BaseModel): """ A score revision metadata """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the revision.") + id: StrictStr = Field(description="The unique identifier of the revision.") user: Optional[StrictStr] = Field(default=None, description="The user identifier who created the revision") + score: StrictStr = Field(description="The score identifier") collaborators: Optional[List[StrictStr]] = None - creation_date: Optional[datetime] = Field(default=None, description="The date when this revision was created", alias="creationDate") + var_date: datetime = Field(description="The date when this revision was created", alias="date") event: Optional[StrictStr] = Field(default=None, description="The last event (action id) of the revision") description: Optional[StrictStr] = Field(default=None, description="A description associated to the revision") autosave: Optional[StrictBool] = Field(default=None, description="True if this revision was automatically generated by Flat and not on purpose by the user. ") statistics: Optional[ScoreRevisionStatistics] = None - __properties: ClassVar[List[str]] = ["id", "user", "collaborators", "creationDate", "event", "description", "autosave", "statistics"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "user", "score", "collaborators", "date", "event", "description", "autosave", "statistics"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -52,8 +56,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,8 +72,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -81,6 +86,11 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of statistics if self.statistics: _dict['statistics'] = self.statistics.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -95,13 +105,19 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "user": obj.get("user"), + "score": obj.get("score"), "collaborators": obj.get("collaborators"), - "creationDate": obj.get("creationDate"), + "date": obj.get("date"), "event": obj.get("event"), "description": obj.get("description"), "autosave": obj.get("autosave"), "statistics": ScoreRevisionStatistics.from_dict(obj["statistics"]) if obj.get("statistics") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_revision_creation.py b/flat_api/models/score_revision_creation.py index 3e70df1..7fecfd3 100644 --- a/flat_api/models/score_revision_creation.py +++ b/flat_api/models/score_revision_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,19 +18,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreRevisionCreation(BaseModel): """ A new created revision """ # noqa: E501 - data: StrictStr = Field(description="The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file. Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. ") + data: StrictStr = Field(description="The data of the score file. It must be a MusicXML 3 file (`vnd.recordare.musicxml` or `vnd.recordare.musicxml+xml`), a MIDI file (`audio/midi`) or a Flat.json (aka Adagio.json) file. Binary payloads (`vnd.recordare.musicxml` and `audio/midi`) can be encoded in Base64, in this case the `dataEncoding` property must match the encoding used for the API request. ", json_schema_extra={"examples": [""]}) data_encoding: Optional[StrictStr] = Field(default=None, description="The optional encoding of the score data. This property must match the encoding used for the `data` property.", alias="dataEncoding") autosave: Optional[StrictBool] = Field(default=None, description="Must be set to `true` if the revision was created automatically. ") description: Optional[StrictStr] = Field(default=None, description="A description associated to the revision") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["data", "dataEncoding", "autosave", "description"] @field_validator('data_encoding') @@ -43,11 +45,12 @@ def data_encoding_validate_enum(cls, value): raise ValueError("must be one of enum values ('base64')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -56,8 +59,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -73,8 +75,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -82,6 +86,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -99,6 +108,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "autosave": obj.get("autosave"), "description": obj.get("description") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_revision_statistics.py b/flat_api/models/score_revision_statistics.py index fff610e..88a907e 100644 --- a/flat_api/models/score_revision_statistics.py +++ b/flat_api/models/score_revision_statistics.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,10 +19,11 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreRevisionStatistics(BaseModel): """ @@ -32,13 +33,15 @@ class ScoreRevisionStatistics(BaseModel): deletions: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The number of deletions operations in the last revision") start_date: Optional[datetime] = Field(default=None, description="The date of the first action included in this revision", alias="startDate") end_date: Optional[datetime] = Field(default=None, description="The date of the latest action included in this revision", alias="endDate") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["additions", "deletions", "startDate", "endDate"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -47,8 +50,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -64,8 +66,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -73,6 +77,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -90,6 +99,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "startDate": obj.get("startDate"), "endDate": obj.get("endDate") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_source.py b/flat_api/models/score_source.py index 453ea64..d119658 100644 --- a/flat_api/models/score_source.py +++ b/flat_api/models/score_source.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreSource(BaseModel): """ ScoreSource """ # noqa: E501 google_drive: Optional[StrictStr] = Field(default=None, description="If the score is a file on Google Drive, this field property must contain its identifier. To use this method, the Drive file must be public or the Flat Drive App must have access to the file. ", alias="googleDrive") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["googleDrive"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "googleDrive": obj.get("googleDrive") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_summary.py b/flat_api/models/score_summary.py new file mode 100644 index 0000000..fd72d47 --- /dev/null +++ b/flat_api/models/score_summary.py @@ -0,0 +1,117 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.score_privacy import ScorePrivacy +from flat_api.models.user_public import UserPublic +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreSummary(BaseModel): + """ + A summary of the score details + """ # noqa: E501 + id: StrictStr = Field(description="The unique identifier of the score") + sharing_key: Optional[StrictStr] = Field(default=None, description="The private sharing key of the score (available when the `privacy` mode is set to `privateLink`)", alias="sharingKey") + title: StrictStr = Field(description="The title of the score") + privacy: ScorePrivacy + user: UserPublic + html_url: StrictStr = Field(description="The url where the score can be viewed in a web browser", alias="htmlUrl") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "sharingKey", "title", "privacy", "user", "htmlUrl"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreSummary from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of user + if self.user: + _dict['user'] = self.user.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreSummary from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "sharingKey": obj.get("sharingKey"), + "title": obj.get("title"), + "privacy": obj.get("privacy") if obj.get("privacy") is not None else ScorePrivacy.PRIVATE, + "user": UserPublic.from_dict(obj["user"]) if obj.get("user") is not None else None, + "htmlUrl": obj.get("htmlUrl") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_track.py b/flat_api/models/score_track.py index cac6d06..408e4a1 100644 --- a/flat_api/models/score_track.py +++ b/flat_api/models/score_track.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.score_track_point import ScoreTrackPoint from flat_api.models.score_track_purpose import ScoreTrackPurpose @@ -27,6 +27,7 @@ from flat_api.models.score_track_type import ScoreTrackType from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreTrack(BaseModel): """ @@ -34,7 +35,7 @@ class ScoreTrack(BaseModel): """ # noqa: E501 id: StrictStr = Field(description="The unique identifier of the score track") title: Optional[StrictStr] = Field(default=None, description="Title of the track") - score: StrictStr = Field(description="The unique identifier of the score") + score: Optional[StrictStr] = Field(default=None, description="The unique identifier of the score. Absent for Free Record performance submissions, which are recorded without an attached score. ") creator: StrictStr = Field(description="The unique identifier of the track creator") creation_date: datetime = Field(description="The creation date of the track", alias="creationDate") modification_date: datetime = Field(description="The modification date of the track", alias="modificationDate") @@ -45,13 +46,15 @@ class ScoreTrack(BaseModel): url: Optional[StrictStr] = Field(default=None, description="The URL of the track") media_id: Optional[StrictStr] = Field(default=None, description="The unique identifier of the track when hosted on an external service. For example, if the url is `https://www.youtube.com/watch?v=dQw4w9WgXcQ`, `mediaId` will be `dQw4w9WgXcQ` ", alias="mediaId") synchronization_points: Optional[List[ScoreTrackPoint]] = Field(default=None, alias="synchronizationPoints") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "title", "score", "creator", "creationDate", "modificationDate", "default", "state", "type", "purpose", "url", "mediaId", "synchronizationPoints"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,8 +63,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -89,10 +93,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in synchronization_points (list) _items = [] if self.synchronization_points: - for _item in self.synchronization_points: - if _item: - _items.append(_item.to_dict()) + for _item_synchronization_points in self.synchronization_points: + if _item_synchronization_points: + _items.append(_item_synchronization_points.to_dict()) _dict['synchronizationPoints'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -112,13 +121,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "creationDate": obj.get("creationDate"), "modificationDate": obj.get("modificationDate"), "default": obj.get("default"), - "state": obj.get("state"), + "state": obj.get("state") if obj.get("state") is not None else ScoreTrackState.DRAFT, "type": obj.get("type"), - "purpose": obj.get("purpose"), + "purpose": obj.get("purpose") if obj.get("purpose") is not None else ScoreTrackPurpose.COMMON, "url": obj.get("url"), "mediaId": obj.get("mediaId"), "synchronizationPoints": [ScoreTrackPoint.from_dict(_item) for _item in obj["synchronizationPoints"]] if obj.get("synchronizationPoints") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_track_creation.py b/flat_api/models/score_track_creation.py index 59d6602..e19ac55 100644 --- a/flat_api/models/score_track_creation.py +++ b/flat_api/models/score_track_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,13 +18,14 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.score_track_point import ScoreTrackPoint from flat_api.models.score_track_purpose import ScoreTrackPurpose from flat_api.models.score_track_state import ScoreTrackState from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreTrackCreation(BaseModel): """ @@ -32,17 +33,19 @@ class ScoreTrackCreation(BaseModel): """ # noqa: E501 title: Optional[StrictStr] = Field(default=None, description="Title of the track") default: Optional[StrictBool] = Field(default=None, description="True if the track should be used as default audio source") - state: Optional[ScoreTrackState] = None - purpose: Optional[ScoreTrackPurpose] = None + state: Optional[ScoreTrackState] = ScoreTrackState.DRAFT + purpose: Optional[ScoreTrackPurpose] = ScoreTrackPurpose.COMMON url: Optional[StrictStr] = Field(default=None, description="The URL of the track") synchronization_points: Optional[List[ScoreTrackPoint]] = Field(default=None, alias="synchronizationPoints") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["title", "default", "state", "purpose", "url", "synchronizationPoints"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -51,8 +54,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -68,8 +70,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -80,10 +84,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in synchronization_points (list) _items = [] if self.synchronization_points: - for _item in self.synchronization_points: - if _item: - _items.append(_item.to_dict()) + for _item_synchronization_points in self.synchronization_points: + if _item_synchronization_points: + _items.append(_item_synchronization_points.to_dict()) _dict['synchronizationPoints'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -98,11 +107,16 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "title": obj.get("title"), "default": obj.get("default"), - "state": obj.get("state"), - "purpose": obj.get("purpose"), + "state": obj.get("state") if obj.get("state") is not None else ScoreTrackState.DRAFT, + "purpose": obj.get("purpose") if obj.get("purpose") is not None else ScoreTrackPurpose.COMMON, "url": obj.get("url"), "synchronizationPoints": [ScoreTrackPoint.from_dict(_item) for _item in obj["synchronizationPoints"]] if obj.get("synchronizationPoints") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_track_creation_response.py b/flat_api/models/score_track_creation_response.py new file mode 100644 index 0000000..0d8be58 --- /dev/null +++ b/flat_api/models/score_track_creation_response.py @@ -0,0 +1,106 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from flat_api.models.score_track import ScoreTrack +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class ScoreTrackCreationResponse(BaseModel): + """ + Response for track creation including optional upload information + """ # noqa: E501 + track: ScoreTrack + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["track"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ScoreTrackCreationResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of track + if self.track: + _dict['track'] = self.track.to_dict() + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ScoreTrackCreationResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "track": ScoreTrack.from_dict(obj["track"]) if obj.get("track") is not None else None + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/score_track_point.py b/flat_api/models/score_track_point.py index 0d876d4..d3f9ed9 100644 --- a/flat_api/models/score_track_point.py +++ b/flat_api/models/score_track_point.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,18 +18,21 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional, Union +from uuid import UUID from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreTrackPoint(BaseModel): """ A track synchronization point """ # noqa: E501 type: StrictStr = Field(description="The type of the synchronization point. If the type is `measure`, the measure uuid must be present in `measureUuid`") - measure_uuid: Optional[StrictStr] = Field(default=None, description="The measure unique identifier", alias="measureUuid") + measure_uuid: Optional[UUID] = Field(default=None, description="The measure unique identifier", alias="measureUuid") time: Union[StrictFloat, StrictInt] = Field(description="The corresponding time in seconds") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["type", "measureUuid", "time"] @field_validator('type') @@ -39,11 +42,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('measure', 'end')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -52,8 +56,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -69,8 +72,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -78,6 +83,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -94,6 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "measureUuid": obj.get("measureUuid"), "time": obj.get("time") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_track_purpose.py b/flat_api/models/score_track_purpose.py index 41e7153..cd5341e 100644 --- a/flat_api/models/score_track_purpose.py +++ b/flat_api/models/score_track_purpose.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/score_track_state.py b/flat_api/models/score_track_state.py index ce06a5b..e5d3200 100644 --- a/flat_api/models/score_track_state.py +++ b/flat_api/models/score_track_state.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/score_track_type.py b/flat_api/models/score_track_type.py index fbf4840..33e083d 100644 --- a/flat_api/models/score_track_type.py +++ b/flat_api/models/score_track_type.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) diff --git a/flat_api/models/score_track_update.py b/flat_api/models/score_track_update.py index 0e757ee..df35e21 100644 --- a/flat_api/models/score_track_update.py +++ b/flat_api/models/score_track_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,14 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.score_track_point import ScoreTrackPoint +from flat_api.models.score_track_purpose import ScoreTrackPurpose from flat_api.models.score_track_state import ScoreTrackState from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreTrackUpdate(BaseModel): """ @@ -31,15 +33,18 @@ class ScoreTrackUpdate(BaseModel): """ # noqa: E501 title: Optional[StrictStr] = Field(default=None, description="Title of the track") default: Optional[StrictBool] = Field(default=None, description="True if the track should be used as default audio source") - state: Optional[ScoreTrackState] = None + state: Optional[ScoreTrackState] = ScoreTrackState.DRAFT + purpose: Optional[ScoreTrackPurpose] = ScoreTrackPurpose.COMMON synchronization_points: Optional[List[ScoreTrackPoint]] = Field(default=None, alias="synchronizationPoints") - __properties: ClassVar[List[str]] = ["title", "default", "state", "synchronizationPoints"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["title", "default", "state", "purpose", "synchronizationPoints"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -48,8 +53,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,8 +69,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -77,10 +83,15 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of each item in synchronization_points (list) _items = [] if self.synchronization_points: - for _item in self.synchronization_points: - if _item: - _items.append(_item.to_dict()) + for _item_synchronization_points in self.synchronization_points: + if _item_synchronization_points: + _items.append(_item_synchronization_points.to_dict()) _dict['synchronizationPoints'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -95,9 +106,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "title": obj.get("title"), "default": obj.get("default"), - "state": obj.get("state"), + "state": obj.get("state") if obj.get("state") is not None else ScoreTrackState.DRAFT, + "purpose": obj.get("purpose") if obj.get("purpose") is not None else ScoreTrackPurpose.COMMON, "synchronizationPoints": [ScoreTrackPoint.from_dict(_item) for _item in obj["synchronizationPoints"]] if obj.get("synchronizationPoints") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/score_views_counts.py b/flat_api/models/score_views_counts.py index 586a930..b20f9e1 100644 --- a/flat_api/models/score_views_counts.py +++ b/flat_api/models/score_views_counts.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,25 +18,29 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class ScoreViewsCounts(BaseModel): """ - A computed version of the total, weekly, and monthly number of views of the score + A computed version of the total, weekly, monthly, and yearly number of views of the score """ # noqa: E501 total: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The total number of views of the score") weekly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The weekly number of views of the score") monthly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The monthly number of views of the score") - __properties: ClassVar[List[str]] = ["total", "weekly", "monthly"] + yearly: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="The yearly number of views of the score") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["total", "weekly", "monthly", "yearly"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,8 +95,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "total": obj.get("total"), "weekly": obj.get("weekly"), - "monthly": obj.get("monthly") + "monthly": obj.get("monthly"), + "yearly": obj.get("yearly") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/task.py b/flat_api/models/task.py index 72382d4..41097ec 100644 --- a/flat_api/models/task.py +++ b/flat_api/models/task.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,42 +19,48 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.task_progress import TaskProgress from flat_api.models.task_result import TaskResult from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class Task(BaseModel): """ An asynchronous task """ # noqa: E501 id: StrictStr = Field(description="Unique identifier of the task") - type: Optional[StrictStr] = Field(default=None, description="Type of the task (e.g. audio-export)") + type: Optional[StrictStr] = Field(default=None, description="Type of the task: * `audio-export`: Exports a score to audio format (MP3, WAV) * `score-save`: Saves or updates a score document * `import-omr`: Processes a PDF through OMR (Optical Music Recognition) and imports it as a score ") state: StrictStr = Field(description="State of the Task") format: Optional[StrictStr] = Field(default=None, description="For files processing, the file format (e.g. `mp3`, `wav`)") score: Optional[StrictStr] = Field(default=None, description="The score unique identifier for tasks related to scores") + revision: Optional[StrictStr] = Field(default=None, description="The score revision identifier for tasks related to scores") progress: Optional[TaskProgress] = None creation_date: Optional[datetime] = Field(default=None, description="The creation date of the task", alias="creationDate") modification_date: Optional[datetime] = Field(default=None, description="The last modification date of the task", alias="modificationDate") done_date: Optional[datetime] = Field(default=None, description="The date when the task has been completed", alias="doneDate") result: Optional[TaskResult] = None error_history: Optional[List[StrictStr]] = Field(default=None, description="If any errors happened when processing this task, the list of errors identifiers", alias="errorHistory") - __properties: ClassVar[List[str]] = ["id", "type", "state", "format", "score", "progress", "creationDate", "modificationDate", "doneDate", "result", "errorHistory"] + is_cancellable: Optional[StrictBool] = Field(default=None, description="Whether the task can be canceled by the user. Only `true` when the task is in `created` state (waiting to be processed). ", alias="isCancellable") + children: Optional[List[Task]] = Field(default=None, description="Child tasks for hierarchical task structures (e.g., conversion subtasks)") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "state", "format", "score", "revision", "progress", "creationDate", "modificationDate", "doneDate", "result", "errorHistory", "isCancellable", "children"] @field_validator('state') def state_validate_enum(cls, value): """Validates the enum""" - if value not in set(['created', 'doing', 'done', 'canceled', 'error']): - raise ValueError("must be one of enum values ('created', 'doing', 'done', 'canceled', 'error')") + if value not in set(['created', 'blocked', 'doing', 'done', 'canceled', 'error']): + raise ValueError("must be one of enum values ('created', 'blocked', 'doing', 'done', 'canceled', 'error')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -63,8 +69,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -80,8 +85,12 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * OpenAPI `readOnly` fields are excluded. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "is_cancellable", + "additional_properties", ]) _dict = self.model_dump( @@ -95,6 +104,18 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of result if self.result: _dict['result'] = self.result.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in children (list) + _items = [] + if self.children: + for _item_children in self.children: + if _item_children: + _items.append(_item_children.to_dict()) + _dict['children'] = _items + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -112,13 +133,23 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "state": obj.get("state"), "format": obj.get("format"), "score": obj.get("score"), + "revision": obj.get("revision"), "progress": TaskProgress.from_dict(obj["progress"]) if obj.get("progress") is not None else None, "creationDate": obj.get("creationDate"), "modificationDate": obj.get("modificationDate"), "doneDate": obj.get("doneDate"), "result": TaskResult.from_dict(obj["result"]) if obj.get("result") is not None else None, - "errorHistory": obj.get("errorHistory") + "errorHistory": obj.get("errorHistory"), + "isCancellable": obj.get("isCancellable"), + "children": [Task.from_dict(_item) for _item in obj["children"]] if obj.get("children") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj +# TODO: Rewrite to not use raise_errors +Task.model_rebuild(raise_errors=False) diff --git a/flat_api/models/task_export_options.py b/flat_api/models/task_export_options.py index 71103da..6123a4c 100644 --- a/flat_api/models/task_export_options.py +++ b/flat_api/models/task_export_options.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class TaskExportOptions(BaseModel): """ Options for the requested export """ # noqa: E501 parts: Optional[List[StrictStr]] = Field(default=None, description="A list of parts to specifically export") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["parts"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "parts": obj.get("parts") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/task_progress.py b/flat_api/models/task_progress.py index 538f7f1..31f88f5 100644 --- a/flat_api/models/task_progress.py +++ b/flat_api/models/task_progress.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional, Union from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class TaskProgress(BaseModel): """ @@ -29,13 +30,15 @@ class TaskProgress(BaseModel): """ # noqa: E501 percent: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="Percent of the task progression") text: Optional[StrictStr] = Field(default=None, description="Text details of the task progress") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["percent", "text"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "percent": obj.get("percent"), "text": obj.get("text") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/task_result.py b/flat_api/models/task_result.py index 2976078..99fca4b 100644 --- a/flat_api/models/task_result.py +++ b/flat_api/models/task_result.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class TaskResult(BaseModel): """ @@ -29,13 +30,15 @@ class TaskResult(BaseModel): """ # noqa: E501 url: Optional[StrictStr] = Field(default=None, description="URL returned by the task worker") error: Optional[StrictStr] = Field(default=None, description="Error returned by task worker") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["url", "error"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -44,8 +47,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -61,8 +63,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -70,6 +74,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -85,6 +94,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "url": obj.get("url"), "error": obj.get("error") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/teaching_theme.py b/flat_api/models/teaching_theme.py new file mode 100644 index 0000000..5f15cc9 --- /dev/null +++ b/flat_api/models/teaching_theme.py @@ -0,0 +1,45 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class TeachingTheme(str, Enum): + """ + Teaching theme + """ + + """ + allowed enum values + """ + COMPOSITION = 'composition' + MUSIC_MINUS_THEORY = 'music-theory' + GENERAL_MINUS_MUSIC = 'general-music' + BAND = 'band' + CHOIR = 'choir' + ORCHESTRA = 'orchestra' + JAZZ_MINUS_ENSEMBLE = 'jazz-ensemble' + MUSIC_MINUS_TECHNOLOGY = 'music-technology' + OTHER = 'other' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of TeachingTheme from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/flat_api/models/tutteo_product.py b/flat_api/models/tutteo_product.py index 82ffae9..b40d500 100644 --- a/flat_api/models/tutteo_product.py +++ b/flat_api/models/tutteo_product.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -21,7 +21,7 @@ class TutteoProduct(str, Enum): """ - The Tutteo product used by the user account + A Tutteo product. * `flat`: [Flat](https://flat.io) - Music notation software for individual users * `flatEdu`: [Flat for Education](https://flat.io/edu) - Music notation software for schools and educators * `msnippet`: [Music Snippet](https://musicsnippet.com) - Embeddable music snippets for websites * `embed`: [Flat Embed](https://flat.io/developers/embed) - Embeddable music notation editor """ """ diff --git a/flat_api/models/user_admin_update.py b/flat_api/models/user_admin_update.py index 0b8a0cd..74481dc 100644 --- a/flat_api/models/user_admin_update.py +++ b/flat_api/models/user_admin_update.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,13 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated from flat_api.models.organization_roles import OrganizationRoles from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserAdminUpdate(BaseModel): """ @@ -35,23 +36,15 @@ class UserAdminUpdate(BaseModel): firstname: Optional[Annotated[str, Field(strict=True, max_length=60)]] = Field(default=None, description="First name of the user") lastname: Optional[Annotated[str, Field(strict=True, max_length=60)]] = Field(default=None, description="Last name of the user") email: Optional[StrictStr] = Field(default=None, description="Email of the account") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["password", "organizationRole", "username", "firstname", "lastname", "email"] - @field_validator('username') - def username_validate_regular_expression(cls, value): - """Validates the regular expression""" - if value is None: - return value - - if not re.match(r"^[A-Za-z0-9\-_.]+$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9\-_.]+$/") - return value - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -60,8 +53,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -77,8 +69,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -86,6 +80,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -105,6 +104,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "lastname": obj.get("lastname"), "email": obj.get("email") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_azure_details.py b/flat_api/models/user_azure_details.py index 48e3f1b..abb6bfc 100644 --- a/flat_api/models/user_azure_details.py +++ b/flat_api/models/user_azure_details.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserAzureDetails(BaseModel): """ @@ -30,13 +31,15 @@ class UserAzureDetails(BaseModel): oid: Optional[StrictStr] = Field(default=None, description="User object identifier on Azure AD") hd: Optional[StrictStr] = Field(default=None, description="User tenant (domain name)") preferred_username: Optional[StrictStr] = Field(default=None, description="User Preferred Username (UPN), i.e. the main email of the user", alias="preferredUsername") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["oid", "hd", "preferredUsername"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +48,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +64,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +75,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -87,6 +96,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "hd": obj.get("hd"), "preferredUsername": obj.get("preferredUsername") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_basics.py b/flat_api/models/user_basics.py new file mode 100644 index 0000000..3454de8 --- /dev/null +++ b/flat_api/models/user_basics.py @@ -0,0 +1,133 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.tutteo_product import TutteoProduct +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserBasics(BaseModel): + """ + UserBasics + """ # noqa: E501 + id: StrictStr = Field(description="The user unique identifier") + type: StrictStr = Field(description="The type of user account") + product: TutteoProduct + username: StrictStr = Field(description="The user name (unique for the organization)") + printable_name: Optional[StrictStr] = Field(default=None, description="The name that can be directly printed (name, firstname & lastname, or username)", alias="printableName") + firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") + lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") + name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") + picture: Optional[StrictStr] = Field(description="The URL of the picture to display") + badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges"] + + @field_validator('type') + def type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['user', 'guest']): + raise ValueError("must be one of enum values ('user', 'guest')") + return value + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserBasics from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + # set to None if picture (nullable) is None + # and model_fields_set contains the field + if self.picture is None and "picture" in self.model_fields_set: + _dict['picture'] = None + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserBasics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "type": obj.get("type"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, + "username": obj.get("username"), + "printableName": obj.get("printableName"), + "firstname": obj.get("firstname"), + "lastname": obj.get("lastname"), + "name": obj.get("name"), + "picture": obj.get("picture"), + "badges": obj.get("badges") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/user_community_profile_links.py b/flat_api/models/user_community_profile_links.py index 78f68a0..c281a56 100644 --- a/flat_api/models/user_community_profile_links.py +++ b/flat_api/models/user_community_profile_links.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,10 +18,11 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserCommunityProfileLinks(BaseModel): """ @@ -33,13 +34,15 @@ class UserCommunityProfileLinks(BaseModel): tiktok_url: Optional[StrictStr] = Field(default=None, description="TikTok profile URL. For updates, also accepts TikTok usernames", alias="tiktokUrl") instagram_url: Optional[StrictStr] = Field(default=None, description="Instagram profile URL. For updates, also accepts Instagram usernames", alias="instagramUrl") website_url: Optional[StrictStr] = Field(default=None, description="Personnal website URL", alias="websiteUrl") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["spotifyUrl", "youtubeUrl", "soundcloudUrl", "tiktokUrl", "instagramUrl", "websiteUrl"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -48,8 +51,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -65,8 +67,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -74,6 +78,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + # set to None if spotify_url (nullable) is None # and model_fields_set contains the field if self.spotify_url is None and "spotify_url" in self.model_fields_set: @@ -123,6 +132,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "instagramUrl": obj.get("instagramUrl"), "websiteUrl": obj.get("websiteUrl") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_creation.py b/flat_api/models/user_creation.py index fe339c7..fa407a7 100644 --- a/flat_api/models/user_creation.py +++ b/flat_api/models/user_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,12 +18,12 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Annotated -from flat_api.models.flat_locales import FlatLocales from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserCreation(BaseModel): """ @@ -34,32 +34,27 @@ class UserCreation(BaseModel): lastname: Optional[Annotated[str, Field(strict=True, max_length=60)]] = Field(default=None, description="Last name of the user") email: Optional[StrictStr] = Field(default=None, description="Email of the new account") password: Annotated[str, Field(min_length=6, strict=True, max_length=1000)] = Field(description="Password of the new account") - locale: Optional[FlatLocales] = None + locale: Optional[StrictStr] = Field(default='en', description="User language. Input values will be automatically normalized to a supported locale code.") role: Optional[StrictStr] = Field(default='user', description="Role of the new account") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["username", "firstname", "lastname", "email", "password", "locale", "role"] - @field_validator('username') - def username_validate_regular_expression(cls, value): - """Validates the regular expression""" - if not re.match(r"^[A-Za-z0-9\-_.]+$", value): - raise ValueError(r"must validate the regular expression /^[A-Za-z0-9\-_.]+$/") - return value - @field_validator('role') def role_validate_enum(cls, value): """Validates the enum""" if value is None: return value - if value not in set(['user', 'teacher', 'admin']): - raise ValueError("must be one of enum values ('user', 'teacher', 'admin')") + if value not in set(['user', 'teacher', 'admin', 'accountAdmin']): + raise ValueError("must be one of enum values ('user', 'teacher', 'admin', 'accountAdmin')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -68,8 +63,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -85,8 +79,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -94,6 +90,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -111,9 +112,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "lastname": obj.get("lastname"), "email": obj.get("email"), "password": obj.get("password"), - "locale": obj.get("locale"), + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', "role": obj.get("role") if obj.get("role") is not None else 'user' }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_details.py b/flat_api/models/user_details.py index 51520e5..c3d2f70 100644 --- a/flat_api/models/user_details.py +++ b/flat_api/models/user_details.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,20 +19,20 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.class_roles import ClassRoles -from flat_api.models.flat_locales import FlatLocales from flat_api.models.organization_roles import OrganizationRoles from flat_api.models.tutteo_product import TutteoProduct from flat_api.models.user_azure_details import UserAzureDetails from flat_api.models.user_community_profile_links import UserCommunityProfileLinks from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserDetails(BaseModel): """ - UserDetails + User details """ # noqa: E501 id: StrictStr = Field(description="The user unique identifier") type: StrictStr = Field(description="The type of user account") @@ -42,7 +42,7 @@ class UserDetails(BaseModel): firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") - picture: Optional[StrictStr] = Field(description="The URL of the picture to display") + picture: StrictStr = Field(description="The URL of the picture to display") badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") @@ -54,17 +54,21 @@ class UserDetails(BaseModel): followers_count: Optional[StrictInt] = Field(default=None, description="Number of followers the user have", alias="followersCount") following_count: Optional[StrictInt] = Field(default=None, description="Number of people the user follow", alias="followingCount") owned_public_scores_count: Optional[StrictInt] = Field(default=None, description="Number of public scores the user have", alias="ownedPublicScoresCount") + all_public_scores_count: Optional[StrictInt] = Field(default=None, description="Total number of public scores the user participates in (owned + joined)", alias="allPublicScoresCount") + likes_count: Optional[StrictInt] = Field(default=None, description="Number of likes on the user published scores", alias="likesCount") + plays_count: Optional[StrictInt] = Field(default=None, description="Number of plays on the user published scores", alias="playsCount") cover_picture: Optional[StrictStr] = Field(default=None, description="Cover picture (backgroud) for the profile", alias="coverPicture") profile_theme: Optional[StrictStr] = Field(default=None, description="Theme (background) for the profile", alias="profileTheme") - instruments: Optional[List[StrictStr]] = Field(default=None, description="An array of the instrument identifiers. The format of the strings is `{instrument-group}.{instrument-id}`. ") links: Optional[UserCommunityProfileLinks] = None + is_email_verified: Optional[StrictBool] = Field(default=None, description="Whether the user's email address has been verified", alias="isEmailVerified") azure_details: Optional[UserAzureDetails] = Field(default=None, alias="azureDetails") private_profile: Optional[StrictBool] = Field(default=None, description="Tell either this user profile is private or not (individual accounts only)", alias="privateProfile") - locale: Optional[FlatLocales] = None + locale: Optional[StrictStr] = Field(default='en', description="The user language. Input values will be automatically normalized to a supported locale code. Unknown locales will default to `en`. Current supported locales include: `da`, `de`, `en`, `en-GB`, `es`, `fi`, `fil`, `fr`, `fr-CA`, `hi`, `id`, `it`, `ja`, `ja-HIRA`, `ko`, `ms`, `nb`, `nl`, `pl`, `pt`, `pt-BR`, `ro`, `ru`, `sv`, `tr`, `zh-Hans`, `zh-HK`, `zh-TW` ") groups: Optional[List[StrictStr]] = Field(default=None, description="For Flat for Education accounts, list of Group identifiers the user is part of.") picture_file: Optional[StrictStr] = Field(default=None, description="The ID of the user profile picture", alias="pictureFile") cover_picture_file: Optional[StrictStr] = Field(default=None, description="The ID of the user profile cover picture", alias="coverPictureFile") - __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "bio", "registrationDate", "likedScoresCount", "followersCount", "followingCount", "ownedPublicScoresCount", "coverPicture", "profileTheme", "instruments", "links", "azureDetails", "privateProfile", "locale", "groups", "pictureFile", "coverPictureFile"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "bio", "registrationDate", "likedScoresCount", "followersCount", "followingCount", "ownedPublicScoresCount", "allPublicScoresCount", "likesCount", "playsCount", "coverPicture", "profileTheme", "links", "isEmailVerified", "azureDetails", "privateProfile", "locale", "groups", "pictureFile", "coverPictureFile"] @field_validator('type') def type_validate_enum(cls, value): @@ -73,11 +77,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('user', 'guest')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -86,8 +91,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -103,8 +107,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -118,15 +124,10 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of azure_details if self.azure_details: _dict['azureDetails'] = self.azure_details.to_dict() - # set to None if picture (nullable) is None - # and model_fields_set contains the field - if self.picture is None and "picture" in self.model_fields_set: - _dict['picture'] = None - - # set to None if cover_picture (nullable) is None - # and model_fields_set contains the field - if self.cover_picture is None and "cover_picture" in self.model_fields_set: - _dict['coverPicture'] = None + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value # set to None if picture_file (nullable) is None # and model_fields_set contains the field @@ -152,7 +153,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type"), - "product": obj.get("product"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, "username": obj.get("username"), "printableName": obj.get("printableName"), "firstname": obj.get("firstname"), @@ -170,17 +171,25 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "followersCount": obj.get("followersCount"), "followingCount": obj.get("followingCount"), "ownedPublicScoresCount": obj.get("ownedPublicScoresCount"), + "allPublicScoresCount": obj.get("allPublicScoresCount"), + "likesCount": obj.get("likesCount"), + "playsCount": obj.get("playsCount"), "coverPicture": obj.get("coverPicture"), "profileTheme": obj.get("profileTheme"), - "instruments": obj.get("instruments"), "links": UserCommunityProfileLinks.from_dict(obj["links"]) if obj.get("links") is not None else None, + "isEmailVerified": obj.get("isEmailVerified"), "azureDetails": UserAzureDetails.from_dict(obj["azureDetails"]) if obj.get("azureDetails") is not None else None, "privateProfile": obj.get("privateProfile"), - "locale": obj.get("locale"), + "locale": obj.get("locale") if obj.get("locale") is not None else 'en', "groups": obj.get("groups"), "pictureFile": obj.get("pictureFile"), "coverPictureFile": obj.get("coverPictureFile") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_details_admin.py b/flat_api/models/user_details_admin.py index 16ba418..fb9f1c5 100644 --- a/flat_api/models/user_details_admin.py +++ b/flat_api/models/user_details_admin.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,18 +19,19 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.class_roles import ClassRoles from flat_api.models.organization_roles import OrganizationRoles from flat_api.models.tutteo_product import TutteoProduct -from flat_api.models.user_details_admin_license import UserDetailsAdminLicense +from flat_api.models.user_details_admin_all_of_license import UserDetailsAdminAllOfLicense from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserDetailsAdmin(BaseModel): """ - UserDetailsAdmin + User details (view for organization teacher / admin) """ # noqa: E501 id: StrictStr = Field(description="The user unique identifier") type: StrictStr = Field(description="The type of user account") @@ -40,7 +41,7 @@ class UserDetailsAdmin(BaseModel): firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") - picture: Optional[StrictStr] = Field(description="The URL of the picture to display") + picture: StrictStr = Field(description="The URL of the picture to display") badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") @@ -48,9 +49,11 @@ class UserDetailsAdmin(BaseModel): html_url: Optional[StrictStr] = Field(default=None, description="Link to user profile (for Indiv. users only)", alias="htmlUrl") email: Optional[StrictStr] = Field(default=None, description="Email of the user") last_activity_date: Optional[datetime] = Field(default=None, description="Date of the last user activity", alias="lastActivityDate") - license: Optional[UserDetailsAdminLicense] = None + license: Optional[UserDetailsAdminAllOfLicense] = None groups: Optional[List[StrictStr]] = Field(default=None, description="For Flat for Education accounts, list of Group identifiers the user is part of.") - __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "email", "lastActivityDate", "license", "groups"] + is_edu_testing_student: Optional[StrictBool] = Field(default=None, description="Indicates if the user account is marked as a testing student account. Testing students are typically excluded from certain educational integrations and workflows. This field helps API clients distinguish between regular students and testing accounts. ", alias="isEduTestingStudent") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "email", "lastActivityDate", "license", "groups", "isEduTestingStudent"] @field_validator('type') def type_validate_enum(cls, value): @@ -59,11 +62,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('user', 'guest')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -72,8 +76,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -89,8 +92,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -101,10 +106,10 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of license if self.license: _dict['license'] = self.license.to_dict() - # set to None if picture (nullable) is None - # and model_fields_set contains the field - if self.picture is None and "picture" in self.model_fields_set: - _dict['picture'] = None + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value return _dict @@ -120,7 +125,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type"), - "product": obj.get("product"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, "username": obj.get("username"), "printableName": obj.get("printableName"), "firstname": obj.get("firstname"), @@ -134,9 +139,15 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "htmlUrl": obj.get("htmlUrl"), "email": obj.get("email"), "lastActivityDate": obj.get("lastActivityDate"), - "license": UserDetailsAdminLicense.from_dict(obj["license"]) if obj.get("license") is not None else None, - "groups": obj.get("groups") + "license": UserDetailsAdminAllOfLicense.from_dict(obj["license"]) if obj.get("license") is not None else None, + "groups": obj.get("groups"), + "isEduTestingStudent": obj.get("isEduTestingStudent") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_details_admin_all_of_license.py b/flat_api/models/user_details_admin_all_of_license.py new file mode 100644 index 0000000..7b3af4f --- /dev/null +++ b/flat_api/models/user_details_admin_all_of_license.py @@ -0,0 +1,113 @@ +# coding: utf-8 + +""" + Flat API + + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + + The version of the OpenAPI document: 2.26.0 + Contact: developers@flat.io + 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 datetime import datetime +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from flat_api.models.license_mode import LicenseMode +from flat_api.models.license_sources import LicenseSources +from typing import Optional, Set +from typing_extensions import Self +from pydantic_core import to_jsonable_python + +class UserDetailsAdminAllOfLicense(BaseModel): + """ + Current active license of the user + """ # noqa: E501 + id: Optional[StrictStr] = Field(default=None, description="ID of the current license") + expiration_date: Optional[datetime] = Field(default=None, description="Date when the license expires", alias="expirationDate") + source: Optional[LicenseSources] = LicenseSources.ORDER + mode: Optional[LicenseMode] = None + active: Optional[StrictBool] = Field(default=None, description="ID of the current license") + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "expirationDate", "source", "mode", "active"] + + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + return json.dumps(to_jsonable_python(self.to_dict())) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of UserDetailsAdminAllOfLicense from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * Fields in `self.additional_properties` are added to the output dict. + """ + excluded_fields: Set[str] = set([ + "additional_properties", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of UserDetailsAdminAllOfLicense from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "expirationDate": obj.get("expirationDate"), + "source": obj.get("source") if obj.get("source") is not None else LicenseSources.ORDER, + "mode": obj.get("mode"), + "active": obj.get("active") + }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + + return _obj + + diff --git a/flat_api/models/user_details_admin_license.py b/flat_api/models/user_details_admin_license.py deleted file mode 100644 index 0696541..0000000 --- a/flat_api/models/user_details_admin_license.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - 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 datetime import datetime -from pydantic import BaseModel, Field, StrictBool, StrictStr -from typing import Any, ClassVar, Dict, List, Optional -from flat_api.models.license_mode import LicenseMode -from flat_api.models.license_sources import LicenseSources -from typing import Optional, Set -from typing_extensions import Self - -class UserDetailsAdminLicense(BaseModel): - """ - Current active license of the user - """ # noqa: E501 - id: Optional[StrictStr] = Field(default=None, description="ID of the current license") - expiration_date: Optional[datetime] = Field(default=None, description="Date when the license expires", alias="expirationDate") - source: Optional[LicenseSources] = None - mode: Optional[LicenseMode] = None - active: Optional[StrictBool] = Field(default=None, description="ID of the current license") - __properties: ClassVar[List[str]] = ["id", "expirationDate", "source", "mode", "active"] - - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } - - - def to_str(self) -> str: - """Returns the string representation of the model using alias""" - return pprint.pformat(self.model_dump(by_alias=True)) - - def to_json(self) -> str: - """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) - - @classmethod - def from_json(cls, json_str: str) -> Optional[Self]: - """Create an instance of UserDetailsAdminLicense from a JSON string""" - return cls.from_dict(json.loads(json_str)) - - def to_dict(self) -> Dict[str, Any]: - """Return the dictionary representation of the model using alias. - - This has the following differences from calling pydantic's - `self.model_dump(by_alias=True)`: - - * `None` is only added to the output dict for nullable fields that - were set at model initialization. Other fields with value `None` - are ignored. - """ - excluded_fields: Set[str] = set([ - ]) - - _dict = self.model_dump( - by_alias=True, - exclude=excluded_fields, - exclude_none=True, - ) - return _dict - - @classmethod - def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: - """Create an instance of UserDetailsAdminLicense from a dict""" - if obj is None: - return None - - if not isinstance(obj, dict): - return cls.model_validate(obj) - - _obj = cls.model_validate({ - "id": obj.get("id"), - "expirationDate": obj.get("expirationDate"), - "source": obj.get("source"), - "mode": obj.get("mode"), - "active": obj.get("active") - }) - return _obj - - diff --git a/flat_api/models/user_public.py b/flat_api/models/user_public.py index 48f9936..0c08ba9 100644 --- a/flat_api/models/user_public.py +++ b/flat_api/models/user_public.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,7 +19,7 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictInt, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.class_roles import ClassRoles from flat_api.models.organization_roles import OrganizationRoles @@ -27,10 +27,11 @@ from flat_api.models.user_community_profile_links import UserCommunityProfileLinks from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserPublic(BaseModel): """ - UserPublic + Public User details """ # noqa: E501 id: StrictStr = Field(description="The user unique identifier") type: StrictStr = Field(description="The type of user account") @@ -40,7 +41,7 @@ class UserPublic(BaseModel): firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") - picture: Optional[StrictStr] = Field(description="The URL of the picture to display") + picture: StrictStr = Field(description="The URL of the picture to display") badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") @@ -52,11 +53,14 @@ class UserPublic(BaseModel): followers_count: Optional[StrictInt] = Field(default=None, description="Number of followers the user have", alias="followersCount") following_count: Optional[StrictInt] = Field(default=None, description="Number of people the user follow", alias="followingCount") owned_public_scores_count: Optional[StrictInt] = Field(default=None, description="Number of public scores the user have", alias="ownedPublicScoresCount") + all_public_scores_count: Optional[StrictInt] = Field(default=None, description="Total number of public scores the user participates in (owned + joined)", alias="allPublicScoresCount") + likes_count: Optional[StrictInt] = Field(default=None, description="Number of likes on the user published scores", alias="likesCount") + plays_count: Optional[StrictInt] = Field(default=None, description="Number of plays on the user published scores", alias="playsCount") cover_picture: Optional[StrictStr] = Field(default=None, description="Cover picture (backgroud) for the profile", alias="coverPicture") profile_theme: Optional[StrictStr] = Field(default=None, description="Theme (background) for the profile", alias="profileTheme") - instruments: Optional[List[StrictStr]] = Field(default=None, description="An array of the instrument identifiers. The format of the strings is `{instrument-group}.{instrument-id}`. ") links: Optional[UserCommunityProfileLinks] = None - __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "bio", "registrationDate", "likedScoresCount", "followersCount", "followingCount", "ownedPublicScoresCount", "coverPicture", "profileTheme", "instruments", "links"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl", "bio", "registrationDate", "likedScoresCount", "followersCount", "followingCount", "ownedPublicScoresCount", "allPublicScoresCount", "likesCount", "playsCount", "coverPicture", "profileTheme", "links"] @field_validator('type') def type_validate_enum(cls, value): @@ -65,11 +69,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('user', 'guest')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -78,8 +83,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -95,8 +99,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -107,10 +113,10 @@ def to_dict(self) -> Dict[str, Any]: # override the default output from pydantic by calling `to_dict()` of links if self.links: _dict['links'] = self.links.to_dict() - # set to None if picture (nullable) is None - # and model_fields_set contains the field - if self.picture is None and "picture" in self.model_fields_set: - _dict['picture'] = None + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value # set to None if cover_picture (nullable) is None # and model_fields_set contains the field @@ -131,7 +137,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type"), - "product": obj.get("product"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, "username": obj.get("username"), "printableName": obj.get("printableName"), "firstname": obj.get("firstname"), @@ -149,11 +155,18 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "followersCount": obj.get("followersCount"), "followingCount": obj.get("followingCount"), "ownedPublicScoresCount": obj.get("ownedPublicScoresCount"), + "allPublicScoresCount": obj.get("allPublicScoresCount"), + "likesCount": obj.get("likesCount"), + "playsCount": obj.get("playsCount"), "coverPicture": obj.get("coverPicture"), "profileTheme": obj.get("profileTheme"), - "instruments": obj.get("instruments"), "links": UserCommunityProfileLinks.from_dict(obj["links"]) if obj.get("links") is not None else None }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_public_summary.py b/flat_api/models/user_public_summary.py index 0225f82..e5c147b 100644 --- a/flat_api/models/user_public_summary.py +++ b/flat_api/models/user_public_summary.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,17 +18,18 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr, field_validator +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator from typing import Any, ClassVar, Dict, List, Optional from flat_api.models.class_roles import ClassRoles from flat_api.models.organization_roles import OrganizationRoles from flat_api.models.tutteo_product import TutteoProduct from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserPublicSummary(BaseModel): """ - UserPublicSummary + Public User details summary """ # noqa: E501 id: StrictStr = Field(description="The user unique identifier") type: StrictStr = Field(description="The type of user account") @@ -38,12 +39,13 @@ class UserPublicSummary(BaseModel): firstname: Optional[StrictStr] = Field(default=None, description="Firstname of the user (for education users)") lastname: Optional[StrictStr] = Field(default=None, description="Lastname of the user (for education users)") name: Optional[StrictStr] = Field(default=None, description="A displayable name for the user (for consumer users)") - picture: Optional[StrictStr] = Field(description="The URL of the picture to display") + picture: StrictStr = Field(description="The URL of the picture to display") badges: Optional[List[StrictStr]] = Field(default=None, description="List of badges for the user profile: - `power` - `staff` - `composerOfTheMonth` - `ambassador` - `challenge` ") organization: Optional[StrictStr] = Field(default=None, description="Organization ID (for Edu users only)") organization_role: Optional[OrganizationRoles] = Field(default=None, alias="organizationRole") class_role: Optional[ClassRoles] = Field(default=None, alias="classRole") html_url: Optional[StrictStr] = Field(default=None, description="Link to user profile (for Indiv. users only)", alias="htmlUrl") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["id", "type", "product", "username", "printableName", "firstname", "lastname", "name", "picture", "badges", "organization", "organizationRole", "classRole", "htmlUrl"] @field_validator('type') @@ -53,11 +55,12 @@ def type_validate_enum(cls, value): raise ValueError("must be one of enum values ('user', 'guest')") return value - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -66,8 +69,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -83,8 +85,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -92,10 +96,10 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) - # set to None if picture (nullable) is None - # and model_fields_set contains the field - if self.picture is None and "picture" in self.model_fields_set: - _dict['picture'] = None + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value return _dict @@ -111,7 +115,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "id": obj.get("id"), "type": obj.get("type"), - "product": obj.get("product"), + "product": obj.get("product") if obj.get("product") is not None else TutteoProduct.FLAT, "username": obj.get("username"), "printableName": obj.get("printableName"), "firstname": obj.get("firstname"), @@ -124,6 +128,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "classRole": obj.get("classRole"), "htmlUrl": obj.get("htmlUrl") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_signin_link.py b/flat_api/models/user_signin_link.py index 39892c7..72e0254 100644 --- a/flat_api/models/user_signin_link.py +++ b/flat_api/models/user_signin_link.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -19,24 +19,28 @@ import json from datetime import datetime -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserSigninLink(BaseModel): """ UserSigninLink """ # noqa: E501 url: Optional[StrictStr] = Field(default=None, description="URL to use to sign in to this account") + token: Optional[StrictStr] = Field(default=None, description="Raw sign-in token, can be used to build custom URLs (e.g. deep links)") expiration_date: Optional[datetime] = Field(default=None, description="Date when the link expires", alias="expirationDate") - __properties: ClassVar[List[str]] = ["url", "expirationDate"] + additional_properties: Dict[str, Any] = {} + __properties: ClassVar[List[str]] = ["url", "token", "expirationDate"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -45,8 +49,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -62,8 +65,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -71,6 +76,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -84,8 +94,14 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "url": obj.get("url"), + "token": obj.get("token"), "expirationDate": obj.get("expirationDate") }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/models/user_signin_link_creation.py b/flat_api/models/user_signin_link_creation.py index bc7b132..2fbeb9d 100644 --- a/flat_api/models/user_signin_link_creation.py +++ b/flat_api/models/user_signin_link_creation.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -18,23 +18,26 @@ import re # noqa: F401 import json -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self +from pydantic_core import to_jsonable_python class UserSigninLinkCreation(BaseModel): """ UserSigninLinkCreation """ # noqa: E501 destination_path: Optional[StrictStr] = Field(default='/', description="Path to redirect to after signin", alias="destinationPath") + additional_properties: Dict[str, Any] = {} __properties: ClassVar[List[str]] = ["destinationPath"] - model_config = { - "populate_by_name": True, - "validate_assignment": True, - "protected_namespaces": (), - } + model_config = ConfigDict( + validate_by_name=True, + validate_by_alias=True, + validate_assignment=True, + protected_namespaces=(), + ) def to_str(self) -> str: @@ -43,8 +46,7 @@ def to_str(self) -> str: def to_json(self) -> str: """Returns the JSON representation of the model using alias""" - # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead - return json.dumps(self.to_dict()) + return json.dumps(to_jsonable_python(self.to_dict())) @classmethod def from_json(cls, json_str: str) -> Optional[Self]: @@ -60,8 +62,10 @@ def to_dict(self) -> Dict[str, Any]: * `None` is only added to the output dict for nullable fields that were set at model initialization. Other fields with value `None` are ignored. + * Fields in `self.additional_properties` are added to the output dict. """ excluded_fields: Set[str] = set([ + "additional_properties", ]) _dict = self.model_dump( @@ -69,6 +73,11 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # puts key-value pairs in additional_properties in the top level + if self.additional_properties is not None: + for _key, _value in self.additional_properties.items(): + _dict[_key] = _value + return _dict @classmethod @@ -83,6 +92,11 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "destinationPath": obj.get("destinationPath") if obj.get("destinationPath") is not None else '/' }) + # store additional fields in additional_properties + for _key in obj.keys(): + if _key not in cls.__properties: + _obj.additional_properties[_key] = obj.get(_key) + return _obj diff --git a/flat_api/oauth.py b/flat_api/oauth.py new file mode 100644 index 0000000..66d1935 --- /dev/null +++ b/flat_api/oauth.py @@ -0,0 +1,145 @@ +"""OAuth2 support for the Flat API. + +The public specification declares one security scheme: OAuth2 with the authorization-code flow and +23 scopes. A Personal Access Token is an OAuth access token for your own account, so passing a token +straight to the client covers both cases. + +A refresh token is only issued when the authorization request sets ``access_type=offline``. + +This module never stores a token. Persistence is deployment-specific, so the client hands refreshed +tokens to a callback you supply and it is your job to save them. +""" + +from __future__ import annotations + +import threading +import time +from dataclasses import dataclass, field +from urllib.parse import urlencode + +import httpx + +from flat_api.errors import FlatAuthenticationError + +__all__ = ["Tokens", "OAuth2Helper", "TokenManager"] + +AUTHORIZE_URL = "https://flat.io/auth/oauth" +TOKEN_URL = "https://api.flat.io/oauth/access_token" + +#: Refresh this many seconds before nominal expiry, to avoid racing the server clock. +EXPIRY_SKEW = 30.0 + + +@dataclass +class Tokens: + access_token: str + refresh_token: str | None = None + expires_at: float | None = None + + @classmethod + def from_response(cls, payload: dict) -> "Tokens": + expires_in = payload.get("expires_in") + return cls( + access_token=payload["access_token"], + refresh_token=payload.get("refresh_token"), + expires_at=time.time() + float(expires_in) if expires_in else None, + ) + + @property + def expired(self) -> bool: + return self.expires_at is not None and time.time() >= self.expires_at - EXPIRY_SKEW + + +class OAuth2Helper: + """Builds the authorization URL and exchanges codes for tokens.""" + + def __init__(self, client_id: str, client_secret: str, redirect_uri: str) -> None: + self.client_id = client_id + self.client_secret = client_secret + self.redirect_uri = redirect_uri + + def authorize_url( + self, + scopes: list[str], + state: str, + *, + offline: bool = True, + ) -> str: + """URL to send a user to. ``offline=True`` is what yields a refresh token.""" + params = { + "client_id": self.client_id, + "redirect_uri": self.redirect_uri, + "response_type": "code", + "scope": " ".join(scopes), + "state": state, + } + if offline: + params["access_type"] = "offline" + return f"{AUTHORIZE_URL}?{urlencode(params)}" + + def exchange_code(self, code: str) -> Tokens: + return self._token_request( + {"grant_type": "authorization_code", "code": code, "redirect_uri": self.redirect_uri} + ) + + def refresh(self, refresh_token: str) -> Tokens: + return self._token_request( + {"grant_type": "refresh_token", "refresh_token": refresh_token} + ) + + def _token_request(self, payload: dict) -> Tokens: + body = {**payload, "client_id": self.client_id, "client_secret": self.client_secret} + response = httpx.post(TOKEN_URL, data=body, timeout=30) + if response.status_code >= 400: + raise FlatAuthenticationError( + "OAuth2 token request failed; the user must re-authorize", + status=response.status_code, + body=_safe_json(response), + ) + return Tokens.from_response(response.json()) + + +class TokenManager: + """Holds the current tokens and refreshes them at most once at a time. + + Single-flight matters: two concurrent requests hitting an expired token must not both refresh, + because the second refresh would invalidate the token the first just obtained. + """ + + def __init__( + self, + tokens: Tokens, + helper: OAuth2Helper | None = None, + on_token_refresh=None, + ) -> None: + self._tokens = tokens + self._helper = helper + self._on_refresh = on_token_refresh + self._lock = threading.Lock() + + @property + def access_token(self) -> str: + return self._tokens.access_token + + def refresh(self) -> str: + """Refresh once, even under concurrency, and return the new access token.""" + with self._lock: + current = self._tokens.access_token + if self._tokens.access_token != current: + return self._tokens.access_token + if self._helper is None or not self._tokens.refresh_token: + raise FlatAuthenticationError( + "the access token expired and no refresh token is available; " + "the user must re-authorize" + ) + self._tokens = self._helper.refresh(self._tokens.refresh_token) + if self._on_refresh is not None: + self._on_refresh(self._tokens) + return self._tokens.access_token + + +def _safe_json(response: httpx.Response): + try: + return response.json() + except ValueError: + return None diff --git a/flat_api/pagination.py b/flat_api/pagination.py new file mode 100644 index 0000000..3d4990c --- /dev/null +++ b/flat_api/pagination.py @@ -0,0 +1,73 @@ +"""Cursor pagination for the Flat API. + +Eight operations at v2.25.0 are cursor-paginated, identified by a ``next`` query parameter. Note the +parameter is a shared component (``#/components/parameters/next``): any tool that reads an +operation\'s parameters without resolving ``$ref`` under-counts them and ships collections that +silently truncate. + +The cursor itself is **not in the response body**. It arrives in the ``Link`` header, which the +specification does not declare, so it is parsed at runtime from the generated ``ApiResponse``. +""" + +from __future__ import annotations + +import re +from collections.abc import Callable, Iterator +from typing import Any, TypeVar + +__all__ = ["parse_link_header", "paginate"] + +T = TypeVar("T") + +_LINK = re.compile(r'<(?P[^>]+)>\s*;\s*rel="(?P[^"]+)"') +_NEXT_PARAM = re.compile(r"[?&]next=(?P[^&]+)") + + +def parse_link_header(value: str | None) -> dict[str, str]: + """Parse an RFC 5988 Link header into {rel: url}.""" + if not value: + return {} + return {m.group("rel"): m.group("url") for m in _LINK.finditer(value)} + + +def next_cursor(headers: dict[str, str] | None) -> str | None: + """Extract the opaque ``next`` cursor from a response\'s Link header, if any.""" + if not headers: + return None + link = next((v for k, v in headers.items() if k.lower() == "link"), None) + url = parse_link_header(link).get("next") + if not url: + return None + match = _NEXT_PARAM.search(url) + return match.group("cursor") if match else None + + +def paginate( + fetch_page: Callable[..., Any], + *args: Any, + **kwargs: Any, +) -> Iterator[T]: + """Yield every item across all pages of a cursor-paginated operation. + + ``fetch_page`` must be the generated ``*_with_http_info`` variant, which returns an + ``ApiResponse`` carrying the headers the cursor lives in. + + A token expiring mid-traversal is refreshed by the client and the traversal resumes from the + same cursor, so no page is skipped or repeated. + """ + cursor: str | None = kwargs.pop("next", None) + seen: set[str] = set() + + while True: + response = fetch_page(*args, **({**kwargs, "next": cursor} if cursor else kwargs)) + page = getattr(response, "data", response) + if page: + yield from page + + cursor = next_cursor(getattr(response, "headers", None)) + if not cursor: + return + # A server that returns a cursor it already gave us would loop forever. + if cursor in seen: + return + seen.add(cursor) diff --git a/flat_api/rest.py b/flat_api/rest.py index e0806d1..8f651d6 100644 --- a/flat_api/rest.py +++ b/flat_api/rest.py @@ -3,9 +3,9 @@ """ Flat API - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) + The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro, MuseScore, ABC notation, and many other formats * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - The version of the OpenAPI document: 2.20.0 + The version of the OpenAPI document: 2.26.0 Contact: developers@flat.io Generated by OpenAPI Generator (https://openapi-generator.tech) @@ -13,10 +13,12 @@ """ # noqa: E501 +import ipaddress import io import json import re import ssl +from urllib.parse import urlparse import urllib3 @@ -36,6 +38,44 @@ def is_socks_proxy_url(url): return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES +def should_bypass_proxies(url: str, no_proxy: str) -> bool: + """Return whether ``url`` matches the comma-separated ``no_proxy`` rules.""" + parsed_url = urlparse(url) + if not parsed_url.hostname: + return True + + host = parsed_url.hostname.lower() + host_and_port = parsed_url.netloc.lower() + try: + host_ip = ipaddress.ip_address(host) + except ValueError: + host_ip = None + + for entry in (entry.strip().lower() for entry in no_proxy.split(',')): + if not entry: + continue + if entry == '*': + return True + + if host_ip is not None: + try: + if host_ip in ipaddress.ip_network(entry, strict=False): + return True + except ValueError: + pass + + entry = entry.lstrip('.') + if ( + host == entry + or host.endswith('.' + entry) + or host_and_port == entry + or host_and_port.endswith('.' + entry) + ): + return True + + return False + + class RESTResponse(io.IOBase): def __init__(self, resp) -> None: @@ -49,12 +89,17 @@ def read(self): self.data = self.response.data return self.data + @property + def headers(self): + """Returns a dictionary of response headers.""" + return self.response.headers + def getheaders(self): - """Returns a dictionary of the response headers.""" + """Returns a dictionary of the response headers; use ``headers`` instead.""" return self.response.headers def getheader(self, name, default=None): - """Returns a given response header.""" + """Returns a given response header; use ``headers.get()`` instead.""" return self.response.headers.get(name, default) @@ -77,6 +122,7 @@ def __init__(self, configuration) -> None: "ca_certs": configuration.ssl_ca_cert, "cert_file": configuration.cert_file, "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, } if configuration.assert_hostname is not None: pool_args['assert_hostname'] = ( @@ -99,7 +145,9 @@ def __init__(self, configuration) -> None: # https pool manager self.pool_manager: urllib3.PoolManager - if configuration.proxy: + if configuration.proxy and not should_bypass_proxies( + configuration.host, configuration.no_proxy or '' + ): if is_socks_proxy_url(configuration.proxy): from urllib3.contrib.socks import SOCKSProxyManager pool_args["proxy_url"] = configuration.proxy @@ -171,12 +219,20 @@ def request( # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - # no content type provided or payload is json content_type = headers.get('Content-Type') - if ( + is_json = ( not content_type or re.search('json', content_type, re.IGNORECASE) - ): + ) + # JSON is valid YAML 1.2, so structured YAML bodies can use + # the existing JSON serializer: + # https://yaml.org/spec/1.2.2/#13-relation-to-json + is_structured_yaml = ( + content_type + and re.search('yaml', content_type, re.IGNORECASE) + and not isinstance(body, (str, bytes)) + ) + if is_json or is_structured_yaml: request_body = None if body is not None: request_body = json.dumps(body) @@ -203,6 +259,8 @@ def request( # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( method, url, @@ -224,7 +282,7 @@ def request( headers=headers, preload_content=False ) - elif headers['Content-Type'] == 'text/plain' and isinstance(body, bool): + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): request_body = "true" if body else "false" r = self.pool_manager.request( method, diff --git a/pyproject.toml b/pyproject.toml index 1315ced..eeb1647 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,34 +1,50 @@ -[tool.poetry] -name = "flat_api" -version = "1.1.3" -description = "Flat API" -authors = ["Flat "] -license = "NoLicense" +[project] +name = "flat-api" +description = "The official Python client for the Flat API" +authors = [{ name = "Flat", email = "developers@flat.io" }] +license = "Apache-2.0" +license-files = ["LICENSE"] readme = "README.md" -repository = "https://github.com/FlatIO/api-client-python" -keywords = ["OpenAPI", "OpenAPI-Generator", "Flat API"] -include = ["flat_api/py.typed"] +keywords = ["flat", "flat.io", "music", "notation", "openapi", "sheet-music"] +requires-python = ">=3.11" -[tool.poetry.dependencies] -python = "^3.7" +# VERSION is the durable source of truth (rule 5): it sits outside the generated zone and +# tools/generate.sh writes it. Deriving the packaged version from it here is what keeps the tag, +# the file and the published artifact from ever disagreeing. +dynamic = ["version"] -urllib3 = ">= 1.25.3" -python-dateutil = ">=2.8.2" -pydantic = ">=2" -typing-extensions = ">=4.7.1" - -[tool.poetry.dev-dependencies] -pytest = ">=7.2.1" -tox = ">=3.9.0" -flake8 = ">=4.0.0" -types-python-dateutil = ">=2.8.19.14" -mypy = "1.4.1" +dependencies = [ + # Synchronous transport. + "urllib3 >=1.25.3, <3", + # Asynchronous transport, for AsyncFlatClient. flat_api.client imports it unconditionally, + # so it is a hard requirement rather than an extra. + "aiohttp >=3.9", + "aiohttp-retry >=2.8", + # flat_api.oauth, re-exported from the package root. + "httpx >=0.27", + "pydantic >=2", + "python-dateutil >=2.8.2", + "typing-extensions >=4.7.1", +] +[project.urls] +Homepage = "https://flat.io/developers/docs/api/" +Repository = "https://github.com/FlatIO/api-client-python" +Changelog = "https://github.com/FlatIO/api-client-python/blob/master/CHANGELOG.md" [build-system] -requires = ["setuptools"] +requires = ["setuptools>=77"] build-backend = "setuptools.build_meta" +[tool.setuptools.dynamic] +version = { file = "VERSION" } + +[tool.setuptools.packages.find] +include = ["flat_api*"] + +[tool.setuptools.package-data] +flat_api = ["py.typed"] + [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" diff --git a/requirements.txt b/requirements.txt index cc85509..d14a6fb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,9 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3, < 2.1.0 +# Runtime dependencies, kept in step with the [project] dependencies in pyproject.toml. +# pyproject.toml is what PyPI installs from; this file is for a local checkout. +urllib3 >= 1.25.3, < 3 +aiohttp >= 3.9 +aiohttp-retry >= 2.8 +httpx >= 0.27 pydantic >= 2 +python-dateutil >= 2.8.2 typing-extensions >= 4.7.1 diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 11433ee..0000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[flake8] -max-line-length=99 diff --git a/setup.py b/setup.py deleted file mode 100644 index a1ed77d..0000000 --- a/setup.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Flat API -""" - - -import sys -from setuptools import setup, find_packages - -# To install the library, run the following -# -# python setup.py install -# -# prerequisite: setuptools -# http://pypi.python.org/pypi/setuptools - -REQUIRES = ["urllib3 >= 1.15", "six >= 1.10", "certifi", "python-dateutil"] - -try: - import pypandoc - LONG_DESCRIPTION = open('README.md').read() - LONG_DESCRIPTION = LONG_DESCRIPTION[:LONG_DESCRIPTION.index('## Documentation for API Endpoints')] - LONG_DESCRIPTION = pypandoc.convert_text(LONG_DESCRIPTION, 'rst', format='md') -except(IOError, ImportError): - LONG_DESCRIPTION = open('README.md').read() - -setup( - name="flat_api", - version="1.1.3", - description="Flat API Client", - author="The Flat Team (https://flat.io)", - author_email="developers@flat.io", - url="https://github.com/FlatIO/api-client-python", - keywords=["Flat API", "MusicXML", "Music Notation", "MIDI"], - long_description=LONG_DESCRIPTION, - long_description_content_type="text/markdown", - install_requires=REQUIRES, - packages=find_packages(exclude=["*test.*", "*test"]), - include_package_data=True, - license="Apache", - classifiers=[ - "Development Status :: 4 - Beta", - "Environment :: Console", - "Intended Audience :: Developers", - "Intended Audience :: Education", - "Intended Audience :: System Administrators", - "License :: OSI Approved :: Apache Software License", - "Operating System :: MacOS", - "Operating System :: POSIX", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Topic :: Artistic Software", - "Topic :: Education", - "Topic :: Multimedia :: Sound/Audio" - ] -) diff --git a/test-requirements.txt b/test-requirements.txt deleted file mode 100644 index 8e6d8cb..0000000 --- a/test-requirements.txt +++ /dev/null @@ -1,5 +0,0 @@ -pytest~=7.1.3 -pytest-cov>=2.8.1 -pytest-randomly>=3.12.0 -mypy>=1.4.1 -types-python-dateutil>=2.8.19 diff --git a/test/__init__.py b/test/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/test/test_account_api.py b/test/test_account_api.py deleted file mode 100644 index 5a80aa5..0000000 --- a/test/test_account_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.account_api import AccountApi - - -class TestAccountApi(unittest.TestCase): - """AccountApi unit test stubs""" - - def setUp(self) -> None: - self.api = AccountApi() - - def tearDown(self) -> None: - pass - - def test_get_authenticated_user(self) -> None: - """Test case for get_authenticated_user - - Get current user account - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_api_access_token.py b/test/test_api_access_token.py deleted file mode 100644 index b7b6ba4..0000000 --- a/test/test_api_access_token.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.api_access_token import ApiAccessToken - -class TestApiAccessToken(unittest.TestCase): - """ApiAccessToken unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ApiAccessToken: - """Test ApiAccessToken - 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 `ApiAccessToken` - """ - model = ApiAccessToken() - if include_optional: - return ApiAccessToken( - id = '', - name = '', - token = '', - issued_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - scopes = [ - 'account.public_profile' - ] - ) - else: - return ApiAccessToken( - ) - """ - - def testApiAccessToken(self): - """Test ApiAccessToken""" - # 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_app_scopes.py b/test/test_app_scopes.py deleted file mode 100644 index 7b6e1e3..0000000 --- a/test/test_app_scopes.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.app_scopes import AppScopes - -class TestAppScopes(unittest.TestCase): - """AppScopes unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAppScopes(self): - """Test AppScopes""" - # inst = AppScopes() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_assignment.py b/test/test_assignment.py deleted file mode 100644 index 748a2a8..0000000 --- a/test/test_assignment.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment import Assignment - -class TestAssignment(unittest.TestCase): - """Assignment unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Assignment: - """Test Assignment - 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 `Assignment` - """ - model = Assignment() - if include_optional: - return Assignment( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - description = '', - cover = '', - cover_file = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - use_dedicated_attachments = True, - max_points = 1.337, - release_grades = 'auto', - shuffle_exercises = True, - toolset = '', - nb_playback_authorized = 1.337 - ) - else: - return Assignment( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - ) - """ - - def testAssignment(self): - """Test Assignment""" - # 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_assignment_copy.py b/test/test_assignment_copy.py deleted file mode 100644 index bc39b4f..0000000 --- a/test/test_assignment_copy.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_copy import AssignmentCopy - -class TestAssignmentCopy(unittest.TestCase): - """AssignmentCopy unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentCopy: - """Test AssignmentCopy - 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 `AssignmentCopy` - """ - model = AssignmentCopy() - if include_optional: - return AssignmentCopy( - classroom = '', - assignment = '', - scheduled_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - library_parent = '', - verify_if_not_already_in_resource_library = True - ) - else: - return AssignmentCopy( - classroom = '', - library_parent = '', - ) - """ - - def testAssignmentCopy(self): - """Test AssignmentCopy""" - # 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_assignment_copy_response.py b/test/test_assignment_copy_response.py deleted file mode 100644 index 37bdd41..0000000 --- a/test/test_assignment_copy_response.py +++ /dev/null @@ -1,89 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_copy_response import AssignmentCopyResponse - -class TestAssignmentCopyResponse(unittest.TestCase): - """AssignmentCopyResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentCopyResponse: - """Test AssignmentCopyResponse - 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 `AssignmentCopyResponse` - """ - model = AssignmentCopyResponse() - if include_optional: - return AssignmentCopyResponse( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - description = '', - cover = '', - cover_file = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - use_dedicated_attachments = True, - max_points = 1.337, - release_grades = 'auto', - shuffle_exercises = True, - toolset = '', - nb_playback_authorized = 1.337, - resource = '' - ) - else: - return AssignmentCopyResponse( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - ) - """ - - def testAssignmentCopyResponse(self): - """Test AssignmentCopyResponse""" - # 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_assignment_copy_response_capabilities.py b/test/test_assignment_copy_response_capabilities.py deleted file mode 100644 index 818bcf4..0000000 --- a/test/test_assignment_copy_response_capabilities.py +++ /dev/null @@ -1,62 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_copy_response_capabilities import AssignmentCopyResponseCapabilities - -class TestAssignmentCopyResponseCapabilities(unittest.TestCase): - """AssignmentCopyResponseCapabilities unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentCopyResponseCapabilities: - """Test AssignmentCopyResponseCapabilities - 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 `AssignmentCopyResponseCapabilities` - """ - model = AssignmentCopyResponseCapabilities() - if include_optional: - return AssignmentCopyResponseCapabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True - ) - else: - return AssignmentCopyResponseCapabilities( - can_edit = True, - can_publish_in_class = True, - can_archive = True, - can_unarchive = True, - ) - """ - - def testAssignmentCopyResponseCapabilities(self): - """Test AssignmentCopyResponseCapabilities""" - # 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_assignment_copy_response_capabilities_can_publish_in_class_error.py b/test/test_assignment_copy_response_capabilities_can_publish_in_class_error.py deleted file mode 100644 index 08f2935..0000000 --- a/test/test_assignment_copy_response_capabilities_can_publish_in_class_error.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error import AssignmentCopyResponseCapabilitiesCanPublishInClassError - -class TestAssignmentCopyResponseCapabilitiesCanPublishInClassError(unittest.TestCase): - """AssignmentCopyResponseCapabilitiesCanPublishInClassError unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentCopyResponseCapabilitiesCanPublishInClassError: - """Test AssignmentCopyResponseCapabilitiesCanPublishInClassError - 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 `AssignmentCopyResponseCapabilitiesCanPublishInClassError` - """ - model = AssignmentCopyResponseCapabilitiesCanPublishInClassError() - if include_optional: - return AssignmentCopyResponseCapabilitiesCanPublishInClassError( - code = '', - message = '' - ) - else: - return AssignmentCopyResponseCapabilitiesCanPublishInClassError( - code = '', - message = '', - ) - """ - - def testAssignmentCopyResponseCapabilitiesCanPublishInClassError(self): - """Test AssignmentCopyResponseCapabilitiesCanPublishInClassError""" - # 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_assignment_submission.py b/test/test_assignment_submission.py deleted file mode 100644 index 5f0a974..0000000 --- a/test/test_assignment_submission.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission import AssignmentSubmission - -class TestAssignmentSubmission(unittest.TestCase): - """AssignmentSubmission unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmission: - """Test AssignmentSubmission - 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 `AssignmentSubmission` - """ - model = AssignmentSubmission() - if include_optional: - return AssignmentSubmission( - id = '', - state = 'created', - classroom = '', - assignment = '', - creator = '', - creation_date = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - submission_date = '', - return_date = '', - return_creator = '', - grade = 1.337, - draft_grade = 1.337, - max_points = 1.337, - exercises_ids = [ - '' - ], - playback = [ - flat_api.models.assignment_submission_playback_inner.AssignmentSubmission_playback_inner( - score = '', - nb_play_attempt = 1.337, ) - ], - comments = flat_api.models.assignment_submission_comments.AssignmentSubmission_comments( - total = 1.337, - unread = 1.337, ), - google_classroom = {"id":"CgsI-00000000000","state":"turned_in","alternateLink":"http://classroom.google.com/c/music-theory/a/first-assignment/submissions/student/my-submission"}, - microsoft_graph = {"id":"8e460d32-d2d4-46b3-8e1a-9b7677a48fda","state":"returned"}, - lti = flat_api.models.assignment_submission_lti.AssignmentSubmission_lti( - sourcedid = '', ) - ) - else: - return AssignmentSubmission( - id = '', - state = 'created', - classroom = '', - assignment = '', - creator = '', - creation_date = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - playback = [ - flat_api.models.assignment_submission_playback_inner.AssignmentSubmission_playback_inner( - score = '', - nb_play_attempt = 1.337, ) - ], - comments = flat_api.models.assignment_submission_comments.AssignmentSubmission_comments( - total = 1.337, - unread = 1.337, ), - ) - """ - - def testAssignmentSubmission(self): - """Test AssignmentSubmission""" - # 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_assignment_submission_comment.py b/test/test_assignment_submission_comment.py deleted file mode 100644 index babd960..0000000 --- a/test/test_assignment_submission_comment.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_comment import AssignmentSubmissionComment - -class TestAssignmentSubmissionComment(unittest.TestCase): - """AssignmentSubmissionComment unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionComment: - """Test AssignmentSubmissionComment - 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 `AssignmentSubmissionComment` - """ - model = AssignmentSubmissionComment() - if include_optional: - return AssignmentSubmissionComment( - id = '', - user = '', - submission = '', - var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - comment = '', - unread = True - ) - else: - return AssignmentSubmissionComment( - ) - """ - - def testAssignmentSubmissionComment(self): - """Test AssignmentSubmissionComment""" - # 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_assignment_submission_comment_creation.py b/test/test_assignment_submission_comment_creation.py deleted file mode 100644 index 8693626..0000000 --- a/test/test_assignment_submission_comment_creation.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_comment_creation import AssignmentSubmissionCommentCreation - -class TestAssignmentSubmissionCommentCreation(unittest.TestCase): - """AssignmentSubmissionCommentCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionCommentCreation: - """Test AssignmentSubmissionCommentCreation - 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 `AssignmentSubmissionCommentCreation` - """ - model = AssignmentSubmissionCommentCreation() - if include_optional: - return AssignmentSubmissionCommentCreation( - comment = '' - ) - else: - return AssignmentSubmissionCommentCreation( - comment = '', - ) - """ - - def testAssignmentSubmissionCommentCreation(self): - """Test AssignmentSubmissionCommentCreation""" - # 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_assignment_submission_comments.py b/test/test_assignment_submission_comments.py deleted file mode 100644 index 1d322a6..0000000 --- a/test/test_assignment_submission_comments.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_comments import AssignmentSubmissionComments - -class TestAssignmentSubmissionComments(unittest.TestCase): - """AssignmentSubmissionComments unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionComments: - """Test AssignmentSubmissionComments - 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 `AssignmentSubmissionComments` - """ - model = AssignmentSubmissionComments() - if include_optional: - return AssignmentSubmissionComments( - total = 1.337, - unread = 1.337 - ) - else: - return AssignmentSubmissionComments( - ) - """ - - def testAssignmentSubmissionComments(self): - """Test AssignmentSubmissionComments""" - # 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_assignment_submission_history.py b/test/test_assignment_submission_history.py deleted file mode 100644 index 492dd23..0000000 --- a/test/test_assignment_submission_history.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_history import AssignmentSubmissionHistory - -class TestAssignmentSubmissionHistory(unittest.TestCase): - """AssignmentSubmissionHistory unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionHistory: - """Test AssignmentSubmissionHistory - 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 `AssignmentSubmissionHistory` - """ - model = AssignmentSubmissionHistory() - if include_optional: - return AssignmentSubmissionHistory( - var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - classroom = '', - assignment = '', - submission = '', - users = [ - '' - ], - source = 'lti', - state = 'created', - draft_grade = 1.337, - grade = 1.337, - max_points = 1.337, - comment = '', - due_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - attachment = flat_api.models.assignment_submission_history_attachment.AssignmentSubmissionHistory_attachment( - score = '', - revision = '', - title = '', ) - ) - else: - return AssignmentSubmissionHistory( - var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - users = [ - '' - ], - ) - """ - - def testAssignmentSubmissionHistory(self): - """Test AssignmentSubmissionHistory""" - # 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_assignment_submission_history_attachment.py b/test/test_assignment_submission_history_attachment.py deleted file mode 100644 index c1bc26b..0000000 --- a/test/test_assignment_submission_history_attachment.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_history_attachment import AssignmentSubmissionHistoryAttachment - -class TestAssignmentSubmissionHistoryAttachment(unittest.TestCase): - """AssignmentSubmissionHistoryAttachment unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionHistoryAttachment: - """Test AssignmentSubmissionHistoryAttachment - 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 `AssignmentSubmissionHistoryAttachment` - """ - model = AssignmentSubmissionHistoryAttachment() - if include_optional: - return AssignmentSubmissionHistoryAttachment( - score = '', - revision = '', - title = '' - ) - else: - return AssignmentSubmissionHistoryAttachment( - ) - """ - - def testAssignmentSubmissionHistoryAttachment(self): - """Test AssignmentSubmissionHistoryAttachment""" - # 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_assignment_submission_history_state.py b/test/test_assignment_submission_history_state.py deleted file mode 100644 index 6e0357e..0000000 --- a/test/test_assignment_submission_history_state.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_history_state import AssignmentSubmissionHistoryState - -class TestAssignmentSubmissionHistoryState(unittest.TestCase): - """AssignmentSubmissionHistoryState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAssignmentSubmissionHistoryState(self): - """Test AssignmentSubmissionHistoryState""" - # inst = AssignmentSubmissionHistoryState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_assignment_submission_lti.py b/test/test_assignment_submission_lti.py deleted file mode 100644 index 06c386a..0000000 --- a/test/test_assignment_submission_lti.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_lti import AssignmentSubmissionLti - -class TestAssignmentSubmissionLti(unittest.TestCase): - """AssignmentSubmissionLti unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionLti: - """Test AssignmentSubmissionLti - 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 `AssignmentSubmissionLti` - """ - model = AssignmentSubmissionLti() - if include_optional: - return AssignmentSubmissionLti( - sourcedid = '' - ) - else: - return AssignmentSubmissionLti( - sourcedid = '', - ) - """ - - def testAssignmentSubmissionLti(self): - """Test AssignmentSubmissionLti""" - # 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_assignment_submission_playback_inner.py b/test/test_assignment_submission_playback_inner.py deleted file mode 100644 index 53d9c8b..0000000 --- a/test/test_assignment_submission_playback_inner.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_playback_inner import AssignmentSubmissionPlaybackInner - -class TestAssignmentSubmissionPlaybackInner(unittest.TestCase): - """AssignmentSubmissionPlaybackInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionPlaybackInner: - """Test AssignmentSubmissionPlaybackInner - 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 `AssignmentSubmissionPlaybackInner` - """ - model = AssignmentSubmissionPlaybackInner() - if include_optional: - return AssignmentSubmissionPlaybackInner( - score = '', - nb_play_attempt = 1.337 - ) - else: - return AssignmentSubmissionPlaybackInner( - score = '', - nb_play_attempt = 1.337, - ) - """ - - def testAssignmentSubmissionPlaybackInner(self): - """Test AssignmentSubmissionPlaybackInner""" - # 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_assignment_submission_state.py b/test/test_assignment_submission_state.py deleted file mode 100644 index 826d569..0000000 --- a/test/test_assignment_submission_state.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_state import AssignmentSubmissionState - -class TestAssignmentSubmissionState(unittest.TestCase): - """AssignmentSubmissionState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAssignmentSubmissionState(self): - """Test AssignmentSubmissionState""" - # inst = AssignmentSubmissionState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_assignment_submission_update.py b/test/test_assignment_submission_update.py deleted file mode 100644 index ea3e9d9..0000000 --- a/test/test_assignment_submission_update.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_submission_update import AssignmentSubmissionUpdate - -class TestAssignmentSubmissionUpdate(unittest.TestCase): - """AssignmentSubmissionUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentSubmissionUpdate: - """Test AssignmentSubmissionUpdate - 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 `AssignmentSubmissionUpdate` - """ - model = AssignmentSubmissionUpdate() - if include_optional: - return AssignmentSubmissionUpdate( - attachments = [ - {"type":"flat","score":"000000000000000001","sharingMode":"copy"} - ], - submit = True, - draft_grade = 0, - grade = 0, - exercises_ids = [ - '' - ], - var_return = True - ) - else: - return AssignmentSubmissionUpdate( - ) - """ - - def testAssignmentSubmissionUpdate(self): - """Test AssignmentSubmissionUpdate""" - # 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_assignment_type.py b/test/test_assignment_type.py deleted file mode 100644 index d96e979..0000000 --- a/test/test_assignment_type.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_type import AssignmentType - -class TestAssignmentType(unittest.TestCase): - """AssignmentType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testAssignmentType(self): - """Test AssignmentType""" - # inst = AssignmentType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_assignment_update.py b/test/test_assignment_update.py deleted file mode 100644 index d61f75c..0000000 --- a/test/test_assignment_update.py +++ /dev/null @@ -1,64 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.assignment_update import AssignmentUpdate - -class TestAssignmentUpdate(unittest.TestCase): - """AssignmentUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> AssignmentUpdate: - """Test AssignmentUpdate - 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 `AssignmentUpdate` - """ - model = AssignmentUpdate() - if include_optional: - return AssignmentUpdate( - type = 'none', - title = '0', - description = '', - attachments = [ - {"type":"flat","score":"000000000000000001","sharingMode":"copy"} - ], - nb_playback_authorized = 1.337, - toolset = '', - cover_file = '', - cover = '', - max_points = 0, - release_grades = 'auto', - shuffle_exercises = True - ) - else: - return AssignmentUpdate( - ) - """ - - def testAssignmentUpdate(self): - """Test AssignmentUpdate""" - # 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_api.py b/test/test_class_api.py deleted file mode 100644 index 40dbfb3..0000000 --- a/test/test_class_api.py +++ /dev/null @@ -1,242 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.class_api import ClassApi - - -class TestClassApi(unittest.TestCase): - """ClassApi unit test stubs""" - - def setUp(self) -> None: - self.api = ClassApi() - - def tearDown(self) -> None: - pass - - def test_activate_class(self) -> None: - """Test case for activate_class - - Activate the class - """ - pass - - def test_add_class_user(self) -> None: - """Test case for add_class_user - - Add a user to the class - """ - pass - - def test_archive_assignment(self) -> None: - """Test case for archive_assignment - - Archive the assignment - """ - pass - - def test_archive_class(self) -> None: - """Test case for archive_class - - Archive the class - """ - pass - - def test_copy_assignment(self) -> None: - """Test case for copy_assignment - - Copy an assignment - """ - pass - - def test_create_class(self) -> None: - """Test case for create_class - - Create a new class - """ - pass - - def test_create_class_assignment(self) -> None: - """Test case for create_class_assignment - - Assignment creation - """ - pass - - def test_create_submission(self) -> None: - """Test case for create_submission - - Create or edit a submission - """ - pass - - def test_create_test_student_account(self) -> None: - """Test case for create_test_student_account - - Create a test student account - """ - pass - - def test_delete_class_user(self) -> None: - """Test case for delete_class_user - - Remove a user from the class - """ - pass - - def test_delete_submission(self) -> None: - """Test case for delete_submission - - Reset a submission - """ - pass - - def test_delete_submission_comment(self) -> None: - """Test case for delete_submission_comment - - Delete a feedback comment to a submission - """ - pass - - def test_edit_submission(self) -> None: - """Test case for edit_submission - - Edit a submission - """ - pass - - def test_enroll_class(self) -> None: - """Test case for enroll_class - - Join a class - """ - pass - - def test_export_submissions_reviews_as_csv(self) -> None: - """Test case for export_submissions_reviews_as_csv - - CSV Grades exports - """ - pass - - def test_export_submissions_reviews_as_excel(self) -> None: - """Test case for export_submissions_reviews_as_excel - - Excel Grades exports - """ - pass - - def test_get_class(self) -> None: - """Test case for get_class - - Get the details of a single class - """ - pass - - def test_get_score_submissions(self) -> None: - """Test case for get_score_submissions - - List submissions related to the score - """ - pass - - def test_get_submission(self) -> None: - """Test case for get_submission - - Get a student submission - """ - pass - - def test_get_submission_comments(self) -> None: - """Test case for get_submission_comments - - List the feedback comments of a submission - """ - pass - - def test_get_submission_history(self) -> None: - """Test case for get_submission_history - - Get the history of the submission - """ - pass - - def test_get_submissions(self) -> None: - """Test case for get_submissions - - List the students' submissions - """ - pass - - def test_list_assignments(self) -> None: - """Test case for list_assignments - - Assignments listing - """ - pass - - def test_list_class_student_submissions(self) -> None: - """Test case for list_class_student_submissions - - List the submissions for a student - """ - pass - - def test_list_classes(self) -> None: - """Test case for list_classes - - List the classes available for the current user - """ - pass - - def test_post_submission_comment(self) -> None: - """Test case for post_submission_comment - - Add a feedback comment to a submission - """ - pass - - def test_unarchive_assignment(self) -> None: - """Test case for unarchive_assignment - - Unarchive the assignment. - """ - pass - - def test_unarchive_class(self) -> None: - """Test case for unarchive_class - - Unarchive the class - """ - pass - - def test_update_class(self) -> None: - """Test case for update_class - - Update the class - """ - pass - - def test_update_submission_comment(self) -> None: - """Test case for update_submission_comment - - Update a feedback comment to a submission - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_class_assignment.py b/test/test_class_assignment.py deleted file mode 100644 index 2d5b6f1..0000000 --- a/test/test_class_assignment.py +++ /dev/null @@ -1,112 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_assignment import ClassAssignment - -class TestClassAssignment(unittest.TestCase): - """ClassAssignment unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAssignment: - """Test ClassAssignment - 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 `ClassAssignment` - """ - model = ClassAssignment() - if include_optional: - return ClassAssignment( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - description = '', - cover = '', - cover_file = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - use_dedicated_attachments = True, - max_points = 1.337, - release_grades = 'auto', - shuffle_exercises = True, - toolset = '', - nb_playback_authorized = 1.337, - creator = '', - state = 'draft', - classroom = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - scheduled_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - due_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - assignee_mode = 'everyone', - assigned_students = [ - '' - ], - submissions = [ - {"id":"58c4955c226ffff257211a90","classroom":"58c4725345cd836264f0b29e","assignment":"58c49068524c03ec576ca43c","creator":"559eb5c7f0d4d5e46d03781d","creationDate":"2020-08-12T00:25:00.748000Z","submissionDate":"2020-08-12T00:45:22.748000Z","attachments":[{"type":"flat","score":"58c4955a226ffff257211a8d","title":"Hello - Student"}],"returnDate":"2020-08-15T00:25:00.748000Z","returnCreator":"559eb5c7f0d4d5e46d000000","grade":80,"draftGrade":82,"googleClassroom":{"id":"CgsI-00000000000","state":"turned_in","alternateLink":"http://classroom.google.com/c/music-theory/a/first-assignment/submissions/student/my-submission"}} - ], - google_classroom = {"id":"1235665432","state":"draft","alternateLink":"http://classroom.google.com/c/music-theory/a/first-assignment/detail"}, - microsoft_graph = {"id":"8e460d32-d2d4-46b3-8e1a-9b7677a48fda","state":"draft","alternateLink":"https://teams.microsoft.com/l/entity","categories":["0a012acd-6e78-4cd0-89a9-80d296e48f82"]}, - mfc = flat_api.models.class_assignment_mfc.ClassAssignment_mfc( - id = '', - alternate_link = '', ), - canvas = flat_api.models.class_assignment_canvas.ClassAssignment_canvas( - id = '', - alternate_link = '', ), - lti = flat_api.models.class_assignment_lti.ClassAssignment_lti( - id = '', ), - issue = '' - ) - else: - return ClassAssignment( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - ) - """ - - def testClassAssignment(self): - """Test ClassAssignment""" - # 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_assignment_canvas.py b/test/test_class_assignment_canvas.py deleted file mode 100644 index 665bef5..0000000 --- a/test/test_class_assignment_canvas.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_assignment_canvas import ClassAssignmentCanvas - -class TestClassAssignmentCanvas(unittest.TestCase): - """ClassAssignmentCanvas unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAssignmentCanvas: - """Test ClassAssignmentCanvas - 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 `ClassAssignmentCanvas` - """ - model = ClassAssignmentCanvas() - if include_optional: - return ClassAssignmentCanvas( - id = '', - alternate_link = '' - ) - else: - return ClassAssignmentCanvas( - ) - """ - - def testClassAssignmentCanvas(self): - """Test ClassAssignmentCanvas""" - # 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_assignment_lti.py b/test/test_class_assignment_lti.py deleted file mode 100644 index d4d5045..0000000 --- a/test/test_class_assignment_lti.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_assignment_lti import ClassAssignmentLti - -class TestClassAssignmentLti(unittest.TestCase): - """ClassAssignmentLti unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAssignmentLti: - """Test ClassAssignmentLti - 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 `ClassAssignmentLti` - """ - model = ClassAssignmentLti() - if include_optional: - return ClassAssignmentLti( - id = '' - ) - else: - return ClassAssignmentLti( - ) - """ - - def testClassAssignmentLti(self): - """Test ClassAssignmentLti""" - # 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_assignment_mfc.py b/test/test_class_assignment_mfc.py deleted file mode 100644 index e6eed45..0000000 --- a/test/test_class_assignment_mfc.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_assignment_mfc import ClassAssignmentMfc - -class TestClassAssignmentMfc(unittest.TestCase): - """ClassAssignmentMfc unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAssignmentMfc: - """Test ClassAssignmentMfc - 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 `ClassAssignmentMfc` - """ - model = ClassAssignmentMfc() - if include_optional: - return ClassAssignmentMfc( - id = '', - alternate_link = '' - ) - else: - return ClassAssignmentMfc( - ) - """ - - def testClassAssignmentMfc(self): - """Test ClassAssignmentMfc""" - # 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_assignment_update.py b/test/test_class_assignment_update.py deleted file mode 100644 index c29ef7d..0000000 --- a/test/test_class_assignment_update.py +++ /dev/null @@ -1,77 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_assignment_update import ClassAssignmentUpdate - -class TestClassAssignmentUpdate(unittest.TestCase): - """ClassAssignmentUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAssignmentUpdate: - """Test ClassAssignmentUpdate - 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 `ClassAssignmentUpdate` - """ - model = ClassAssignmentUpdate() - if include_optional: - return ClassAssignmentUpdate( - type = 'none', - title = '0', - description = '', - attachments = [ - {"type":"flat","score":"000000000000000001","sharingMode":"copy"} - ], - nb_playback_authorized = 1.337, - toolset = '', - cover_file = '', - cover = '', - max_points = 0, - release_grades = 'auto', - shuffle_exercises = True, - state = 'draft', - due_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - scheduled_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - google_classroom = flat_api.models.class_assignment_update_google_classroom.ClassAssignmentUpdate_googleClassroom( - topic_id = '', ), - microsoft_graph = flat_api.models.class_assignment_update_microsoft_graph.ClassAssignmentUpdate_microsoftGraph( - categories = [ - '' - ], ), - assignee_mode = 'everyone', - assigned_students = [ - '' - ] - ) - else: - return ClassAssignmentUpdate( - ) - """ - - def testClassAssignmentUpdate(self): - """Test ClassAssignmentUpdate""" - # 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_assignment_update_google_classroom.py b/test/test_class_assignment_update_google_classroom.py deleted file mode 100644 index a60d32f..0000000 --- a/test/test_class_assignment_update_google_classroom.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_assignment_update_google_classroom import ClassAssignmentUpdateGoogleClassroom - -class TestClassAssignmentUpdateGoogleClassroom(unittest.TestCase): - """ClassAssignmentUpdateGoogleClassroom unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAssignmentUpdateGoogleClassroom: - """Test ClassAssignmentUpdateGoogleClassroom - 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 `ClassAssignmentUpdateGoogleClassroom` - """ - model = ClassAssignmentUpdateGoogleClassroom() - if include_optional: - return ClassAssignmentUpdateGoogleClassroom( - topic_id = '' - ) - else: - return ClassAssignmentUpdateGoogleClassroom( - ) - """ - - def testClassAssignmentUpdateGoogleClassroom(self): - """Test ClassAssignmentUpdateGoogleClassroom""" - # 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_assignment_update_microsoft_graph.py b/test/test_class_assignment_update_microsoft_graph.py deleted file mode 100644 index f074524..0000000 --- a/test/test_class_assignment_update_microsoft_graph.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_assignment_update_microsoft_graph import ClassAssignmentUpdateMicrosoftGraph - -class TestClassAssignmentUpdateMicrosoftGraph(unittest.TestCase): - """ClassAssignmentUpdateMicrosoftGraph unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAssignmentUpdateMicrosoftGraph: - """Test ClassAssignmentUpdateMicrosoftGraph - 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 `ClassAssignmentUpdateMicrosoftGraph` - """ - model = ClassAssignmentUpdateMicrosoftGraph() - if include_optional: - return ClassAssignmentUpdateMicrosoftGraph( - categories = [ - '' - ] - ) - else: - return ClassAssignmentUpdateMicrosoftGraph( - ) - """ - - def testClassAssignmentUpdateMicrosoftGraph(self): - """Test ClassAssignmentUpdateMicrosoftGraph""" - # 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_attachment_creation.py b/test/test_class_attachment_creation.py deleted file mode 100644 index a4a53a2..0000000 --- a/test/test_class_attachment_creation.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_attachment_creation import ClassAttachmentCreation - -class TestClassAttachmentCreation(unittest.TestCase): - """ClassAttachmentCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassAttachmentCreation: - """Test ClassAttachmentCreation - 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 `ClassAttachmentCreation` - """ - model = ClassAttachmentCreation() - if include_optional: - return ClassAttachmentCreation( - type = 'rich', - score = '', - worksheet = '', - sharing_mode = 'read', - lock_score_template = True, - url = '', - google_drive_file_id = '' - ) - else: - return ClassAttachmentCreation( - ) - """ - - def testClassAttachmentCreation(self): - """Test ClassAttachmentCreation""" - # 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_creation.py b/test/test_class_creation.py deleted file mode 100644 index 1153a06..0000000 --- a/test/test_class_creation.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_creation import ClassCreation - -class TestClassCreation(unittest.TestCase): - """ClassCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassCreation: - """Test ClassCreation - 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 `ClassCreation` - """ - model = ClassCreation() - if include_optional: - return ClassCreation( - name = '', - section = '', - level = 'elementary', - skills_focused = [ - 'notation' - ], - size = 0 - ) - else: - return ClassCreation( - name = '', - ) - """ - - def testClassCreation(self): - """Test ClassCreation""" - # 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_details.py b/test/test_class_details.py deleted file mode 100644 index 9d59605..0000000 --- a/test/test_class_details.py +++ /dev/null @@ -1,103 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details import ClassDetails - -class TestClassDetails(unittest.TestCase): - """ClassDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetails: - """Test ClassDetails - 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 `ClassDetails` - """ - model = ClassDetails() - if include_optional: - return ClassDetails( - id = '', - state = 'active', - name = '', - section = '', - description = '', - organization = '', - owner = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - enrollment_code = '', - theme = '', - assignments_count = 1.337, - students_group = {"id":"58c4955c226ffff257211a00","name":"5th Grade - Teachers","type":"classTeachers","organization":"0000000000000000000000042","creationDate":"2017-07-02T15:02:40.207000Z","usersCount":2,"readOnly":false}, - teachers_group = {"id":"58c4955c226ffff257211a00","name":"5th Grade - Teachers","type":"classTeachers","organization":"0000000000000000000000042","creationDate":"2017-07-02T15:02:40.207000Z","usersCount":2,"readOnly":false}, - issues = flat_api.models.class_details_issues.ClassDetails_issues( - sync = [ - flat_api.models.class_details_issues_sync_inner.ClassDetails_issues_sync_inner( - id = '', - email = '', - reason = 'otherOrgnanization', ) - ], ), - google_classroom = flat_api.models.class_details_google_classroom.ClassDetails_googleClassroom( - id = '', - alternate_link = '', ), - google_drive = flat_api.models.class_details_google_drive.ClassDetails_googleDrive( - teacher_folder_id = '', - teacher_folder_alternate_link = '', ), - microsoft_graph = flat_api.models.class_details_microsoft_graph.ClassDetails_microsoftGraph( - id = '', ), - lti = flat_api.models.class_details_lti.ClassDetails_lti( - context_id = '', - context_title = '', - context_label = '', ), - canvas = flat_api.models.class_details_canvas.ClassDetails_canvas( - id = '', - domain = '', ), - mfc = flat_api.models.class_details_mfc.ClassDetails_mfc( - id = '', - alternate_link = '', ), - clever = flat_api.models.class_details_clever.ClassDetails_clever( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - subject = 'english/language arts', - term_name = '', - term_start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - term_end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), ), - level = 'elementary', - skills_focused = [ - 'notation' - ], - size = 1.337 - ) - else: - return ClassDetails( - id = '', - ) - """ - - def testClassDetails(self): - """Test ClassDetails""" - # 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_details_canvas.py b/test/test_class_details_canvas.py deleted file mode 100644 index 4b94bc2..0000000 --- a/test/test_class_details_canvas.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_canvas import ClassDetailsCanvas - -class TestClassDetailsCanvas(unittest.TestCase): - """ClassDetailsCanvas unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsCanvas: - """Test ClassDetailsCanvas - 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 `ClassDetailsCanvas` - """ - model = ClassDetailsCanvas() - if include_optional: - return ClassDetailsCanvas( - id = '', - domain = '' - ) - else: - return ClassDetailsCanvas( - ) - """ - - def testClassDetailsCanvas(self): - """Test ClassDetailsCanvas""" - # 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_details_clever.py b/test/test_class_details_clever.py deleted file mode 100644 index 0d5bb64..0000000 --- a/test/test_class_details_clever.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_clever import ClassDetailsClever - -class TestClassDetailsClever(unittest.TestCase): - """ClassDetailsClever unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsClever: - """Test ClassDetailsClever - 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 `ClassDetailsClever` - """ - model = ClassDetailsClever() - if include_optional: - return ClassDetailsClever( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - subject = 'english/language arts', - term_name = '', - term_start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - term_end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return ClassDetailsClever( - ) - """ - - def testClassDetailsClever(self): - """Test ClassDetailsClever""" - # 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_details_google_classroom.py b/test/test_class_details_google_classroom.py deleted file mode 100644 index 0743a3e..0000000 --- a/test/test_class_details_google_classroom.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_google_classroom import ClassDetailsGoogleClassroom - -class TestClassDetailsGoogleClassroom(unittest.TestCase): - """ClassDetailsGoogleClassroom unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsGoogleClassroom: - """Test ClassDetailsGoogleClassroom - 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 `ClassDetailsGoogleClassroom` - """ - model = ClassDetailsGoogleClassroom() - if include_optional: - return ClassDetailsGoogleClassroom( - id = '', - alternate_link = '' - ) - else: - return ClassDetailsGoogleClassroom( - ) - """ - - def testClassDetailsGoogleClassroom(self): - """Test ClassDetailsGoogleClassroom""" - # 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_details_google_drive.py b/test/test_class_details_google_drive.py deleted file mode 100644 index 297b0b9..0000000 --- a/test/test_class_details_google_drive.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_google_drive import ClassDetailsGoogleDrive - -class TestClassDetailsGoogleDrive(unittest.TestCase): - """ClassDetailsGoogleDrive unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsGoogleDrive: - """Test ClassDetailsGoogleDrive - 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 `ClassDetailsGoogleDrive` - """ - model = ClassDetailsGoogleDrive() - if include_optional: - return ClassDetailsGoogleDrive( - teacher_folder_id = '', - teacher_folder_alternate_link = '' - ) - else: - return ClassDetailsGoogleDrive( - ) - """ - - def testClassDetailsGoogleDrive(self): - """Test ClassDetailsGoogleDrive""" - # 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_details_issues.py b/test/test_class_details_issues.py deleted file mode 100644 index 5b9a259..0000000 --- a/test/test_class_details_issues.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_issues import ClassDetailsIssues - -class TestClassDetailsIssues(unittest.TestCase): - """ClassDetailsIssues unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsIssues: - """Test ClassDetailsIssues - 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 `ClassDetailsIssues` - """ - model = ClassDetailsIssues() - if include_optional: - return ClassDetailsIssues( - sync = [ - flat_api.models.class_details_issues_sync_inner.ClassDetails_issues_sync_inner( - id = '', - email = '', - reason = 'otherOrgnanization', ) - ] - ) - else: - return ClassDetailsIssues( - ) - """ - - def testClassDetailsIssues(self): - """Test ClassDetailsIssues""" - # 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_details_issues_sync_inner.py b/test/test_class_details_issues_sync_inner.py deleted file mode 100644 index 799dbd6..0000000 --- a/test/test_class_details_issues_sync_inner.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_issues_sync_inner import ClassDetailsIssuesSyncInner - -class TestClassDetailsIssuesSyncInner(unittest.TestCase): - """ClassDetailsIssuesSyncInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsIssuesSyncInner: - """Test ClassDetailsIssuesSyncInner - 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 `ClassDetailsIssuesSyncInner` - """ - model = ClassDetailsIssuesSyncInner() - if include_optional: - return ClassDetailsIssuesSyncInner( - id = '', - email = '', - reason = 'otherOrgnanization' - ) - else: - return ClassDetailsIssuesSyncInner( - ) - """ - - def testClassDetailsIssuesSyncInner(self): - """Test ClassDetailsIssuesSyncInner""" - # 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_details_lti.py b/test/test_class_details_lti.py deleted file mode 100644 index 1ea9367..0000000 --- a/test/test_class_details_lti.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_lti import ClassDetailsLti - -class TestClassDetailsLti(unittest.TestCase): - """ClassDetailsLti unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsLti: - """Test ClassDetailsLti - 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 `ClassDetailsLti` - """ - model = ClassDetailsLti() - if include_optional: - return ClassDetailsLti( - context_id = '', - context_title = '', - context_label = '' - ) - else: - return ClassDetailsLti( - ) - """ - - def testClassDetailsLti(self): - """Test ClassDetailsLti""" - # 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_details_mfc.py b/test/test_class_details_mfc.py deleted file mode 100644 index 72d26b3..0000000 --- a/test/test_class_details_mfc.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_mfc import ClassDetailsMfc - -class TestClassDetailsMfc(unittest.TestCase): - """ClassDetailsMfc unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsMfc: - """Test ClassDetailsMfc - 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 `ClassDetailsMfc` - """ - model = ClassDetailsMfc() - if include_optional: - return ClassDetailsMfc( - id = '', - alternate_link = '' - ) - else: - return ClassDetailsMfc( - ) - """ - - def testClassDetailsMfc(self): - """Test ClassDetailsMfc""" - # 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_details_microsoft_graph.py b/test/test_class_details_microsoft_graph.py deleted file mode 100644 index 12ccac2..0000000 --- a/test/test_class_details_microsoft_graph.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_details_microsoft_graph import ClassDetailsMicrosoftGraph - -class TestClassDetailsMicrosoftGraph(unittest.TestCase): - """ClassDetailsMicrosoftGraph unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassDetailsMicrosoftGraph: - """Test ClassDetailsMicrosoftGraph - 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 `ClassDetailsMicrosoftGraph` - """ - model = ClassDetailsMicrosoftGraph() - if include_optional: - return ClassDetailsMicrosoftGraph( - id = '' - ) - else: - return ClassDetailsMicrosoftGraph( - ) - """ - - def testClassDetailsMicrosoftGraph(self): - """Test ClassDetailsMicrosoftGraph""" - # 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_grade_level.py b/test/test_class_grade_level.py deleted file mode 100644 index 5080ae9..0000000 --- a/test/test_class_grade_level.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_grade_level import ClassGradeLevel - -class TestClassGradeLevel(unittest.TestCase): - """ClassGradeLevel unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassGradeLevel(self): - """Test ClassGradeLevel""" - # inst = ClassGradeLevel() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_class_roles.py b/test/test_class_roles.py deleted file mode 100644 index 6df26cb..0000000 --- a/test/test_class_roles.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_roles import ClassRoles - -class TestClassRoles(unittest.TestCase): - """ClassRoles unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassRoles(self): - """Test ClassRoles""" - # inst = ClassRoles() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_class_state.py b/test/test_class_state.py deleted file mode 100644 index bcb66b0..0000000 --- a/test/test_class_state.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_state import ClassState - -class TestClassState(unittest.TestCase): - """ClassState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testClassState(self): - """Test ClassState""" - # inst = ClassState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_class_update.py b/test/test_class_update.py deleted file mode 100644 index 124ee35..0000000 --- a/test/test_class_update.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.class_update import ClassUpdate - -class TestClassUpdate(unittest.TestCase): - """ClassUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ClassUpdate: - """Test ClassUpdate - 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 `ClassUpdate` - """ - model = ClassUpdate() - if include_optional: - return ClassUpdate( - name = '', - section = '', - level = 'elementary', - skills_focused = [ - 'notation' - ], - size = 0 - ) - else: - return ClassUpdate( - ) - """ - - def testClassUpdate(self): - """Test ClassUpdate""" - # 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_collection.py b/test/test_collection.py deleted file mode 100644 index 726f669..0000000 --- a/test/test_collection.py +++ /dev/null @@ -1,146 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.collection import Collection - -class TestCollection(unittest.TestCase): - """Collection unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Collection: - """Test Collection - 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 `Collection` - """ - model = Collection() - if include_optional: - return Collection( - id = '', - title = '', - html_url = '', - type = 'root', - privacy = 'private', - sharing_key = '', - app = flat_api.models.collection_app.CollectionApp( - id = '', - name = '', - logo = '', ), - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - user = flat_api.models.user_public_summary.UserPublicSummary( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', ), - organization = '', - rights = {"aclRead":true,"aclWrite":true,"aclAdmin":true,"isCollaborator":true}, - collaborators = [ - flat_api.models.resource_collaborator.ResourceCollaborator( - acl_read = True, - acl_write = True, - acl_admin = True, - is_collaborator = True, - collaborator_type = 'owner', - id = '', - date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - score = '', - collection = '', - user = flat_api.models.user_public.UserPublic( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - bio = '', - registration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - liked_scores_count = 56, - followers_count = 56, - following_count = 56, - owned_public_scores_count = 56, - cover_picture = '', - profile_theme = '', - instruments = [ - '' - ], - links = flat_api.models.user_community_profile_links.UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '', ), ), - group = {"id":"0000000000000000000000043","name":"5th grade","type":"classTeachers","userCount":24,"readOnly":true,"organization":"0000000000000000000000042","creationDate":"2015-01-19T00:22:02.387000Z"}, - user_email = '', - invited = True, ) - ], - capabilities = flat_api.models.collection_capabilities.Collection_capabilities( - can_edit = True, - can_share = True, - can_delete = True, - can_add_scores = True, - can_delete_scores = True, ), - collections = [ - '' - ] - ) - else: - return Collection( - capabilities = flat_api.models.collection_capabilities.Collection_capabilities( - can_edit = True, - can_share = True, - can_delete = True, - can_add_scores = True, - can_delete_scores = True, ), - ) - """ - - def testCollection(self): - """Test Collection""" - # 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_collection_api.py b/test/test_collection_api.py deleted file mode 100644 index fe1bd62..0000000 --- a/test/test_collection_api.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.collection_api import CollectionApi - - -class TestCollectionApi(unittest.TestCase): - """CollectionApi unit test stubs""" - - def setUp(self) -> None: - self.api = CollectionApi() - - def tearDown(self) -> None: - pass - - def test_add_score_to_collection(self) -> None: - """Test case for add_score_to_collection - - Add a score to the collection - """ - pass - - def test_create_collection(self) -> None: - """Test case for create_collection - - Create a new collection - """ - pass - - def test_delete_collection(self) -> None: - """Test case for delete_collection - - Delete the collection - """ - pass - - def test_delete_score_from_collection(self) -> None: - """Test case for delete_score_from_collection - - Delete a score from the collection - """ - pass - - def test_edit_collection(self) -> None: - """Test case for edit_collection - - Update a collection's metadata - """ - pass - - def test_get_collection(self) -> None: - """Test case for get_collection - - Get collection details - """ - pass - - def test_list_collection_scores(self) -> None: - """Test case for list_collection_scores - - List the scores contained in a collection - """ - pass - - def test_list_collections(self) -> None: - """Test case for list_collections - - List the collections - """ - pass - - def test_untrash_collection(self) -> None: - """Test case for untrash_collection - - Untrash a collection - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_collection_app.py b/test/test_collection_app.py deleted file mode 100644 index 32ab923..0000000 --- a/test/test_collection_app.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.collection_app import CollectionApp - -class TestCollectionApp(unittest.TestCase): - """CollectionApp unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CollectionApp: - """Test CollectionApp - 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 `CollectionApp` - """ - model = CollectionApp() - if include_optional: - return CollectionApp( - id = '', - name = '', - logo = '' - ) - else: - return CollectionApp( - ) - """ - - def testCollectionApp(self): - """Test CollectionApp""" - # 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_collection_capabilities.py b/test/test_collection_capabilities.py deleted file mode 100644 index bcf7374..0000000 --- a/test/test_collection_capabilities.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.collection_capabilities import CollectionCapabilities - -class TestCollectionCapabilities(unittest.TestCase): - """CollectionCapabilities unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CollectionCapabilities: - """Test CollectionCapabilities - 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 `CollectionCapabilities` - """ - model = CollectionCapabilities() - if include_optional: - return CollectionCapabilities( - can_edit = True, - can_share = True, - can_delete = True, - can_add_scores = True, - can_delete_scores = True - ) - else: - return CollectionCapabilities( - can_edit = True, - can_share = True, - can_delete = True, - can_add_scores = True, - can_delete_scores = True, - ) - """ - - def testCollectionCapabilities(self): - """Test CollectionCapabilities""" - # 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_collection_creation.py b/test/test_collection_creation.py deleted file mode 100644 index 1ecbc8c..0000000 --- a/test/test_collection_creation.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.collection_creation import CollectionCreation - -class TestCollectionCreation(unittest.TestCase): - """CollectionCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CollectionCreation: - """Test CollectionCreation - 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 `CollectionCreation` - """ - model = CollectionCreation() - if include_optional: - return CollectionCreation( - title = '0', - privacy = 'private' - ) - else: - return CollectionCreation( - title = '0', - privacy = 'private', - ) - """ - - def testCollectionCreation(self): - """Test CollectionCreation""" - # 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_collection_modification.py b/test/test_collection_modification.py deleted file mode 100644 index 358826d..0000000 --- a/test/test_collection_modification.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.collection_modification import CollectionModification - -class TestCollectionModification(unittest.TestCase): - """CollectionModification unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> CollectionModification: - """Test CollectionModification - 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 `CollectionModification` - """ - model = CollectionModification() - if include_optional: - return CollectionModification( - title = '0', - privacy = 'private' - ) - else: - return CollectionModification( - ) - """ - - def testCollectionModification(self): - """Test CollectionModification""" - # 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_collection_privacy.py b/test/test_collection_privacy.py deleted file mode 100644 index feff8d1..0000000 --- a/test/test_collection_privacy.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.collection_privacy import CollectionPrivacy - -class TestCollectionPrivacy(unittest.TestCase): - """CollectionPrivacy unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCollectionPrivacy(self): - """Test CollectionPrivacy""" - # inst = CollectionPrivacy() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_collection_type.py b/test/test_collection_type.py deleted file mode 100644 index 45f62b9..0000000 --- a/test/test_collection_type.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.collection_type import CollectionType - -class TestCollectionType(unittest.TestCase): - """CollectionType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testCollectionType(self): - """Test CollectionType""" - # inst = CollectionType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_edu_library.py b/test/test_edu_library.py deleted file mode 100644 index d4a35f5..0000000 --- a/test/test_edu_library.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_library import EduLibrary - -class TestEduLibrary(unittest.TestCase): - """EduLibrary unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduLibrary: - """Test EduLibrary - 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 `EduLibrary` - """ - model = EduLibrary() - if include_optional: - return EduLibrary( - id = '', - name = '', - type = 'myResources', - visibility = 'private' - ) - else: - return EduLibrary( - ) - """ - - def testEduLibrary(self): - """Test EduLibrary""" - # 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_edu_resource.py b/test/test_edu_resource.py deleted file mode 100644 index d147303..0000000 --- a/test/test_edu_resource.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource import EduResource - -class TestEduResource(unittest.TestCase): - """EduResource unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResource: - """Test EduResource - 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 `EduResource` - """ - model = EduResource() - if include_optional: - return EduResource( - id = '', - creator = '', - type = 'assignment', - privacy = 'private', - tags = [ - '' - ], - parent = '', - title = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - update_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - resource = flat_api.models.edu_resource_resource.EduResource_resource( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - description = '', - cover = '', - cover_file = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - use_dedicated_attachments = True, - max_points = 1.337, - release_grades = 'auto', - shuffle_exercises = True, - toolset = '', - nb_playback_authorized = 1.337, ), - capabilities = flat_api.models.edu_resource_capabilities.EduResource_capabilities( - can_edit = True, - can_add_resources = True, - can_add_folders = True, ) - ) - else: - return EduResource( - id = '', - type = 'assignment', - title = '', - capabilities = flat_api.models.edu_resource_capabilities.EduResource_capabilities( - can_edit = True, - can_add_resources = True, - can_add_folders = True, ), - ) - """ - - def testEduResource(self): - """Test EduResource""" - # 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_edu_resource_capabilities.py b/test/test_edu_resource_capabilities.py deleted file mode 100644 index 58078e5..0000000 --- a/test/test_edu_resource_capabilities.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_capabilities import EduResourceCapabilities - -class TestEduResourceCapabilities(unittest.TestCase): - """EduResourceCapabilities unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceCapabilities: - """Test EduResourceCapabilities - 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 `EduResourceCapabilities` - """ - model = EduResourceCapabilities() - if include_optional: - return EduResourceCapabilities( - can_edit = True, - can_add_resources = True, - can_add_folders = True - ) - else: - return EduResourceCapabilities( - ) - """ - - def testEduResourceCapabilities(self): - """Test EduResourceCapabilities""" - # 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_edu_resource_copy.py b/test/test_edu_resource_copy.py deleted file mode 100644 index c2d2dc4..0000000 --- a/test/test_edu_resource_copy.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_copy import EduResourceCopy - -class TestEduResourceCopy(unittest.TestCase): - """EduResourceCopy unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceCopy: - """Test EduResourceCopy - 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 `EduResourceCopy` - """ - model = EduResourceCopy() - if include_optional: - return EduResourceCopy( - destination = '' - ) - else: - return EduResourceCopy( - destination = '', - ) - """ - - def testEduResourceCopy(self): - """Test EduResourceCopy""" - # 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_edu_resource_creation.py b/test/test_edu_resource_creation.py deleted file mode 100644 index 6b00c3e..0000000 --- a/test/test_edu_resource_creation.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_creation import EduResourceCreation - -class TestEduResourceCreation(unittest.TestCase): - """EduResourceCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceCreation: - """Test EduResourceCreation - 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 `EduResourceCreation` - """ - model = EduResourceCreation() - if include_optional: - return EduResourceCreation( - type = 'assignment', - title = '0', - parent = 'root' - ) - else: - return EduResourceCreation( - type = 'assignment', - title = '0', - ) - """ - - def testEduResourceCreation(self): - """Test EduResourceCreation""" - # 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_edu_resource_lti_link.py b/test/test_edu_resource_lti_link.py deleted file mode 100644 index b350cf4..0000000 --- a/test/test_edu_resource_lti_link.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_lti_link import EduResourceLtiLink - -class TestEduResourceLtiLink(unittest.TestCase): - """EduResourceLtiLink unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceLtiLink: - """Test EduResourceLtiLink - 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 `EduResourceLtiLink` - """ - model = EduResourceLtiLink() - if include_optional: - return EduResourceLtiLink( - lti_url = '' - ) - else: - return EduResourceLtiLink( - lti_url = '', - ) - """ - - def testEduResourceLtiLink(self): - """Test EduResourceLtiLink""" - # 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_edu_resource_move.py b/test/test_edu_resource_move.py deleted file mode 100644 index 833e4a9..0000000 --- a/test/test_edu_resource_move.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_move import EduResourceMove - -class TestEduResourceMove(unittest.TestCase): - """EduResourceMove unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceMove: - """Test EduResourceMove - 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 `EduResourceMove` - """ - model = EduResourceMove() - if include_optional: - return EduResourceMove( - destination = '' - ) - else: - return EduResourceMove( - destination = '', - ) - """ - - def testEduResourceMove(self): - """Test EduResourceMove""" - # 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_edu_resource_privacy.py b/test/test_edu_resource_privacy.py deleted file mode 100644 index 52022e9..0000000 --- a/test/test_edu_resource_privacy.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_privacy import EduResourcePrivacy - -class TestEduResourcePrivacy(unittest.TestCase): - """EduResourcePrivacy unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEduResourcePrivacy(self): - """Test EduResourcePrivacy""" - # inst = EduResourcePrivacy() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_edu_resource_resource.py b/test/test_edu_resource_resource.py deleted file mode 100644 index 11980b2..0000000 --- a/test/test_edu_resource_resource.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_resource import EduResourceResource - -class TestEduResourceResource(unittest.TestCase): - """EduResourceResource unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceResource: - """Test EduResourceResource - 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 `EduResourceResource` - """ - model = EduResourceResource() - if include_optional: - return EduResourceResource( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - description = '', - cover = '', - cover_file = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - use_dedicated_attachments = True, - max_points = 1.337, - release_grades = 'auto', - shuffle_exercises = True, - toolset = '', - nb_playback_authorized = 1.337 - ) - else: - return EduResourceResource( - id = '', - type = 'none', - capabilities = flat_api.models.assignment_copy_response_capabilities.AssignmentCopyResponse_capabilities( - can_edit = True, - can_publish_in_class = True, - can_publish_in_class_error = flat_api.models.assignment_copy_response_capabilities_can_publish_in_class_error.AssignmentCopyResponse_capabilities_canPublishInClassError( - code = '', - message = '', ), - can_archive = True, - can_unarchive = True, ), - title = '', - attachments = [ - {"type":"video","url":"https://www.youtube.com/watch?v=SNbRUiBZ4Uw","title":"Flat - The online collaborative music notation software","description":"Discover Flat on https://flat.io","html":"","thumbnailUrl":"https://i.ytimg.com/vi/SNbRUiBZ4Uw/maxresdefault.jpg","thumbnailHeight":1052,"thumbnailWidth":1868,"authorName":"Flat","authorUrl":"https://www.youtube.com/channel/UCEUIbEP9Rba_g0r4eeGhmXw"} - ], - ) - """ - - def testEduResourceResource(self): - """Test EduResourceResource""" - # 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_edu_resource_type.py b/test/test_edu_resource_type.py deleted file mode 100644 index 81cc59e..0000000 --- a/test/test_edu_resource_type.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_type import EduResourceType - -class TestEduResourceType(unittest.TestCase): - """EduResourceType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testEduResourceType(self): - """Test EduResourceType""" - # inst = EduResourceType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_edu_resource_update.py b/test/test_edu_resource_update.py deleted file mode 100644 index b6ca8dd..0000000 --- a/test/test_edu_resource_update.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_update import EduResourceUpdate - -class TestEduResourceUpdate(unittest.TestCase): - """EduResourceUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceUpdate: - """Test EduResourceUpdate - 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 `EduResourceUpdate` - """ - model = EduResourceUpdate() - if include_optional: - return EduResourceUpdate( - title = '0', - privacy = 'private' - ) - else: - return EduResourceUpdate( - ) - """ - - def testEduResourceUpdate(self): - """Test EduResourceUpdate""" - # 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_edu_resource_use_in_class.py b/test/test_edu_resource_use_in_class.py deleted file mode 100644 index 27c2283..0000000 --- a/test/test_edu_resource_use_in_class.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.edu_resource_use_in_class import EduResourceUseInClass - -class TestEduResourceUseInClass(unittest.TestCase): - """EduResourceUseInClass unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> EduResourceUseInClass: - """Test EduResourceUseInClass - 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 `EduResourceUseInClass` - """ - model = EduResourceUseInClass() - if include_optional: - return EduResourceUseInClass( - classroom = '', - assignment = '' - ) - else: - return EduResourceUseInClass( - classroom = '', - ) - """ - - def testEduResourceUseInClass(self): - """Test EduResourceUseInClass""" - # 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_edu_resources_api.py b/test/test_edu_resources_api.py deleted file mode 100644 index 908200d..0000000 --- a/test/test_edu_resources_api.py +++ /dev/null @@ -1,116 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.edu_resources_api import EduResourcesApi - - -class TestEduResourcesApi(unittest.TestCase): - """EduResourcesApi unit test stubs""" - - def setUp(self) -> None: - self.api = EduResourcesApi() - - def tearDown(self) -> None: - pass - - def test_copy_edu_resource(self) -> None: - """Test case for copy_edu_resource - - Copy an education resource to a Resource Library - """ - pass - - def test_copy_edu_resource_to_demo_class(self) -> None: - """Test case for copy_edu_resource_to_demo_class - - Copy an education assignment to a teacher demo class - """ - pass - - def test_create_edu_resource(self) -> None: - """Test case for create_edu_resource - - Create a new education resource - """ - pass - - def test_create_edu_resource_lti_link(self) -> None: - """Test case for create_edu_resource_lti_link - - Create an LTI link for an education resource - """ - pass - - def test_delete_edu_resource(self) -> None: - """Test case for delete_edu_resource - - Delete an education resource - """ - pass - - def test_get_edu_resource(self) -> None: - """Test case for get_edu_resource - - Get an education resource - """ - pass - - def test_list_edu_libraries(self) -> None: - """Test case for list_edu_libraries - - List the education libraries - """ - pass - - def test_list_edu_resources(self) -> None: - """Test case for list_edu_resources - - List education resources in a library or folder - """ - pass - - def test_move_edu_resource(self) -> None: - """Test case for move_edu_resource - - Move an education resource - """ - pass - - def test_update_edu_resource(self) -> None: - """Test case for update_edu_resource - - Update an education resource metadata - """ - pass - - def test_update_edu_resource_assignment(self) -> None: - """Test case for update_edu_resource_assignment - - Update an education resource assignment - """ - pass - - def test_use_edu_resource_in_class(self) -> None: - """Test case for use_edu_resource_in_class - - Use an education resource in a class - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_flat_error_response.py b/test/test_flat_error_response.py deleted file mode 100644 index bf5ba23..0000000 --- a/test/test_flat_error_response.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.flat_error_response import FlatErrorResponse - -class TestFlatErrorResponse(unittest.TestCase): - """FlatErrorResponse unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> FlatErrorResponse: - """Test FlatErrorResponse - 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 `FlatErrorResponse` - """ - model = FlatErrorResponse() - if include_optional: - return FlatErrorResponse( - code = '', - message = '', - id = '', - param = '' - ) - else: - return FlatErrorResponse( - code = '', - message = '', - ) - """ - - def testFlatErrorResponse(self): - """Test FlatErrorResponse""" - # 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_flat_locales.py b/test/test_flat_locales.py deleted file mode 100644 index c164475..0000000 --- a/test/test_flat_locales.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.flat_locales import FlatLocales - -class TestFlatLocales(unittest.TestCase): - """FlatLocales unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testFlatLocales(self): - """Test FlatLocales""" - # inst = FlatLocales() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_google_classroom_coursework.py b/test/test_google_classroom_coursework.py deleted file mode 100644 index 05ecca0..0000000 --- a/test/test_google_classroom_coursework.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.google_classroom_coursework import GoogleClassroomCoursework - -class TestGoogleClassroomCoursework(unittest.TestCase): - """GoogleClassroomCoursework unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> GoogleClassroomCoursework: - """Test GoogleClassroomCoursework - 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 `GoogleClassroomCoursework` - """ - model = GoogleClassroomCoursework() - if include_optional: - return GoogleClassroomCoursework( - id = '', - state = '', - alternate_link = '', - topic_id = '' - ) - else: - return GoogleClassroomCoursework( - ) - """ - - def testGoogleClassroomCoursework(self): - """Test GoogleClassroomCoursework""" - # 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_google_classroom_submission.py b/test/test_google_classroom_submission.py deleted file mode 100644 index 3207551..0000000 --- a/test/test_google_classroom_submission.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.google_classroom_submission import GoogleClassroomSubmission - -class TestGoogleClassroomSubmission(unittest.TestCase): - """GoogleClassroomSubmission unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> GoogleClassroomSubmission: - """Test GoogleClassroomSubmission - 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 `GoogleClassroomSubmission` - """ - model = GoogleClassroomSubmission() - if include_optional: - return GoogleClassroomSubmission( - id = '', - state = '', - alternate_link = '' - ) - else: - return GoogleClassroomSubmission( - id = '', - state = '', - alternate_link = '', - ) - """ - - def testGoogleClassroomSubmission(self): - """Test GoogleClassroomSubmission""" - # 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_group.py b/test/test_group.py deleted file mode 100644 index 3f5fb3c..0000000 --- a/test/test_group.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.group import Group - -class TestGroup(unittest.TestCase): - """Group unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Group: - """Test Group - 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 `Group` - """ - model = Group() - if include_optional: - return Group( - id = '', - name = '', - type = 'generic', - users_count = 1.337, - read_only = True, - organization = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return Group( - ) - """ - - def testGroup(self): - """Test Group""" - # 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_group_api.py b/test/test_group_api.py deleted file mode 100644 index 34add5b..0000000 --- a/test/test_group_api.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.group_api import GroupApi - - -class TestGroupApi(unittest.TestCase): - """GroupApi unit test stubs""" - - def setUp(self) -> None: - self.api = GroupApi() - - def tearDown(self) -> None: - pass - - def test_get_group_details(self) -> None: - """Test case for get_group_details - - Get group information - """ - pass - - def test_get_group_scores(self) -> None: - """Test case for get_group_scores - - List group's scores - """ - pass - - def test_list_group_users(self) -> None: - """Test case for list_group_users - - List group's users - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_group_details.py b/test/test_group_details.py deleted file mode 100644 index 576df21..0000000 --- a/test/test_group_details.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.group_details import GroupDetails - -class TestGroupDetails(unittest.TestCase): - """GroupDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> GroupDetails: - """Test GroupDetails - 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 `GroupDetails` - """ - model = GroupDetails() - if include_optional: - return GroupDetails( - id = '', - name = '', - type = 'generic', - organization = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - users_count = 1.337, - read_only = True - ) - else: - return GroupDetails( - ) - """ - - def testGroupDetails(self): - """Test GroupDetails""" - # 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_group_type.py b/test/test_group_type.py deleted file mode 100644 index fab9358..0000000 --- a/test/test_group_type.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.group_type import GroupType - -class TestGroupType(unittest.TestCase): - """GroupType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testGroupType(self): - """Test GroupType""" - # inst = GroupType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_license_mode.py b/test/test_license_mode.py deleted file mode 100644 index 85d084b..0000000 --- a/test/test_license_mode.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.license_mode import LicenseMode - -class TestLicenseMode(unittest.TestCase): - """LicenseMode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLicenseMode(self): - """Test LicenseMode""" - # inst = LicenseMode() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_license_sources.py b/test/test_license_sources.py deleted file mode 100644 index dc91bfa..0000000 --- a/test/test_license_sources.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.license_sources import LicenseSources - -class TestLicenseSources(unittest.TestCase): - """LicenseSources unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLicenseSources(self): - """Test LicenseSources""" - # inst = LicenseSources() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_lms_name.py b/test/test_lms_name.py deleted file mode 100644 index 3f78e8b..0000000 --- a/test/test_lms_name.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.lms_name import LmsName - -class TestLmsName(unittest.TestCase): - """LmsName unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testLmsName(self): - """Test LmsName""" - # inst = LmsName() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_lti_credentials.py b/test/test_lti_credentials.py deleted file mode 100644 index 4afc657..0000000 --- a/test/test_lti_credentials.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.lti_credentials import LtiCredentials - -class TestLtiCredentials(unittest.TestCase): - """LtiCredentials unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> LtiCredentials: - """Test LtiCredentials - 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 `LtiCredentials` - """ - model = LtiCredentials() - if include_optional: - return LtiCredentials( - id = '', - name = '', - lms = 'canvas', - organization = '', - creator = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - last_usage = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - consumer_key = '', - consumer_secret = '' - ) - else: - return LtiCredentials( - ) - """ - - def testLtiCredentials(self): - """Test LtiCredentials""" - # 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_lti_credentials_creation.py b/test/test_lti_credentials_creation.py deleted file mode 100644 index 73dee63..0000000 --- a/test/test_lti_credentials_creation.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.lti_credentials_creation import LtiCredentialsCreation - -class TestLtiCredentialsCreation(unittest.TestCase): - """LtiCredentialsCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> LtiCredentialsCreation: - """Test LtiCredentialsCreation - 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 `LtiCredentialsCreation` - """ - model = LtiCredentialsCreation() - if include_optional: - return LtiCredentialsCreation( - name = '', - lms = 'canvas' - ) - else: - return LtiCredentialsCreation( - name = '', - lms = 'canvas', - ) - """ - - def testLtiCredentialsCreation(self): - """Test LtiCredentialsCreation""" - # 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_media_attachment.py b/test/test_media_attachment.py deleted file mode 100644 index a29ebf2..0000000 --- a/test/test_media_attachment.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.media_attachment import MediaAttachment - -class TestMediaAttachment(unittest.TestCase): - """MediaAttachment unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MediaAttachment: - """Test MediaAttachment - 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 `MediaAttachment` - """ - model = MediaAttachment() - if include_optional: - return MediaAttachment( - type = 'rich', - score = '', - revision = '', - worksheet = '', - dedicated = True, - track = '', - sharing_mode = 'read', - lock_score_template = True, - title = '', - description = '', - html = '', - html_width = '', - html_height = '', - url = '', - thumbnail_url = '', - thumbnail_width = 56, - thumbnail_height = 56, - author_name = '', - author_url = '', - icon_url = '', - mime_type = '', - google_drive_file_id = '' - ) - else: - return MediaAttachment( - type = 'rich', - ) - """ - - def testMediaAttachment(self): - """Test MediaAttachment""" - # 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_media_score_sharing_mode.py b/test/test_media_score_sharing_mode.py deleted file mode 100644 index 6b57c6e..0000000 --- a/test/test_media_score_sharing_mode.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.media_score_sharing_mode import MediaScoreSharingMode - -class TestMediaScoreSharingMode(unittest.TestCase): - """MediaScoreSharingMode unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testMediaScoreSharingMode(self): - """Test MediaScoreSharingMode""" - # inst = MediaScoreSharingMode() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_microsoft_graph_assignment.py b/test/test_microsoft_graph_assignment.py deleted file mode 100644 index 89f7a16..0000000 --- a/test/test_microsoft_graph_assignment.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.microsoft_graph_assignment import MicrosoftGraphAssignment - -class TestMicrosoftGraphAssignment(unittest.TestCase): - """MicrosoftGraphAssignment unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MicrosoftGraphAssignment: - """Test MicrosoftGraphAssignment - 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 `MicrosoftGraphAssignment` - """ - model = MicrosoftGraphAssignment() - if include_optional: - return MicrosoftGraphAssignment( - id = '', - state = '', - alternate_link = '', - categories = [ - '' - ] - ) - else: - return MicrosoftGraphAssignment( - ) - """ - - def testMicrosoftGraphAssignment(self): - """Test MicrosoftGraphAssignment""" - # 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_microsoft_graph_submission.py b/test/test_microsoft_graph_submission.py deleted file mode 100644 index 5fb9324..0000000 --- a/test/test_microsoft_graph_submission.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.microsoft_graph_submission import MicrosoftGraphSubmission - -class TestMicrosoftGraphSubmission(unittest.TestCase): - """MicrosoftGraphSubmission unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> MicrosoftGraphSubmission: - """Test MicrosoftGraphSubmission - 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 `MicrosoftGraphSubmission` - """ - model = MicrosoftGraphSubmission() - if include_optional: - return MicrosoftGraphSubmission( - id = '', - state = '' - ) - else: - return MicrosoftGraphSubmission( - id = '', - state = '', - ) - """ - - def testMicrosoftGraphSubmission(self): - """Test MicrosoftGraphSubmission""" - # 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_organization_api.py b/test/test_organization_api.py deleted file mode 100644 index 27fa6e6..0000000 --- a/test/test_organization_api.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.organization_api import OrganizationApi - - -class TestOrganizationApi(unittest.TestCase): - """OrganizationApi unit test stubs""" - - def setUp(self) -> None: - self.api = OrganizationApi() - - def tearDown(self) -> None: - pass - - def test_count_orga_users(self) -> None: - """Test case for count_orga_users - - Count the organization users using the provided filters - """ - pass - - def test_create_lti_credentials(self) -> None: - """Test case for create_lti_credentials - - Create a new couple of LTI 1.x credentials - """ - pass - - def test_create_organization_invitation(self) -> None: - """Test case for create_organization_invitation - - Create a new invitation to join the organization - """ - pass - - def test_create_organization_user(self) -> None: - """Test case for create_organization_user - - Create a new user account - """ - pass - - def test_create_organization_user_access_token(self) -> None: - """Test case for create_organization_user_access_token - - Create a delegated API access token for an organization user - """ - pass - - def test_create_organization_user_signin_link(self) -> None: - """Test case for create_organization_user_signin_link - - Create a sign in link for an organization user - """ - pass - - def test_list_lti_credentials(self) -> None: - """Test case for list_lti_credentials - - List LTI 1.x credentials - """ - pass - - def test_list_organization_invitations(self) -> None: - """Test case for list_organization_invitations - - List the organization invitations - """ - pass - - def test_list_organization_users(self) -> None: - """Test case for list_organization_users - - List the organization users - """ - pass - - def test_remove_organization_invitation(self) -> None: - """Test case for remove_organization_invitation - - Remove an organization invitation - """ - pass - - def test_remove_organization_user(self) -> None: - """Test case for remove_organization_user - - Remove an account from Flat - """ - pass - - def test_revoke_lti_credentials(self) -> None: - """Test case for revoke_lti_credentials - - Revoke LTI 1.x credentials - """ - pass - - def test_update_organization_user(self) -> None: - """Test case for update_organization_user - - Update account information - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_organization_invitation.py b/test/test_organization_invitation.py deleted file mode 100644 index 1ff217f..0000000 --- a/test/test_organization_invitation.py +++ /dev/null @@ -1,66 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.organization_invitation import OrganizationInvitation - -class TestOrganizationInvitation(unittest.TestCase): - """OrganizationInvitation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrganizationInvitation: - """Test OrganizationInvitation - 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 `OrganizationInvitation` - """ - model = OrganizationInvitation() - if include_optional: - return OrganizationInvitation( - id = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - organization = '', - organization_role = 'admin', - custom_code = '', - email = '', - invited_by = '', - allow_multiple_use = True, - used_by = [ - '' - ] - ) - else: - return OrganizationInvitation( - organization = '', - organization_role = 'admin', - custom_code = '', - allow_multiple_use = True, - ) - """ - - def testOrganizationInvitation(self): - """Test OrganizationInvitation""" - # 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_organization_invitation_creation.py b/test/test_organization_invitation_creation.py deleted file mode 100644 index 17fe881..0000000 --- a/test/test_organization_invitation_creation.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.organization_invitation_creation import OrganizationInvitationCreation - -class TestOrganizationInvitationCreation(unittest.TestCase): - """OrganizationInvitationCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrganizationInvitationCreation: - """Test OrganizationInvitationCreation - 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 `OrganizationInvitationCreation` - """ - model = OrganizationInvitationCreation() - if include_optional: - return OrganizationInvitationCreation( - email = '', - organization_role = 'teacher' - ) - else: - return OrganizationInvitationCreation( - ) - """ - - def testOrganizationInvitationCreation(self): - """Test OrganizationInvitationCreation""" - # 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_organization_roles.py b/test/test_organization_roles.py deleted file mode 100644 index b8a15d3..0000000 --- a/test/test_organization_roles.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.organization_roles import OrganizationRoles - -class TestOrganizationRoles(unittest.TestCase): - """OrganizationRoles unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testOrganizationRoles(self): - """Test OrganizationRoles""" - # inst = OrganizationRoles() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_organization_user_access_token_creation.py b/test/test_organization_user_access_token_creation.py deleted file mode 100644 index 1a8ed45..0000000 --- a/test/test_organization_user_access_token_creation.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.organization_user_access_token_creation import OrganizationUserAccessTokenCreation - -class TestOrganizationUserAccessTokenCreation(unittest.TestCase): - """OrganizationUserAccessTokenCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> OrganizationUserAccessTokenCreation: - """Test OrganizationUserAccessTokenCreation - 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 `OrganizationUserAccessTokenCreation` - """ - model = OrganizationUserAccessTokenCreation() - if include_optional: - return OrganizationUserAccessTokenCreation( - scopes = [ - 'account.public_profile' - ] - ) - else: - return OrganizationUserAccessTokenCreation( - scopes = [ - 'account.public_profile' - ], - ) - """ - - def testOrganizationUserAccessTokenCreation(self): - """Test OrganizationUserAccessTokenCreation""" - # 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_resource_collaborator.py b/test/test_resource_collaborator.py deleted file mode 100644 index 0d61bcf..0000000 --- a/test/test_resource_collaborator.py +++ /dev/null @@ -1,102 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.resource_collaborator import ResourceCollaborator - -class TestResourceCollaborator(unittest.TestCase): - """ResourceCollaborator unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ResourceCollaborator: - """Test ResourceCollaborator - 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 `ResourceCollaborator` - """ - model = ResourceCollaborator() - if include_optional: - return ResourceCollaborator( - acl_read = True, - acl_write = True, - acl_admin = True, - is_collaborator = True, - collaborator_type = 'owner', - id = '', - var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - score = '', - collection = '', - user = flat_api.models.user_public.UserPublic( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - bio = '', - registration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - liked_scores_count = 56, - followers_count = 56, - following_count = 56, - owned_public_scores_count = 56, - cover_picture = '', - profile_theme = '', - instruments = [ - '' - ], - links = flat_api.models.user_community_profile_links.UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '', ), ), - group = {"id":"0000000000000000000000043","name":"5th grade","type":"classTeachers","userCount":24,"readOnly":true,"organization":"0000000000000000000000042","creationDate":"2015-01-19T00:22:02.387000Z"}, - user_email = '', - invited = True - ) - else: - return ResourceCollaborator( - acl_read = True, - acl_write = True, - acl_admin = True, - is_collaborator = True, - ) - """ - - def testResourceCollaborator(self): - """Test ResourceCollaborator""" - # 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_resource_collaborator_creation.py b/test/test_resource_collaborator_creation.py deleted file mode 100644 index 26e1dfe..0000000 --- a/test/test_resource_collaborator_creation.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.resource_collaborator_creation import ResourceCollaboratorCreation - -class TestResourceCollaboratorCreation(unittest.TestCase): - """ResourceCollaboratorCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ResourceCollaboratorCreation: - """Test ResourceCollaboratorCreation - 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 `ResourceCollaboratorCreation` - """ - model = ResourceCollaboratorCreation() - if include_optional: - return ResourceCollaboratorCreation( - user = '', - group = '', - user_email = '', - user_token = '', - acl_read = True, - acl_write = True, - acl_admin = True - ) - else: - return ResourceCollaboratorCreation( - ) - """ - - def testResourceCollaboratorCreation(self): - """Test ResourceCollaboratorCreation""" - # 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_resource_rights.py b/test/test_resource_rights.py deleted file mode 100644 index 790e9a6..0000000 --- a/test/test_resource_rights.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.resource_rights import ResourceRights - -class TestResourceRights(unittest.TestCase): - """ResourceRights unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ResourceRights: - """Test ResourceRights - 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 `ResourceRights` - """ - model = ResourceRights() - if include_optional: - return ResourceRights( - acl_read = True, - acl_write = True, - acl_admin = True, - is_collaborator = True, - collaborator_type = 'owner' - ) - else: - return ResourceRights( - acl_read = True, - acl_write = True, - acl_admin = True, - is_collaborator = True, - ) - """ - - def testResourceRights(self): - """Test ResourceRights""" - # 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_score_api.py b/test/test_score_api.py deleted file mode 100644 index 1162a1e..0000000 --- a/test/test_score_api.py +++ /dev/null @@ -1,242 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.score_api import ScoreApi - - -class TestScoreApi(unittest.TestCase): - """ScoreApi unit test stubs""" - - def setUp(self) -> None: - self.api = ScoreApi() - - def tearDown(self) -> None: - pass - - def test_add_score_collaborator(self) -> None: - """Test case for add_score_collaborator - - Add a new collaborator - """ - pass - - def test_add_score_track(self) -> None: - """Test case for add_score_track - - Add a new video or audio track to the score - """ - pass - - def test_create_export_task(self) -> None: - """Test case for create_export_task - - Create a new score export task - """ - pass - - def test_create_score(self) -> None: - """Test case for create_score - - Create a new score - """ - pass - - def test_create_score_revision(self) -> None: - """Test case for create_score_revision - - Create a new revision - """ - pass - - def test_delete_score(self) -> None: - """Test case for delete_score - - Delete a score - """ - pass - - def test_delete_score_comment(self) -> None: - """Test case for delete_score_comment - - Delete a comment - """ - pass - - def test_delete_score_track(self) -> None: - """Test case for delete_score_track - - Remove an audio or video track linked to the score - """ - pass - - def test_edit_score(self) -> None: - """Test case for edit_score - - Edit a score's metadata - """ - pass - - def test_fork_score(self) -> None: - """Test case for fork_score - - Fork a score - """ - pass - - def test_get_group_scores(self) -> None: - """Test case for get_group_scores - - List group's scores - """ - pass - - def test_get_score(self) -> None: - """Test case for get_score - - Get a score's metadata - """ - pass - - def test_get_score_collaborator(self) -> None: - """Test case for get_score_collaborator - - Get a collaborator - """ - pass - - def test_get_score_collaborators(self) -> None: - """Test case for get_score_collaborators - - List the collaborators - """ - pass - - def test_get_score_comments(self) -> None: - """Test case for get_score_comments - - List comments - """ - pass - - def test_get_score_revision(self) -> None: - """Test case for get_score_revision - - Get a score revision - """ - pass - - def test_get_score_revision_data(self) -> None: - """Test case for get_score_revision_data - - Get a score revision data - """ - pass - - def test_get_score_revisions(self) -> None: - """Test case for get_score_revisions - - List the revisions - """ - pass - - def test_get_score_submissions(self) -> None: - """Test case for get_score_submissions - - List submissions related to the score - """ - pass - - def test_get_score_track(self) -> None: - """Test case for get_score_track - - Retrieve the details of an audio or video track linked to a score - """ - pass - - def test_get_user_likes(self) -> None: - """Test case for get_user_likes - - List liked scores - """ - pass - - def test_get_user_scores(self) -> None: - """Test case for get_user_scores - - List user's scores - """ - pass - - def test_list_score_tracks(self) -> None: - """Test case for list_score_tracks - - List the audio or video tracks linked to a score - """ - pass - - def test_mark_score_comment_resolved(self) -> None: - """Test case for mark_score_comment_resolved - - Mark the comment as resolved - """ - pass - - def test_mark_score_comment_unresolved(self) -> None: - """Test case for mark_score_comment_unresolved - - Mark the comment as unresolved - """ - pass - - def test_post_score_comment(self) -> None: - """Test case for post_score_comment - - Post a new comment - """ - pass - - def test_remove_score_collaborator(self) -> None: - """Test case for remove_score_collaborator - - Delete a collaborator - """ - pass - - def test_untrash_score(self) -> None: - """Test case for untrash_score - - Untrash a score - """ - pass - - def test_update_score_comment(self) -> None: - """Test case for update_score_comment - - Update an existing comment - """ - pass - - def test_update_score_track(self) -> None: - """Test case for update_score_track - - Update an audio or video track linked to a score - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_score_comment.py b/test/test_score_comment.py deleted file mode 100644 index 89eae3c..0000000 --- a/test/test_score_comment.py +++ /dev/null @@ -1,71 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_comment import ScoreComment - -class TestScoreComment(unittest.TestCase): - """ScoreComment unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreComment: - """Test ScoreComment - 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 `ScoreComment` - """ - model = ScoreComment() - if include_optional: - return ScoreComment( - id = '', - type = 'document', - user = '', - score = '', - revision = '', - reply_to = '', - var_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - comment = '', - raw_comment = '', - context = {"partUuid":"91982db7-2e6d-285e-7a19-76b4bd005b8b","staffUuid":"9395d8f3-f42b-47b6-8c5d-6ba704961ec0","measureUuids":["e6a6a60b-8710-f819-9a49-e907b19c6f1f","da83d93c-e3a6-3c73-1bbe-15e5131d6437","056ec5eb-9213-df56-6ae8-d9b99673dc48"],"startDpq":1,"stopDpq":1,"startTimePos":2,"stopTimePos":3}, - mentions = [ - '' - ], - resolved = True, - resolved_by = '', - moderation = flat_api.models.score_comment_moderation.ScoreComment_moderation( - hidden = True, - reason = 'spam', ), - spam = True - ) - else: - return ScoreComment( - ) - """ - - def testScoreComment(self): - """Test ScoreComment""" - # 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_score_comment_context.py b/test/test_score_comment_context.py deleted file mode 100644 index bc6839c..0000000 --- a/test/test_score_comment_context.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_comment_context import ScoreCommentContext - -class TestScoreCommentContext(unittest.TestCase): - """ScoreCommentContext unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCommentContext: - """Test ScoreCommentContext - 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 `ScoreCommentContext` - """ - model = ScoreCommentContext() - if include_optional: - return ScoreCommentContext( - part_uuid = '', - staff_idx = 1.337, - staff_uuid = '', - measure_uuids = [ - '' - ], - start_time_pos = 1.337, - stop_time_pos = 1.337, - start_dpq = 1.337, - stop_dpq = 1.337 - ) - else: - return ScoreCommentContext( - part_uuid = '', - measure_uuids = [ - '' - ], - start_time_pos = 1.337, - stop_time_pos = 1.337, - start_dpq = 1.337, - stop_dpq = 1.337, - ) - """ - - def testScoreCommentContext(self): - """Test ScoreCommentContext""" - # 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_score_comment_creation.py b/test/test_score_comment_creation.py deleted file mode 100644 index 4e38efc..0000000 --- a/test/test_score_comment_creation.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_comment_creation import ScoreCommentCreation - -class TestScoreCommentCreation(unittest.TestCase): - """ScoreCommentCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCommentCreation: - """Test ScoreCommentCreation - 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 `ScoreCommentCreation` - """ - model = ScoreCommentCreation() - if include_optional: - return ScoreCommentCreation( - revision = '', - comment = '', - raw_comment = '', - mentions = [ - '' - ], - reply_to = '', - context = {"partUuid":"91982db7-2e6d-285e-7a19-76b4bd005b8b","staffUuid":"9395d8f3-f42b-47b6-8c5d-6ba704961ec0","measureUuids":["e6a6a60b-8710-f819-9a49-e907b19c6f1f","da83d93c-e3a6-3c73-1bbe-15e5131d6437","056ec5eb-9213-df56-6ae8-d9b99673dc48"],"startDpq":1,"stopDpq":1,"startTimePos":2,"stopTimePos":3} - ) - else: - return ScoreCommentCreation( - comment = '', - ) - """ - - def testScoreCommentCreation(self): - """Test ScoreCommentCreation""" - # 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_score_comment_moderation.py b/test/test_score_comment_moderation.py deleted file mode 100644 index f08ca10..0000000 --- a/test/test_score_comment_moderation.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_comment_moderation import ScoreCommentModeration - -class TestScoreCommentModeration(unittest.TestCase): - """ScoreCommentModeration unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCommentModeration: - """Test ScoreCommentModeration - 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 `ScoreCommentModeration` - """ - model = ScoreCommentModeration() - if include_optional: - return ScoreCommentModeration( - hidden = True, - reason = 'spam' - ) - else: - return ScoreCommentModeration( - ) - """ - - def testScoreCommentModeration(self): - """Test ScoreCommentModeration""" - # 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_score_comment_update.py b/test/test_score_comment_update.py deleted file mode 100644 index a763ede..0000000 --- a/test/test_score_comment_update.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_comment_update import ScoreCommentUpdate - -class TestScoreCommentUpdate(unittest.TestCase): - """ScoreCommentUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCommentUpdate: - """Test ScoreCommentUpdate - 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 `ScoreCommentUpdate` - """ - model = ScoreCommentUpdate() - if include_optional: - return ScoreCommentUpdate( - revision = '', - comment = '0', - raw_comment = '0', - context = {"partUuid":"91982db7-2e6d-285e-7a19-76b4bd005b8b","staffUuid":"9395d8f3-f42b-47b6-8c5d-6ba704961ec0","measureUuids":["e6a6a60b-8710-f819-9a49-e907b19c6f1f","da83d93c-e3a6-3c73-1bbe-15e5131d6437","056ec5eb-9213-df56-6ae8-d9b99673dc48"],"startDpq":1,"stopDpq":1,"startTimePos":2,"stopTimePos":3} - ) - else: - return ScoreCommentUpdate( - ) - """ - - def testScoreCommentUpdate(self): - """Test ScoreCommentUpdate""" - # 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_score_comments_counts.py b/test/test_score_comments_counts.py deleted file mode 100644 index e2b7f42..0000000 --- a/test/test_score_comments_counts.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_comments_counts import ScoreCommentsCounts - -class TestScoreCommentsCounts(unittest.TestCase): - """ScoreCommentsCounts unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCommentsCounts: - """Test ScoreCommentsCounts - 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 `ScoreCommentsCounts` - """ - model = ScoreCommentsCounts() - if include_optional: - return ScoreCommentsCounts( - total = 1.337, - unique = 1.337, - weekly = 1.337, - monthly = 1.337 - ) - else: - return ScoreCommentsCounts( - ) - """ - - def testScoreCommentsCounts(self): - """Test ScoreCommentsCounts""" - # 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_score_creation.py b/test/test_score_creation.py deleted file mode 100644 index 46ad268..0000000 --- a/test/test_score_creation.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_creation import ScoreCreation - -class TestScoreCreation(unittest.TestCase): - """ScoreCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCreation: - """Test ScoreCreation - 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 `ScoreCreation` - """ - model = ScoreCreation() - if include_optional: - return ScoreCreation( - title = '', - privacy = 'private', - collection = '', - google_drive_folder = '', - builder_data = flat_api.models.score_creation_builder_data.ScoreCreation_builderData( - score_data = flat_api.models.score_creation_builder_data_score_data.ScoreCreation_builderData_scoreData( - use_tab_staff = True, - use_chord_grid = True, - fifths = 1.337, - nb_beats = 1.337, - beat_type = 1.337, - instruments = [ - flat_api.models.score_creation_builder_data_score_data_instruments_inner.ScoreCreation_builderData_scoreData_instruments_inner( - group = '', - instrument = '', - long_name = '', - short_name = '', - has_quarter_tone = True, ) - ], ), - layout_data = flat_api.models.score_creation_builder_data_layout_data.ScoreCreation_builderData_layoutData( - notes_spacing_coeff = 1.337, - length_unit = 'cm', - page_height = 1.337, - page_width = 1.337, - page_margin_top = 1.337, - page_margin_bottom = 1.337, - page_margin_left = 1.337, - page_margin_right = 1.337, ), ), - filename = '', - data = '', - data_encoding = 'base64', - source = {"googleDrive":"0B-0000000000000001"} - ) - else: - return ScoreCreation( - ) - """ - - def testScoreCreation(self): - """Test ScoreCreation""" - # 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_score_creation_builder_data.py b/test/test_score_creation_builder_data.py deleted file mode 100644 index 37fab37..0000000 --- a/test/test_score_creation_builder_data.py +++ /dev/null @@ -1,88 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_creation_builder_data import ScoreCreationBuilderData - -class TestScoreCreationBuilderData(unittest.TestCase): - """ScoreCreationBuilderData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCreationBuilderData: - """Test ScoreCreationBuilderData - 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 `ScoreCreationBuilderData` - """ - model = ScoreCreationBuilderData() - if include_optional: - return ScoreCreationBuilderData( - score_data = flat_api.models.score_creation_builder_data_score_data.ScoreCreation_builderData_scoreData( - use_tab_staff = True, - use_chord_grid = True, - fifths = 1.337, - nb_beats = 1.337, - beat_type = 1.337, - instruments = [ - flat_api.models.score_creation_builder_data_score_data_instruments_inner.ScoreCreation_builderData_scoreData_instruments_inner( - group = '', - instrument = '', - long_name = '', - short_name = '', - has_quarter_tone = True, ) - ], ), - layout_data = flat_api.models.score_creation_builder_data_layout_data.ScoreCreation_builderData_layoutData( - notes_spacing_coeff = 1.337, - length_unit = 'cm', - page_height = 1.337, - page_width = 1.337, - page_margin_top = 1.337, - page_margin_bottom = 1.337, - page_margin_left = 1.337, - page_margin_right = 1.337, ) - ) - else: - return ScoreCreationBuilderData( - score_data = flat_api.models.score_creation_builder_data_score_data.ScoreCreation_builderData_scoreData( - use_tab_staff = True, - use_chord_grid = True, - fifths = 1.337, - nb_beats = 1.337, - beat_type = 1.337, - instruments = [ - flat_api.models.score_creation_builder_data_score_data_instruments_inner.ScoreCreation_builderData_scoreData_instruments_inner( - group = '', - instrument = '', - long_name = '', - short_name = '', - has_quarter_tone = True, ) - ], ), - ) - """ - - def testScoreCreationBuilderData(self): - """Test ScoreCreationBuilderData""" - # 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_score_creation_builder_data_layout_data.py b/test/test_score_creation_builder_data_layout_data.py deleted file mode 100644 index 84ab514..0000000 --- a/test/test_score_creation_builder_data_layout_data.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_creation_builder_data_layout_data import ScoreCreationBuilderDataLayoutData - -class TestScoreCreationBuilderDataLayoutData(unittest.TestCase): - """ScoreCreationBuilderDataLayoutData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCreationBuilderDataLayoutData: - """Test ScoreCreationBuilderDataLayoutData - 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 `ScoreCreationBuilderDataLayoutData` - """ - model = ScoreCreationBuilderDataLayoutData() - if include_optional: - return ScoreCreationBuilderDataLayoutData( - notes_spacing_coeff = 1.337, - length_unit = 'cm', - page_height = 1.337, - page_width = 1.337, - page_margin_top = 1.337, - page_margin_bottom = 1.337, - page_margin_left = 1.337, - page_margin_right = 1.337 - ) - else: - return ScoreCreationBuilderDataLayoutData( - ) - """ - - def testScoreCreationBuilderDataLayoutData(self): - """Test ScoreCreationBuilderDataLayoutData""" - # 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_score_creation_builder_data_score_data.py b/test/test_score_creation_builder_data_score_data.py deleted file mode 100644 index 98cc15b..0000000 --- a/test/test_score_creation_builder_data_score_data.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_creation_builder_data_score_data import ScoreCreationBuilderDataScoreData - -class TestScoreCreationBuilderDataScoreData(unittest.TestCase): - """ScoreCreationBuilderDataScoreData unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCreationBuilderDataScoreData: - """Test ScoreCreationBuilderDataScoreData - 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 `ScoreCreationBuilderDataScoreData` - """ - model = ScoreCreationBuilderDataScoreData() - if include_optional: - return ScoreCreationBuilderDataScoreData( - use_tab_staff = True, - use_chord_grid = True, - fifths = 1.337, - nb_beats = 1.337, - beat_type = 1.337, - instruments = [ - flat_api.models.score_creation_builder_data_score_data_instruments_inner.ScoreCreation_builderData_scoreData_instruments_inner( - group = '', - instrument = '', - long_name = '', - short_name = '', - has_quarter_tone = True, ) - ] - ) - else: - return ScoreCreationBuilderDataScoreData( - instruments = [ - flat_api.models.score_creation_builder_data_score_data_instruments_inner.ScoreCreation_builderData_scoreData_instruments_inner( - group = '', - instrument = '', - long_name = '', - short_name = '', - has_quarter_tone = True, ) - ], - ) - """ - - def testScoreCreationBuilderDataScoreData(self): - """Test ScoreCreationBuilderDataScoreData""" - # 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_score_creation_builder_data_score_data_instruments_inner.py b/test/test_score_creation_builder_data_score_data_instruments_inner.py deleted file mode 100644 index a750190..0000000 --- a/test/test_score_creation_builder_data_score_data_instruments_inner.py +++ /dev/null @@ -1,58 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_creation_builder_data_score_data_instruments_inner import ScoreCreationBuilderDataScoreDataInstrumentsInner - -class TestScoreCreationBuilderDataScoreDataInstrumentsInner(unittest.TestCase): - """ScoreCreationBuilderDataScoreDataInstrumentsInner unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreCreationBuilderDataScoreDataInstrumentsInner: - """Test ScoreCreationBuilderDataScoreDataInstrumentsInner - 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 `ScoreCreationBuilderDataScoreDataInstrumentsInner` - """ - model = ScoreCreationBuilderDataScoreDataInstrumentsInner() - if include_optional: - return ScoreCreationBuilderDataScoreDataInstrumentsInner( - group = '', - instrument = '', - long_name = '', - short_name = '', - has_quarter_tone = True - ) - else: - return ScoreCreationBuilderDataScoreDataInstrumentsInner( - group = '', - instrument = '', - ) - """ - - def testScoreCreationBuilderDataScoreDataInstrumentsInner(self): - """Test ScoreCreationBuilderDataScoreDataInstrumentsInner""" - # 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_score_creation_type.py b/test/test_score_creation_type.py deleted file mode 100644 index 350a786..0000000 --- a/test/test_score_creation_type.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_creation_type import ScoreCreationType - -class TestScoreCreationType(unittest.TestCase): - """ScoreCreationType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScoreCreationType(self): - """Test ScoreCreationType""" - # inst = ScoreCreationType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_score_details.py b/test/test_score_details.py deleted file mode 100644 index 6e0db09..0000000 --- a/test/test_score_details.py +++ /dev/null @@ -1,216 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_details import ScoreDetails - -class TestScoreDetails(unittest.TestCase): - """ScoreDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreDetails: - """Test ScoreDetails - 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 `ScoreDetails` - """ - model = ScoreDetails() - if include_optional: - return ScoreDetails( - id = '', - sharing_key = '', - title = '', - privacy = 'private', - user = flat_api.models.user_public.UserPublic( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - bio = '', - registration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - liked_scores_count = 56, - followers_count = 56, - following_count = 56, - owned_public_scores_count = 56, - cover_picture = '', - profile_theme = '', - instruments = [ - '' - ], - links = flat_api.models.user_community_profile_links.UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '', ), ), - html_url = '', - subtitle = '', - lyricist = '', - arranger = '', - composer = '', - description = '', - tags = [ - 'Cu2LC4aWwWL9Y864DZtaG' - ], - creation_type = 'original', - license = 'copyright', - license_text = '', - duration_time = 1.337, - number_measures = 56, - main_tempo_qpm = 1.337, - main_key_signature = 1.337, - rights = {"aclRead":true,"aclWrite":true,"aclAdmin":true,"isCollaborator":true}, - collaborators = [ - flat_api.models.resource_collaborator.ResourceCollaborator( - acl_read = True, - acl_write = True, - acl_admin = True, - is_collaborator = True, - collaborator_type = 'owner', - id = '', - date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - score = '', - collection = '', - user = flat_api.models.user_public.UserPublic( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - bio = '', - registration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - liked_scores_count = 56, - followers_count = 56, - following_count = 56, - owned_public_scores_count = 56, - cover_picture = '', - profile_theme = '', - instruments = [ - '' - ], - links = flat_api.models.user_community_profile_links.UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '', ), ), - group = {"id":"0000000000000000000000043","name":"5th grade","type":"classTeachers","userCount":24,"readOnly":true,"organization":"0000000000000000000000042","creationDate":"2015-01-19T00:22:02.387000Z"}, - user_email = '', - invited = True, ) - ], - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - publication_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - highlighted_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - organization = '', - parent_score = '', - instruments = [ - '' - ], - samples = [ - '' - ], - google_drive_file_id = '', - likes = {"total":42,"weekly":10,"monthly":30}, - comments = {"total":42,"unique":35,"weekly":10,"monthly":30}, - views = {"total":42,"weekly":10,"monthly":30}, - plays = {"total":42,"weekly":10,"monthly":30}, - collections = [ - '' - ] - ) - else: - return ScoreDetails( - id = '', - title = '', - privacy = 'private', - user = flat_api.models.user_public.UserPublic( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - bio = '', - registration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - liked_scores_count = 56, - followers_count = 56, - following_count = 56, - owned_public_scores_count = 56, - cover_picture = '', - profile_theme = '', - instruments = [ - '' - ], - links = flat_api.models.user_community_profile_links.UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '', ), ), - html_url = '', - ) - """ - - def testScoreDetails(self): - """Test ScoreDetails""" - # 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_score_fork.py b/test/test_score_fork.py deleted file mode 100644 index 8104244..0000000 --- a/test/test_score_fork.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_fork import ScoreFork - -class TestScoreFork(unittest.TestCase): - """ScoreFork unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreFork: - """Test ScoreFork - 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 `ScoreFork` - """ - model = ScoreFork() - if include_optional: - return ScoreFork( - collection = 'root', - google_drive_disabled = True, - keep_original_title = True - ) - else: - return ScoreFork( - ) - """ - - def testScoreFork(self): - """Test ScoreFork""" - # 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_score_license.py b/test/test_score_license.py deleted file mode 100644 index a30d3e8..0000000 --- a/test/test_score_license.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_license import ScoreLicense - -class TestScoreLicense(unittest.TestCase): - """ScoreLicense unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScoreLicense(self): - """Test ScoreLicense""" - # inst = ScoreLicense() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_score_likes_counts.py b/test/test_score_likes_counts.py deleted file mode 100644 index 51b7811..0000000 --- a/test/test_score_likes_counts.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_likes_counts import ScoreLikesCounts - -class TestScoreLikesCounts(unittest.TestCase): - """ScoreLikesCounts unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreLikesCounts: - """Test ScoreLikesCounts - 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 `ScoreLikesCounts` - """ - model = ScoreLikesCounts() - if include_optional: - return ScoreLikesCounts( - total = 1.337, - weekly = 1.337, - monthly = 1.337 - ) - else: - return ScoreLikesCounts( - total = 1.337, - weekly = 1.337, - monthly = 1.337, - ) - """ - - def testScoreLikesCounts(self): - """Test ScoreLikesCounts""" - # 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_score_modification.py b/test/test_score_modification.py deleted file mode 100644 index 249cbf5..0000000 --- a/test/test_score_modification.py +++ /dev/null @@ -1,65 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_modification import ScoreModification - -class TestScoreModification(unittest.TestCase): - """ScoreModification unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreModification: - """Test ScoreModification - 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 `ScoreModification` - """ - model = ScoreModification() - if include_optional: - return ScoreModification( - title = '', - subtitle = '', - composer = '', - lyricist = '', - arranger = '', - privacy = 'private', - sharing_key = 'bf325375e030fccba00917317c574773100bf03b5fc61486286e564b23e9566b6ed19656dc3c5466a04c9eb07d770063ebd5468bf54d65309a8da56a8235f8f3', - description = '', - tags = [ - '' - ], - creation_type = 'original', - license = 'copyright', - license_text = '' - ) - else: - return ScoreModification( - ) - """ - - def testScoreModification(self): - """Test ScoreModification""" - # 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_score_plays_counts.py b/test/test_score_plays_counts.py deleted file mode 100644 index 083a7ee..0000000 --- a/test/test_score_plays_counts.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_plays_counts import ScorePlaysCounts - -class TestScorePlaysCounts(unittest.TestCase): - """ScorePlaysCounts unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScorePlaysCounts: - """Test ScorePlaysCounts - 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 `ScorePlaysCounts` - """ - model = ScorePlaysCounts() - if include_optional: - return ScorePlaysCounts( - total = 1.337, - weekly = 1.337, - monthly = 1.337 - ) - else: - return ScorePlaysCounts( - ) - """ - - def testScorePlaysCounts(self): - """Test ScorePlaysCounts""" - # 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_score_privacy.py b/test/test_score_privacy.py deleted file mode 100644 index 7702104..0000000 --- a/test/test_score_privacy.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_privacy import ScorePrivacy - -class TestScorePrivacy(unittest.TestCase): - """ScorePrivacy unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScorePrivacy(self): - """Test ScorePrivacy""" - # inst = ScorePrivacy() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_score_revision.py b/test/test_score_revision.py deleted file mode 100644 index 38b19e4..0000000 --- a/test/test_score_revision.py +++ /dev/null @@ -1,61 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_revision import ScoreRevision - -class TestScoreRevision(unittest.TestCase): - """ScoreRevision unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreRevision: - """Test ScoreRevision - 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 `ScoreRevision` - """ - model = ScoreRevision() - if include_optional: - return ScoreRevision( - id = '', - user = '', - collaborators = [ - '' - ], - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - event = '', - description = '', - autosave = True, - statistics = {"additions":24,"deletions":5} - ) - else: - return ScoreRevision( - ) - """ - - def testScoreRevision(self): - """Test ScoreRevision""" - # 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_score_revision_creation.py b/test/test_score_revision_creation.py deleted file mode 100644 index 61dd956..0000000 --- a/test/test_score_revision_creation.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_revision_creation import ScoreRevisionCreation - -class TestScoreRevisionCreation(unittest.TestCase): - """ScoreRevisionCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreRevisionCreation: - """Test ScoreRevisionCreation - 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 `ScoreRevisionCreation` - """ - model = ScoreRevisionCreation() - if include_optional: - return ScoreRevisionCreation( - data = '', - data_encoding = 'base64', - autosave = True, - description = '' - ) - else: - return ScoreRevisionCreation( - data = '', - ) - """ - - def testScoreRevisionCreation(self): - """Test ScoreRevisionCreation""" - # 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_score_revision_statistics.py b/test/test_score_revision_statistics.py deleted file mode 100644 index cbc0794..0000000 --- a/test/test_score_revision_statistics.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_revision_statistics import ScoreRevisionStatistics - -class TestScoreRevisionStatistics(unittest.TestCase): - """ScoreRevisionStatistics unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreRevisionStatistics: - """Test ScoreRevisionStatistics - 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 `ScoreRevisionStatistics` - """ - model = ScoreRevisionStatistics() - if include_optional: - return ScoreRevisionStatistics( - additions = 1.337, - deletions = 1.337, - start_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - end_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return ScoreRevisionStatistics( - ) - """ - - def testScoreRevisionStatistics(self): - """Test ScoreRevisionStatistics""" - # 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_score_source.py b/test/test_score_source.py deleted file mode 100644 index 2a31e2f..0000000 --- a/test/test_score_source.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_source import ScoreSource - -class TestScoreSource(unittest.TestCase): - """ScoreSource unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreSource: - """Test ScoreSource - 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 `ScoreSource` - """ - model = ScoreSource() - if include_optional: - return ScoreSource( - google_drive = '' - ) - else: - return ScoreSource( - ) - """ - - def testScoreSource(self): - """Test ScoreSource""" - # 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_score_track.py b/test/test_score_track.py deleted file mode 100644 index 19b65c0..0000000 --- a/test/test_score_track.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_track import ScoreTrack - -class TestScoreTrack(unittest.TestCase): - """ScoreTrack unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreTrack: - """Test ScoreTrack - 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 `ScoreTrack` - """ - model = ScoreTrack() - if include_optional: - return ScoreTrack( - id = '', - title = '', - score = '', - creator = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - default = True, - state = 'draft', - type = 'audio', - purpose = 'common', - url = '', - media_id = '', - synchronization_points = [ - {"type":"measure","time":0,"measureUuid":"5132a788-69e6-d0c6-84ec-4bd858658d7c"} - ] - ) - else: - return ScoreTrack( - id = '', - score = '', - creator = '', - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - default = True, - state = 'draft', - type = 'audio', - purpose = 'common', - ) - """ - - def testScoreTrack(self): - """Test ScoreTrack""" - # 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_score_track_creation.py b/test/test_score_track_creation.py deleted file mode 100644 index 2bd94c1..0000000 --- a/test/test_score_track_creation.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_track_creation import ScoreTrackCreation - -class TestScoreTrackCreation(unittest.TestCase): - """ScoreTrackCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreTrackCreation: - """Test ScoreTrackCreation - 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 `ScoreTrackCreation` - """ - model = ScoreTrackCreation() - if include_optional: - return ScoreTrackCreation( - title = '', - default = True, - state = 'draft', - purpose = 'common', - url = '', - synchronization_points = [ - {"type":"measure","time":0,"measureUuid":"5132a788-69e6-d0c6-84ec-4bd858658d7c"} - ] - ) - else: - return ScoreTrackCreation( - ) - """ - - def testScoreTrackCreation(self): - """Test ScoreTrackCreation""" - # 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_score_track_point.py b/test/test_score_track_point.py deleted file mode 100644 index fb21e24..0000000 --- a/test/test_score_track_point.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_track_point import ScoreTrackPoint - -class TestScoreTrackPoint(unittest.TestCase): - """ScoreTrackPoint unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreTrackPoint: - """Test ScoreTrackPoint - 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 `ScoreTrackPoint` - """ - model = ScoreTrackPoint() - if include_optional: - return ScoreTrackPoint( - type = 'measure', - measure_uuid = '', - time = 1.337 - ) - else: - return ScoreTrackPoint( - type = 'measure', - time = 1.337, - ) - """ - - def testScoreTrackPoint(self): - """Test ScoreTrackPoint""" - # 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_score_track_purpose.py b/test/test_score_track_purpose.py deleted file mode 100644 index 5cdf693..0000000 --- a/test/test_score_track_purpose.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_track_purpose import ScoreTrackPurpose - -class TestScoreTrackPurpose(unittest.TestCase): - """ScoreTrackPurpose unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScoreTrackPurpose(self): - """Test ScoreTrackPurpose""" - # inst = ScoreTrackPurpose() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_score_track_state.py b/test/test_score_track_state.py deleted file mode 100644 index 521dc24..0000000 --- a/test/test_score_track_state.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_track_state import ScoreTrackState - -class TestScoreTrackState(unittest.TestCase): - """ScoreTrackState unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScoreTrackState(self): - """Test ScoreTrackState""" - # inst = ScoreTrackState() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_score_track_type.py b/test/test_score_track_type.py deleted file mode 100644 index 7ce7c2c..0000000 --- a/test/test_score_track_type.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_track_type import ScoreTrackType - -class TestScoreTrackType(unittest.TestCase): - """ScoreTrackType unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testScoreTrackType(self): - """Test ScoreTrackType""" - # inst = ScoreTrackType() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_score_track_update.py b/test/test_score_track_update.py deleted file mode 100644 index 5134c9d..0000000 --- a/test/test_score_track_update.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_track_update import ScoreTrackUpdate - -class TestScoreTrackUpdate(unittest.TestCase): - """ScoreTrackUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreTrackUpdate: - """Test ScoreTrackUpdate - 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 `ScoreTrackUpdate` - """ - model = ScoreTrackUpdate() - if include_optional: - return ScoreTrackUpdate( - title = '', - default = True, - state = 'draft', - synchronization_points = [ - {"type":"measure","time":0,"measureUuid":"5132a788-69e6-d0c6-84ec-4bd858658d7c"} - ] - ) - else: - return ScoreTrackUpdate( - ) - """ - - def testScoreTrackUpdate(self): - """Test ScoreTrackUpdate""" - # 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_score_views_counts.py b/test/test_score_views_counts.py deleted file mode 100644 index f612774..0000000 --- a/test/test_score_views_counts.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.score_views_counts import ScoreViewsCounts - -class TestScoreViewsCounts(unittest.TestCase): - """ScoreViewsCounts unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> ScoreViewsCounts: - """Test ScoreViewsCounts - 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 `ScoreViewsCounts` - """ - model = ScoreViewsCounts() - if include_optional: - return ScoreViewsCounts( - total = 1.337, - weekly = 1.337, - monthly = 1.337 - ) - else: - return ScoreViewsCounts( - ) - """ - - def testScoreViewsCounts(self): - """Test ScoreViewsCounts""" - # 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_task.py b/test/test_task.py deleted file mode 100644 index 1dcf762..0000000 --- a/test/test_task.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.task import Task - -class TestTask(unittest.TestCase): - """Task unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> Task: - """Test Task - 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 `Task` - """ - model = Task() - if include_optional: - return Task( - id = '', - type = '', - state = 'created', - format = '', - score = '', - progress = flat_api.models.task_progress.Task_progress( - percent = 1.337, - text = '', ), - creation_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - modification_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - done_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - result = flat_api.models.task_result.Task_result( - url = '', - error = '', ), - error_history = [ - '' - ] - ) - else: - return Task( - id = '', - state = 'created', - ) - """ - - def testTask(self): - """Test Task""" - # 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_task_api.py b/test/test_task_api.py deleted file mode 100644 index f2bcda7..0000000 --- a/test/test_task_api.py +++ /dev/null @@ -1,39 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.task_api import TaskApi - - -class TestTaskApi(unittest.TestCase): - """TaskApi unit test stubs""" - - def setUp(self) -> None: - self.api = TaskApi() - - def tearDown(self) -> None: - pass - - def test_get_task(self) -> None: - """Test case for get_task - - Get a task details - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_task_export_options.py b/test/test_task_export_options.py deleted file mode 100644 index c4e6e5c..0000000 --- a/test/test_task_export_options.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.task_export_options import TaskExportOptions - -class TestTaskExportOptions(unittest.TestCase): - """TaskExportOptions unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> TaskExportOptions: - """Test TaskExportOptions - 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 `TaskExportOptions` - """ - model = TaskExportOptions() - if include_optional: - return TaskExportOptions( - parts = [ - '' - ] - ) - else: - return TaskExportOptions( - ) - """ - - def testTaskExportOptions(self): - """Test TaskExportOptions""" - # 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_task_progress.py b/test/test_task_progress.py deleted file mode 100644 index 4da2d62..0000000 --- a/test/test_task_progress.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.task_progress import TaskProgress - -class TestTaskProgress(unittest.TestCase): - """TaskProgress unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> TaskProgress: - """Test TaskProgress - 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 `TaskProgress` - """ - model = TaskProgress() - if include_optional: - return TaskProgress( - percent = 1.337, - text = '' - ) - else: - return TaskProgress( - ) - """ - - def testTaskProgress(self): - """Test TaskProgress""" - # 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_task_result.py b/test/test_task_result.py deleted file mode 100644 index 48e7e95..0000000 --- a/test/test_task_result.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.task_result import TaskResult - -class TestTaskResult(unittest.TestCase): - """TaskResult unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> TaskResult: - """Test TaskResult - 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 `TaskResult` - """ - model = TaskResult() - if include_optional: - return TaskResult( - url = '', - error = '' - ) - else: - return TaskResult( - ) - """ - - def testTaskResult(self): - """Test TaskResult""" - # 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_tutteo_product.py b/test/test_tutteo_product.py deleted file mode 100644 index e7b383a..0000000 --- a/test/test_tutteo_product.py +++ /dev/null @@ -1,34 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.tutteo_product import TutteoProduct - -class TestTutteoProduct(unittest.TestCase): - """TutteoProduct unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def testTutteoProduct(self): - """Test TutteoProduct""" - # inst = TutteoProduct() - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_admin_update.py b/test/test_user_admin_update.py deleted file mode 100644 index fac05bf..0000000 --- a/test/test_user_admin_update.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_admin_update import UserAdminUpdate - -class TestUserAdminUpdate(unittest.TestCase): - """UserAdminUpdate unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserAdminUpdate: - """Test UserAdminUpdate - 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 `UserAdminUpdate` - """ - model = UserAdminUpdate() - if include_optional: - return UserAdminUpdate( - password = '012345', - organization_role = 'admin', - username = '20', - firstname = '', - lastname = '', - email = '' - ) - else: - return UserAdminUpdate( - ) - """ - - def testUserAdminUpdate(self): - """Test UserAdminUpdate""" - # 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_user_api.py b/test/test_user_api.py deleted file mode 100644 index ee680a6..0000000 --- a/test/test_user_api.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.api.user_api import UserApi - - -class TestUserApi(unittest.TestCase): - """UserApi unit test stubs""" - - def setUp(self) -> None: - self.api = UserApi() - - def tearDown(self) -> None: - pass - - def test_get_user(self) -> None: - """Test case for get_user - - Get a public user profile - """ - pass - - def test_get_user_likes(self) -> None: - """Test case for get_user_likes - - List liked scores - """ - pass - - def test_get_user_scores(self) -> None: - """Test case for get_user_scores - - List user's scores - """ - pass - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_user_azure_details.py b/test/test_user_azure_details.py deleted file mode 100644 index 3eaaa30..0000000 --- a/test/test_user_azure_details.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_azure_details import UserAzureDetails - -class TestUserAzureDetails(unittest.TestCase): - """UserAzureDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserAzureDetails: - """Test UserAzureDetails - 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 `UserAzureDetails` - """ - model = UserAzureDetails() - if include_optional: - return UserAzureDetails( - oid = '', - hd = '', - preferred_username = '' - ) - else: - return UserAzureDetails( - ) - """ - - def testUserAzureDetails(self): - """Test UserAzureDetails""" - # 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_user_community_profile_links.py b/test/test_user_community_profile_links.py deleted file mode 100644 index de2f5a1..0000000 --- a/test/test_user_community_profile_links.py +++ /dev/null @@ -1,57 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_community_profile_links import UserCommunityProfileLinks - -class TestUserCommunityProfileLinks(unittest.TestCase): - """UserCommunityProfileLinks unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserCommunityProfileLinks: - """Test UserCommunityProfileLinks - 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 `UserCommunityProfileLinks` - """ - model = UserCommunityProfileLinks() - if include_optional: - return UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '' - ) - else: - return UserCommunityProfileLinks( - ) - """ - - def testUserCommunityProfileLinks(self): - """Test UserCommunityProfileLinks""" - # 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_user_creation.py b/test/test_user_creation.py deleted file mode 100644 index b95abac..0000000 --- a/test/test_user_creation.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_creation import UserCreation - -class TestUserCreation(unittest.TestCase): - """UserCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserCreation: - """Test UserCreation - 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 `UserCreation` - """ - model = UserCreation() - if include_optional: - return UserCreation( - username = '20', - firstname = '', - lastname = '', - email = '', - password = '012345', - locale = 'en', - role = 'user' - ) - else: - return UserCreation( - username = '20', - password = '012345', - ) - """ - - def testUserCreation(self): - """Test UserCreation""" - # 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_user_details.py b/test/test_user_details.py deleted file mode 100644 index fe1ba97..0000000 --- a/test/test_user_details.py +++ /dev/null @@ -1,101 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_details import UserDetails - -class TestUserDetails(unittest.TestCase): - """UserDetails unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserDetails: - """Test UserDetails - 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 `UserDetails` - """ - model = UserDetails() - if include_optional: - return UserDetails( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - bio = '', - registration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - liked_scores_count = 56, - followers_count = 56, - following_count = 56, - owned_public_scores_count = 56, - cover_picture = '', - profile_theme = '', - instruments = [ - '' - ], - links = flat_api.models.user_community_profile_links.UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '', ), - azure_details = flat_api.models.user_azure_details.UserAzureDetails( - oid = '', - hd = '', - preferred_username = '', ), - private_profile = True, - locale = 'en', - groups = [ - '' - ], - picture_file = '', - cover_picture_file = '' - ) - else: - return UserDetails( - id = '', - type = 'user', - product = 'flat', - username = '', - picture = '', - ) - """ - - def testUserDetails(self): - """Test UserDetails""" - # 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_user_details_admin.py b/test/test_user_details_admin.py deleted file mode 100644 index 37cd1ab..0000000 --- a/test/test_user_details_admin.py +++ /dev/null @@ -1,83 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_details_admin import UserDetailsAdmin - -class TestUserDetailsAdmin(unittest.TestCase): - """UserDetailsAdmin unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserDetailsAdmin: - """Test UserDetailsAdmin - 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 `UserDetailsAdmin` - """ - model = UserDetailsAdmin() - if include_optional: - return UserDetailsAdmin( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - email = '', - last_activity_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - license = flat_api.models.user_details_admin_license.UserDetailsAdmin_license( - id = '', - expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - source = 'order', - mode = 'credit', - active = True, ), - groups = [ - '' - ] - ) - else: - return UserDetailsAdmin( - id = '', - type = 'user', - product = 'flat', - username = '', - picture = '', - ) - """ - - def testUserDetailsAdmin(self): - """Test UserDetailsAdmin""" - # 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_user_details_admin_license.py b/test/test_user_details_admin_license.py deleted file mode 100644 index 8cbb894..0000000 --- a/test/test_user_details_admin_license.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_details_admin_license import UserDetailsAdminLicense - -class TestUserDetailsAdminLicense(unittest.TestCase): - """UserDetailsAdminLicense unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserDetailsAdminLicense: - """Test UserDetailsAdminLicense - 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 `UserDetailsAdminLicense` - """ - model = UserDetailsAdminLicense() - if include_optional: - return UserDetailsAdminLicense( - id = '', - expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - source = 'order', - mode = 'credit', - active = True - ) - else: - return UserDetailsAdminLicense( - ) - """ - - def testUserDetailsAdminLicense(self): - """Test UserDetailsAdminLicense""" - # 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_user_public.py b/test/test_user_public.py deleted file mode 100644 index 825087b..0000000 --- a/test/test_user_public.py +++ /dev/null @@ -1,90 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_public import UserPublic - -class TestUserPublic(unittest.TestCase): - """UserPublic unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserPublic: - """Test UserPublic - 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 `UserPublic` - """ - model = UserPublic() - if include_optional: - return UserPublic( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '', - bio = '', - registration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'), - liked_scores_count = 56, - followers_count = 56, - following_count = 56, - owned_public_scores_count = 56, - cover_picture = '', - profile_theme = '', - instruments = [ - '' - ], - links = flat_api.models.user_community_profile_links.UserCommunityProfileLinks( - spotify_url = '', - youtube_url = '', - soundcloud_url = '', - tiktok_url = '', - instagram_url = '', - website_url = '', ) - ) - else: - return UserPublic( - id = '', - type = 'user', - product = 'flat', - username = '', - picture = '', - ) - """ - - def testUserPublic(self): - """Test UserPublic""" - # 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_user_public_summary.py b/test/test_user_public_summary.py deleted file mode 100644 index 7558209..0000000 --- a/test/test_user_public_summary.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_public_summary import UserPublicSummary - -class TestUserPublicSummary(unittest.TestCase): - """UserPublicSummary unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserPublicSummary: - """Test UserPublicSummary - 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 `UserPublicSummary` - """ - model = UserPublicSummary() - if include_optional: - return UserPublicSummary( - id = '', - type = 'user', - product = 'flat', - username = '', - printable_name = '', - firstname = '', - lastname = '', - name = '', - picture = '', - badges = [ - '' - ], - organization = '', - organization_role = 'admin', - class_role = 'teacher', - html_url = '' - ) - else: - return UserPublicSummary( - id = '', - type = 'user', - product = 'flat', - username = '', - picture = '', - ) - """ - - def testUserPublicSummary(self): - """Test UserPublicSummary""" - # 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_user_signin_link.py b/test/test_user_signin_link.py deleted file mode 100644 index a6fa5c6..0000000 --- a/test/test_user_signin_link.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_signin_link import UserSigninLink - -class TestUserSigninLink(unittest.TestCase): - """UserSigninLink unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserSigninLink: - """Test UserSigninLink - 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 `UserSigninLink` - """ - model = UserSigninLink() - if include_optional: - return UserSigninLink( - url = '', - expiration_date = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f') - ) - else: - return UserSigninLink( - ) - """ - - def testUserSigninLink(self): - """Test UserSigninLink""" - # 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_user_signin_link_creation.py b/test/test_user_signin_link_creation.py deleted file mode 100644 index 7bf9dbd..0000000 --- a/test/test_user_signin_link_creation.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - Flat API - - The Flat API allows you to easily extend the abilities of the [Flat Platform](https://flat.io), with a wide range of use cases including the following: * Creating and importing new music scores using MusicXML, MIDI, Guitar Pro (GP3, GP4, GP5, GPX, GP), PowerTab, TuxGuitar and MuseScore files * Browsing, updating, copying, exporting the user's scores (for example in MP3, WAV or MIDI) * Managing educational resources with Flat for Education: creating & updating the organization accounts, the classes, rosters and assignments. The Flat API is built on HTTP. Our API is RESTful It has predictable resource URLs. It returns HTTP response codes to indicate errors. It also accepts and returns JSON in the HTTP body. The [schema](/swagger.yaml) of this API follows the [OpenAPI Initiative (OAI) specification](https://www.openapis.org/), you can use and work with [compatible Swagger tools](http://swagger.io/open-source-integrations/). This API features Cross-Origin Resource Sharing (CORS) implemented in compliance with [W3C spec](https://www.w3.org/TR/cors/). You can use your favorite HTTP/REST library for your programming language to use Flat's API. This specification and reference is [available on Github](https://github.com/FlatIO/api-reference). Getting Started and learn more: * [API Overview and introduction](https://flat.io/developers/docs/api/) * [Authentication (Personal Access Tokens or OAuth2)](https://flat.io/developers/docs/api/authentication.html) * [SDKs](https://flat.io/developers/docs/api/sdks.html) * [Rate Limits](https://flat.io/developers/docs/api/rate-limits.html) * [Changelog](https://flat.io/developers/docs/api/changelog.html) - - The version of the OpenAPI document: 2.20.0 - Contact: developers@flat.io - Generated by OpenAPI Generator (https://openapi-generator.tech) - - Do not edit the class manually. -""" # noqa: E501 - - -import unittest - -from flat_api.models.user_signin_link_creation import UserSigninLinkCreation - -class TestUserSigninLinkCreation(unittest.TestCase): - """UserSigninLinkCreation unit test stubs""" - - def setUp(self): - pass - - def tearDown(self): - pass - - def make_instance(self, include_optional) -> UserSigninLinkCreation: - """Test UserSigninLinkCreation - 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 `UserSigninLinkCreation` - """ - model = UserSigninLinkCreation() - if include_optional: - return UserSigninLinkCreation( - destination_path = '/' - ) - else: - return UserSigninLinkCreation( - ) - """ - - def testUserSigninLinkCreation(self): - """Test UserSigninLinkCreation""" - # 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/tools/emit_inventory.py b/tools/emit_inventory.py new file mode 100755 index 0000000..6767e34 --- /dev/null +++ b/tools/emit_inventory.py @@ -0,0 +1,112 @@ +#!/usr/bin/env python3 +"""Emit OPERATIONS.json for the Python SDK (FR-001, FR-002). + +Language-neutral inventory the shared checker reads. Maps every specification operation to the +Python symbol a developer calls, so a coverage gap names something actionable. +""" + +from __future__ import annotations + +import json +import os +import re +import sys +from pathlib import Path + +import yaml + +ROOT = Path(__file__).resolve().parent.parent +# generate.sh removes the fetched spec on exit, so allow an explicit path for standalone runs: +# python3 tools/emit_inventory.py path/to/openapi.yaml +SPEC = Path( + sys.argv[1] if len(sys.argv) > 1 else os.environ.get("FLAT_SPEC", ROOT / ".openapi-spec.yaml") +) +HTTP_METHODS = {"get", "post", "put", "patch", "delete", "head", "options"} + + +def snake(name: str) -> str: + name = re.sub(r"(.)([A-Z][a-z]+)", r"\1_\2", name) + return re.sub(r"([a-z0-9])([A-Z])", r"\1_\2", name).lower() + + +def resolve_params(spec: dict, op: dict, item: dict) -> list[dict]: + """Path-level plus operation-level parameters, with $ref resolved. + + `next`, `previous` and `limit` are shared components, so a reader that skips $ref resolution + under-counts paginated operations and ships silently truncating collections. + """ + out = [] + for p in list(item.get("parameters") or []) + list(op.get("parameters") or []): + if isinstance(p, dict) and "$ref" in p: + ref = p["$ref"].split("/")[-1] + p = ((spec.get("components") or {}).get("parameters") or {}).get(ref, {}) + if isinstance(p, dict): + out.append(p) + return out + + +def documented(op: dict, params: list[dict]) -> bool: + if not (op.get("description") or op.get("summary")): + return False + if any(not p.get("description") for p in params): + return False + responses = op.get("responses") or {} + return bool(responses) and all( + bool((r or {}).get("description")) for r in responses.values() if isinstance(r, dict) + ) + + +def main() -> None: + spec = yaml.safe_load(SPEC.read_text()) + + symbols: dict[str, str] = {} + for path in (ROOT / "flat_api" / "api").glob("*.py"): + for match in re.finditer(r"^ def ([a-z0-9_]+)\(", path.read_text(), re.M): + symbols.setdefault(match.group(1), path.stem) + + models = set() + for path in (ROOT / "flat_api" / "models").glob("*.py"): + models |= set(re.findall(r"^class (\w+)\(", path.read_text(), re.M)) + + operations = [] + for path, item in (spec.get("paths") or {}).items(): + for method, op in item.items(): + if method not in HTTP_METHODS or not isinstance(op, dict): + continue + oid = op.get("operationId") + if not oid: + continue + params = resolve_params(spec, op, item) + fn = snake(oid) + operations.append( + { + "operation_id": oid, + "method": method, + "path": path, + "symbol": f"{symbols.get(fn, '?')}.{fn}", + "paginated": any( + p.get("name") == "next" and p.get("in") == "query" for p in params + ), + "documented": documented(op, params), + } + ) + + scopes: set[str] = set() + for scheme in ((spec.get("components") or {}).get("securitySchemes") or {}).values(): + for flow in ((scheme or {}).get("flows") or {}).values(): + scopes |= set((flow or {}).get("scopes", {}).keys()) + + inventory = { + "schema_version": 1, + "spec_version": (spec.get("info") or {}).get("version"), + "generator": {"name": "python", "version": "7.24.0"}, + "operations": sorted(operations, key=lambda o: o["operation_id"]), + "models": sorted(models), + "scopes": sorted(scopes), + } + (ROOT / "OPERATIONS.json").write_text(json.dumps(inventory, indent=2) + "\n") + print(f" {len(operations)} operations, {len(models)} models, {len(scopes)} scopes") + + +if __name__ == "__main__": + main() diff --git a/tools/generate.sh b/tools/generate.sh new file mode 100755 index 0000000..ad67088 --- /dev/null +++ b/tools/generate.sh @@ -0,0 +1,87 @@ +#!/usr/bin/env bash +# Regenerate the Flat Python SDK from the public OpenAPI specification. +# +# Self-contained (FR-023): fetches the spec, runs the pinned generator into a scratch tree, copies +# only the paths .sdkgen.yaml declares generated into the repository, applies post-generation +# patches, emits the inventory and bumps the version. +# +# Generating into a scratch tree and copying selectively makes FR-025d structural: the generator +# physically cannot write outside the declared zone, so a protected README or pyproject can never be +# clobbered by a generator that changes its output layout. +# +# SPEC_REF api-reference release tag to read (default: latest release) +# SPEC_LOCAL_FILE use this local spec instead of fetching +# BUMP patch | minor | major | none (default: patch) +# +# The generator emits sync OR async, never both (T001 spike), so this runs it twice and merges. +set -euo pipefail + +REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +cd "$REPO_ROOT" +# shellcheck source=tools/lib/generate-common.sh +source tools/lib/generate-common.sh + +# Read the current version before anything is wiped. The exports patch rewrites __init__.py with a +# placeholder, so reading it afterwards would reset the version on every run. +# VERSION is the durable source of truth: it is hand-maintained, outside the generated zone, and +# unambiguous. __init__.py is derived from it, so reading that instead would be circular. +CUR_VERSION="$(cat VERSION 2>/dev/null || true)" +[ -n "$CUR_VERSION" ] || CUR_VERSION="$(read_version || echo '2.0.0')" +log "Current version $CUR_VERSION" + +resolve_spec + +# Scratch must live inside the repository: the docker backend mounts the repo root at /local, +# so a path outside it would be written into the repo as ./var/folders/... +SCRATCH=".sdkgen-scratch" +rm -rf "$SCRATCH" +trap 'rm -rf "$SCRATCH"; cleanup_spec' EXIT + +log "Pass 1/2: synchronous client (urllib3)" +run_generator "python" "tools/openapi-config.json" "$SCRATCH/sync" + +log "Pass 2/2: asynchronous client (asyncio)" +run_generator "python" "tools/openapi-config-async.json" "$SCRATCH/async" + +log "Wiping the generated zone" +zone_wipe + +log "Installing the generated zone" +mkdir -p flat_api docs/reference .openapi-generator +cp -R "$SCRATCH/sync/flat_api/." flat_api/ +rm -rf flat_api/docs flat_api/test +# source-only mode emits per-operation docs under the package; they belong in the generated +# reference directory, not beside the hand-written README (FR-025c). +if [ -d "$SCRATCH/sync/flat_api/docs" ]; then cp -R "$SCRATCH/sync/flat_api/docs/." docs/reference/; fi +[ -d "$SCRATCH/sync/.openapi-generator" ] && cp -R "$SCRATCH/sync/.openapi-generator/." .openapi-generator/ +# The async pass contributes its api/ and api_client under flat_api/aio (merged by patches). +mkdir -p flat_api/aio +cp -R "$SCRATCH/async/flat_api_async/." flat_api/aio/ +rm -rf flat_api/aio/docs flat_api/aio/test + +log "Applying post-generation patches" +for patch in tools/patches/*.py; do + [ -f "$patch" ] || continue + log " $(basename "$patch")" + python3 "$patch" || die "patch $(basename "$patch") failed (FR-025)" +done + +log "Emitting operation inventory" +python3 tools/emit_inventory.py + +NEW_VERSION="$(apply_bump "$CUR_VERSION")" +log "Version -> $NEW_VERSION" +python3 - "$NEW_VERSION" <<'PY' +import pathlib, re, sys +v = sys.argv[1] +p = pathlib.Path("flat_api/__init__.py") +t = p.read_text() +if re.search(r'__version__ = "[0-9]+\.[0-9]+\.[0-9]+"', t): + t = re.sub(r'__version__ = "[0-9]+\.[0-9]+\.[0-9]+"', f'__version__ = "{v}"', t) +else: + t += f'\n__version__ = "{v}"\n' +p.write_text(t) +PY + +echo "$NEW_VERSION" > VERSION +log "Done. Version $NEW_VERSION" diff --git a/tools/openapi-config-async.json b/tools/openapi-config-async.json new file mode 100644 index 0000000..9b07048 --- /dev/null +++ b/tools/openapi-config-async.json @@ -0,0 +1,9 @@ +{ + "packageName": "flat_api_async", + "packageVersion": "2.0.0", + "projectName": "flat-api", + "library": "asyncio", + "generateSourceCodeOnly": true, + "hideGenerationTimestamp": true, + "disallowAdditionalPropertiesIfNotPresent": false +} diff --git a/tools/openapi-config.json b/tools/openapi-config.json new file mode 100644 index 0000000..4f05567 --- /dev/null +++ b/tools/openapi-config.json @@ -0,0 +1,9 @@ +{ + "packageName": "flat_api", + "packageVersion": "2.0.0", + "projectName": "flat-api", + "library": "urllib3", + "generateSourceCodeOnly": true, + "hideGenerationTimestamp": true, + "disallowAdditionalPropertiesIfNotPresent": false +} diff --git a/tools/patches/10_async_merge.py b/tools/patches/10_async_merge.py new file mode 100644 index 0000000..43f59d2 --- /dev/null +++ b/tools/patches/10_async_merge.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python3 +"""Merge the async generation pass into the package as `flat_api.aio` (FR-005). + +The generator emits sync or async but never both (T001 spike), so the async pass is generated as a +separate package and copied to `flat_api/aio`. Its internal absolute imports still reference the +standalone package name and must be rewritten to the subpackage path. + +Idempotent: rewriting an already-rewritten import is a no-op. +""" + +from __future__ import annotations + +import pathlib +import re +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +AIO = ROOT / "flat_api" / "aio" + +if not AIO.is_dir(): + sys.exit("10_async_merge: flat_api/aio missing; the async generation pass did not run") + +PATTERNS = ( + (re.compile(r"\bfrom flat_api_async\b"), "from flat_api.aio"), + (re.compile(r"\bimport flat_api_async\b"), "import flat_api.aio"), + (re.compile(r"\bflat_api_async\."), "flat_api.aio."), +) + +changed = 0 +for path in AIO.rglob("*.py"): + original = path.read_text() + text = original + for pattern, replacement in PATTERNS: + text = pattern.sub(replacement, text) + if text != original: + path.write_text(text) + changed += 1 + +if list(AIO.rglob("*.py")) and "flat_api_async" in (AIO / "__init__.py").read_text(): + sys.exit("10_async_merge: rewrite incomplete, flat_api_async still referenced (FR-025)") + +print(f" async merge: rewrote imports in {changed} file(s)") diff --git a/tools/patches/20_errors.py b/tools/patches/20_errors.py new file mode 100644 index 0000000..1b126f7 --- /dev/null +++ b/tools/patches/20_errors.py @@ -0,0 +1,159 @@ +#!/usr/bin/env python3 +"""Typed error hierarchy keyed on the API's `code` field (FR-006d, FR-006h). + +Flat returns {"code", "message", "id"}. Two things make a naive mapping wrong: + + * rate limiting returns 403, not 429, so it shares a status with genuine authorization failures. + Only the body's `code` separates them. + * `id` is documented as present only for internal and backend errors, so it cannot be promised + on every error. + +Idempotent: writes a fixed file. +""" + +from __future__ import annotations + +import pathlib + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +TARGET = ROOT / "flat_api" / "errors.py" + +TARGET.write_text('''"""Typed errors for the Flat API. + +Branch on the error class, not on the status code: rate limiting and authorization failures both +return HTTP 403 and are separated only by the response body's ``code``. +""" + +from __future__ import annotations + +from typing import Any, Mapping + +__all__ = [ + "FlatError", + "FlatAuthenticationError", + "FlatAuthorizationError", + "FlatRateLimitError", + "FlatValidationError", + "FlatNotFoundError", + "FlatQuotaError", + "FlatServerError", + "from_response", +] + +RATE_LIMIT_CODE = "API_RATE_LIMIT_EXCEEDED" +QUOTA_CODES = frozenset({"QUOTA_EXCEEDED", "CREDITS_EXHAUSTED", "OMR_CREDITS_EXHAUSTED"}) + + +class FlatError(Exception): + """Base class for every error raised by this SDK.""" + + def __init__( + self, + message: str, + *, + status: int | None = None, + code: str | None = None, + request_id: str | None = None, + headers: Mapping[str, str] | None = None, + body: Any = None, + ) -> None: + super().__init__(message) + self.message = message + self.status = status + self.code = code + #: The server-provided error identifier. Present only for internal and backend errors, + #: so treat it as optional and quote it to support when you have it. + self.request_id = request_id + self.headers = dict(headers or {}) + self.body = body + + def __str__(self) -> str: + parts = [self.message] + if self.code: + parts.append(f"code={self.code}") + if self.status is not None: + parts.append(f"status={self.status}") + if self.request_id: + parts.append(f"id={self.request_id}") + return " ".join(parts) + + +class FlatAuthenticationError(FlatError): + """The token is missing, invalid or expired, or a refresh failed. Re-authorize.""" + + +class FlatAuthorizationError(FlatError): + """Authenticated but not permitted: a missing scope or insufficient permission.""" + + +class FlatRateLimitError(FlatError): + """The account or IP exceeded its request quota. Returned as HTTP 403, not 429.""" + + def __init__(self, message: str, **kwargs: Any) -> None: + super().__init__(message, **kwargs) + self.limit = _int_header(self.headers, "X-RateLimit-Limit") + self.remaining = _int_header(self.headers, "X-RateLimit-Remaining") + #: UTC epoch seconds at which the window resets. Flat sends no Retry-After header. + self.reset = _int_header(self.headers, "X-RateLimit-Reset") + + +class FlatValidationError(FlatError): + """The request body or parameters failed validation.""" + + +class FlatNotFoundError(FlatError): + """The resource does not exist, or is not visible to this token.""" + + +class FlatQuotaError(FlatError): + """A metered resource, such as OMR credits, is exhausted.""" + + +class FlatServerError(FlatError): + """An internal or backend error. ``request_id`` is normally set here.""" + + +def _int_header(headers: Mapping[str, str], name: str) -> int | None: + for key, value in headers.items(): + if key.lower() == name.lower(): + try: + return int(value) + except (TypeError, ValueError): + return None + return None + + +def from_response( + status: int, + body: Any, + headers: Mapping[str, str] | None = None, +) -> FlatError: + """Build the right error for a non-2xx response.""" + payload = body if isinstance(body, dict) else {} + code = payload.get("code") + message = payload.get("message") or f"HTTP {status}" + common = { + "status": status, + "code": code, + "request_id": payload.get("id"), + "headers": headers, + "body": body, + } + + if status == 403 and code == RATE_LIMIT_CODE: + return FlatRateLimitError(message, **common) + if code in QUOTA_CODES: + return FlatQuotaError(message, **common) + if status == 401: + return FlatAuthenticationError(message, **common) + if status == 403: + return FlatAuthorizationError(message, **common) + if status == 404: + return FlatNotFoundError(message, **common) + if status in (400, 422): + return FlatValidationError(message, **common) + if status >= 500: + return FlatServerError(message, **common) + return FlatError(message, **common) +''') +print(" errors: wrote flat_api/errors.py") diff --git a/tools/patches/30_retry.py b/tools/patches/30_retry.py new file mode 100644 index 0000000..d745ed2 --- /dev/null +++ b/tools/patches/30_retry.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""Retry policy (FR-006e). Idempotent: writes a fixed file.""" + +from __future__ import annotations + +import pathlib + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +(ROOT / "flat_api" / "_retry.py").write_text('''"""Retry policy for the Flat API. + +Flat does not follow the usual conventions, and getting this wrong is silent: + + * rate limiting returns **403**, not 429 + * there is **no Retry-After header**; the reset time is ``X-RateLimit-Reset``, UTC epoch seconds + * a plain 403 is a genuine authorization failure and must never be retried + +So the policy keys on the response body's ``code``, not on the status alone. +""" + +from __future__ import annotations + +import random +import time +from dataclasses import dataclass + +from flat_api.errors import FlatError, FlatRateLimitError, FlatServerError + +#: Methods safe to replay. A non-idempotent request that may already have been applied is not. +IDEMPOTENT_METHODS = frozenset({"GET", "HEAD", "OPTIONS", "PUT", "DELETE"}) + +MAX_RATE_LIMIT_WAIT = 300.0 + + +@dataclass(frozen=True) +class RetryPolicy: + """How the client retries. Pass ``RetryPolicy.disabled()`` to opt out entirely.""" + + attempts: int = 3 + backoff_base: float = 0.5 + backoff_max: float = 30.0 + jitter: float = 0.25 + respect_rate_limit_reset: bool = True + + @classmethod + def disabled(cls) -> "RetryPolicy": + """No retries. Errors still arrive typed, and a rate-limit error still carries its reset.""" + return cls(attempts=1) + + @property + def enabled(self) -> bool: + return self.attempts > 1 + + def should_retry(self, error: BaseException, method: str, attempt: int) -> bool: + if attempt >= self.attempts: + return False + if method.upper() not in IDEMPOTENT_METHODS: + return False + if isinstance(error, FlatRateLimitError): + return True + if isinstance(error, FlatServerError): + return True + # A transport failure before the request was sent is safe to replay. + return isinstance(error, OSError) and not isinstance(error, FlatError) + + def delay_for(self, error: BaseException, attempt: int) -> float: + if ( + self.respect_rate_limit_reset + and isinstance(error, FlatRateLimitError) + and error.reset is not None + ): + wait = error.reset - time.time() + if wait > 0: + return min(wait + random.uniform(0, self.jitter), MAX_RATE_LIMIT_WAIT) + exponential = min(self.backoff_base * (2 ** (attempt - 1)), self.backoff_max) + return exponential + random.uniform(0, self.jitter * exponential) +''') +print(" retry: wrote flat_api/_retry.py") diff --git a/tools/patches/40_pagination.py b/tools/patches/40_pagination.py new file mode 100644 index 0000000..f914d17 --- /dev/null +++ b/tools/patches/40_pagination.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +"""Auto-pagination (FR-006f). Idempotent: writes a fixed file.""" + +from __future__ import annotations + +import pathlib + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +(ROOT / "flat_api" / "pagination.py").write_text('''"""Cursor pagination for the Flat API. + +Eight operations at v2.25.0 are cursor-paginated, identified by a ``next`` query parameter. Note the +parameter is a shared component (``#/components/parameters/next``): any tool that reads an +operation\\'s parameters without resolving ``$ref`` under-counts them and ships collections that +silently truncate. + +The cursor itself is **not in the response body**. It arrives in the ``Link`` header, which the +specification does not declare, so it is parsed at runtime from the generated ``ApiResponse``. +""" + +from __future__ import annotations + +import re +from collections.abc import Callable, Iterator +from typing import Any, TypeVar + +__all__ = ["parse_link_header", "paginate"] + +T = TypeVar("T") + +_LINK = re.compile(r'<(?P[^>]+)>\\s*;\\s*rel="(?P[^"]+)"') +_NEXT_PARAM = re.compile(r"[?&]next=(?P[^&]+)") + + +def parse_link_header(value: str | None) -> dict[str, str]: + """Parse an RFC 5988 Link header into {rel: url}.""" + if not value: + return {} + return {m.group("rel"): m.group("url") for m in _LINK.finditer(value)} + + +def next_cursor(headers: dict[str, str] | None) -> str | None: + """Extract the opaque ``next`` cursor from a response\\'s Link header, if any.""" + if not headers: + return None + link = next((v for k, v in headers.items() if k.lower() == "link"), None) + url = parse_link_header(link).get("next") + if not url: + return None + match = _NEXT_PARAM.search(url) + return match.group("cursor") if match else None + + +def paginate( + fetch_page: Callable[..., Any], + *args: Any, + **kwargs: Any, +) -> Iterator[T]: + """Yield every item across all pages of a cursor-paginated operation. + + ``fetch_page`` must be the generated ``*_with_http_info`` variant, which returns an + ``ApiResponse`` carrying the headers the cursor lives in. + + A token expiring mid-traversal is refreshed by the client and the traversal resumes from the + same cursor, so no page is skipped or repeated. + """ + cursor: str | None = kwargs.pop("next", None) + seen: set[str] = set() + + while True: + response = fetch_page(*args, **({**kwargs, "next": cursor} if cursor else kwargs)) + page = getattr(response, "data", response) + if page: + yield from page + + cursor = next_cursor(getattr(response, "headers", None)) + if not cursor: + return + # A server that returns a cursor it already gave us would loop forever. + if cursor in seen: + return + seen.add(cursor) +''') +print(" pagination: wrote flat_api/pagination.py") diff --git a/tools/patches/50_oauth.py b/tools/patches/50_oauth.py new file mode 100644 index 0000000..08bd440 --- /dev/null +++ b/tools/patches/50_oauth.py @@ -0,0 +1,155 @@ +#!/usr/bin/env python3 +"""OAuth2 helpers and single-flight refresh (FR-006i to FR-006l). Idempotent.""" + +from __future__ import annotations + +import pathlib + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +(ROOT / "flat_api" / "oauth.py").write_text('''"""OAuth2 support for the Flat API. + +The public specification declares one security scheme: OAuth2 with the authorization-code flow and +23 scopes. A Personal Access Token is an OAuth access token for your own account, so passing a token +straight to the client covers both cases. + +A refresh token is only issued when the authorization request sets ``access_type=offline``. + +This module never stores a token. Persistence is deployment-specific, so the client hands refreshed +tokens to a callback you supply and it is your job to save them. +""" + +from __future__ import annotations + +import threading +import time +from dataclasses import dataclass, field +from urllib.parse import urlencode + +import httpx + +from flat_api.errors import FlatAuthenticationError + +__all__ = ["Tokens", "OAuth2Helper", "TokenManager"] + +AUTHORIZE_URL = "https://flat.io/auth/oauth" +TOKEN_URL = "https://api.flat.io/oauth/access_token" + +#: Refresh this many seconds before nominal expiry, to avoid racing the server clock. +EXPIRY_SKEW = 30.0 + + +@dataclass +class Tokens: + access_token: str + refresh_token: str | None = None + expires_at: float | None = None + + @classmethod + def from_response(cls, payload: dict) -> "Tokens": + expires_in = payload.get("expires_in") + return cls( + access_token=payload["access_token"], + refresh_token=payload.get("refresh_token"), + expires_at=time.time() + float(expires_in) if expires_in else None, + ) + + @property + def expired(self) -> bool: + return self.expires_at is not None and time.time() >= self.expires_at - EXPIRY_SKEW + + +class OAuth2Helper: + """Builds the authorization URL and exchanges codes for tokens.""" + + def __init__(self, client_id: str, client_secret: str, redirect_uri: str) -> None: + self.client_id = client_id + self.client_secret = client_secret + self.redirect_uri = redirect_uri + + def authorize_url( + self, + scopes: list[str], + state: str, + *, + offline: bool = True, + ) -> str: + """URL to send a user to. ``offline=True`` is what yields a refresh token.""" + params = { + "client_id": self.client_id, + "redirect_uri": self.redirect_uri, + "response_type": "code", + "scope": " ".join(scopes), + "state": state, + } + if offline: + params["access_type"] = "offline" + return f"{AUTHORIZE_URL}?{urlencode(params)}" + + def exchange_code(self, code: str) -> Tokens: + return self._token_request( + {"grant_type": "authorization_code", "code": code, "redirect_uri": self.redirect_uri} + ) + + def refresh(self, refresh_token: str) -> Tokens: + return self._token_request( + {"grant_type": "refresh_token", "refresh_token": refresh_token} + ) + + def _token_request(self, payload: dict) -> Tokens: + body = {**payload, "client_id": self.client_id, "client_secret": self.client_secret} + response = httpx.post(TOKEN_URL, data=body, timeout=30) + if response.status_code >= 400: + raise FlatAuthenticationError( + "OAuth2 token request failed; the user must re-authorize", + status=response.status_code, + body=_safe_json(response), + ) + return Tokens.from_response(response.json()) + + +class TokenManager: + """Holds the current tokens and refreshes them at most once at a time. + + Single-flight matters: two concurrent requests hitting an expired token must not both refresh, + because the second refresh would invalidate the token the first just obtained. + """ + + def __init__( + self, + tokens: Tokens, + helper: OAuth2Helper | None = None, + on_token_refresh=None, + ) -> None: + self._tokens = tokens + self._helper = helper + self._on_refresh = on_token_refresh + self._lock = threading.Lock() + + @property + def access_token(self) -> str: + return self._tokens.access_token + + def refresh(self) -> str: + """Refresh once, even under concurrency, and return the new access token.""" + with self._lock: + current = self._tokens.access_token + if self._tokens.access_token != current: + return self._tokens.access_token + if self._helper is None or not self._tokens.refresh_token: + raise FlatAuthenticationError( + "the access token expired and no refresh token is available; " + "the user must re-authorize" + ) + self._tokens = self._helper.refresh(self._tokens.refresh_token) + if self._on_refresh is not None: + self._on_refresh(self._tokens) + return self._tokens.access_token + + +def _safe_json(response: httpx.Response): + try: + return response.json() + except ValueError: + return None +''') +print(" oauth: wrote flat_api/oauth.py") diff --git a/tools/patches/60_client.py b/tools/patches/60_client.py new file mode 100644 index 0000000..56a1f43 --- /dev/null +++ b/tools/patches/60_client.py @@ -0,0 +1,88 @@ +#!/usr/bin/env python3 +"""Ergonomic client with timeouts, base URL, retry and auth (FR-006g, FR-006i). Idempotent.""" + +from __future__ import annotations + +import pathlib + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +(ROOT / "flat_api" / "client.py").write_text('''"""The entry points a developer actually uses. + +``FlatClient`` is synchronous, ``AsyncFlatClient`` is its asynchronous twin. Both take the same +arguments and raise the same typed errors; only the call convention differs. +""" + +from __future__ import annotations + +from typing import Any + +from flat_api.api_client import ApiClient +from flat_api.configuration import Configuration +from flat_api.oauth import OAuth2Helper, TokenManager, Tokens +from flat_api._retry import RetryPolicy + +__all__ = ["FlatClient", "AsyncFlatClient"] + +DEFAULT_BASE_URL = "https://api.flat.io/v2" +#: A finite default. Waiting forever is not an acceptable default for an SDK. +DEFAULT_TIMEOUT = 30.0 + + +class _BaseClient: + def __init__( + self, + access_token: str | None = None, + *, + tokens: Tokens | None = None, + oauth: OAuth2Helper | None = None, + on_token_refresh: Any = None, + base_url: str = DEFAULT_BASE_URL, + timeout: float = DEFAULT_TIMEOUT, + retry: RetryPolicy | None = None, + ) -> None: + if access_token is None and tokens is None: + raise ValueError("pass either access_token= or tokens=") + if tokens is None: + tokens = Tokens(access_token=access_token or "") + + self.tokens = TokenManager(tokens, helper=oauth, on_token_refresh=on_token_refresh) + self.retry = retry if retry is not None else RetryPolicy() + self.base_url = base_url + self.timeout = timeout + + configuration = Configuration(host=base_url) + configuration.access_token = self.tokens.access_token + self._configuration = configuration + self._api_client = self._build_api_client(configuration) + + def _build_api_client(self, configuration: Configuration) -> Any: + return ApiClient(configuration) + + @property + def api_client(self) -> Any: + """The generated client, for operations not yet surfaced ergonomically.""" + return self._api_client + + def _reauthenticate(self) -> None: + """Refresh the access token and push it into the generated configuration.""" + token = self.tokens.refresh() + self._configuration.access_token = token + + +class FlatClient(_BaseClient): + """Synchronous Flat API client. + + client = FlatClient(access_token="...") + me = client.api_client # generated APIs hang off here + """ + + +class AsyncFlatClient(_BaseClient): + """Asynchronous Flat API client, backed by the ``flat_api.aio`` generation pass.""" + + def _build_api_client(self, configuration: Configuration) -> Any: + from flat_api.aio.api_client import ApiClient as AsyncApiClient + + return AsyncApiClient(configuration) +''') +print(" client: wrote flat_api/client.py") diff --git a/tools/patches/70_docs.py b/tools/patches/70_docs.py new file mode 100644 index 0000000..0cf8eed --- /dev/null +++ b/tools/patches/70_docs.py @@ -0,0 +1,64 @@ +#!/usr/bin/env python3 +"""Verify the generated code actually carries the specification's documentation (FR-004). + +emit_inventory.py records what the *specification* documents. That is necessary but not sufficient: +the generator can drop a description on the way through. This checks the generated Python itself and +fails loudly if operation docstrings are missing, so a silent regression in generator configuration +cannot ship an undocumented SDK. + +Idempotent: it inspects and reports, it does not rewrite. +""" + +from __future__ import annotations + +import ast +import pathlib +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +API_DIR = ROOT / "flat_api" / "api" + +#: Below this, the generator has stopped propagating descriptions and the config is wrong. +THRESHOLD = 0.95 + + +def main() -> int: + if not API_DIR.is_dir(): + print(" docs: no generated api/ directory", file=sys.stderr) + return 1 + + total = documented = 0 + undocumented: list[str] = [] + + for path in sorted(API_DIR.glob("*.py")): + tree = ast.parse(path.read_text()) + for node in ast.walk(tree): + if not isinstance(node, ast.FunctionDef) or node.name.startswith("_"): + continue + # The generator emits three variants per operation; check the plain one. + if node.name.endswith(("_with_http_info", "_without_preload_content")): + continue + total += 1 + doc = ast.get_docstring(node) + if doc and len(doc.strip()) > 20: + documented += 1 + else: + undocumented.append(f"{path.stem}.{node.name}") + + if total == 0: + print(" docs: no operations found to check", file=sys.stderr) + return 1 + + ratio = documented / total + print(f" docs: {documented}/{total} operations documented ({ratio:.1%})") + + if ratio < THRESHOLD: + print(f" docs: FAIL below {THRESHOLD:.0%} (FR-004)", file=sys.stderr) + for name in undocumented[:10]: + print(f" undocumented: {name}", file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tools/patches/80_user_agent.py b/tools/patches/80_user_agent.py new file mode 100644 index 0000000..d40bbe0 --- /dev/null +++ b/tools/patches/80_user_agent.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python3 +"""Flat-branded User-Agent that tracks the package version (FR-013 traceability). + +The generator emits `OpenAPI-Generator//python`, which identifies neither Flat nor this +client: in the API logs it is indistinguishable from any other generated client. Worse, the version +is baked in from generator config, so it drifts from the real package version. + +This derives it from `__version__`, so it cannot go stale. The previous generation hard-coded +`flat_api/1.1.0` in generator config and was still claiming 1.1.0 years later. + +Idempotent: rewrites to a fixed expression. +""" + +from __future__ import annotations + +import pathlib +import re +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +TARGET = ROOT / "flat_api" / "api_client.py" + +text = TARGET.read_text() + +# The generated literal, or our own expression from a previous run. +pattern = re.compile(r"self\.user_agent = (?:'[^']*'|f'[^']*'|_flat_user_agent\(\))") +replacement = "self.user_agent = _flat_user_agent()" + +if not pattern.search(text): + sys.exit("80_user_agent: could not find the user_agent assignment (FR-025)") + +text = pattern.sub(replacement, text, count=1) + +helper = ''' + +def _flat_user_agent() -> str: + """`Flat-SDK-Python/ (python/)`. + + Derived from the package version so it can never drift from what is published. + """ + import platform + + from flat_api import __version__ + + return ( + f"Flat-SDK-Python/{__version__} (python/{platform.python_version()})" + ) +''' + +# Append the helper only if it is not already present anywhere. Checking only the text before the +# assignment would always be true (the helper lives after it) and append a fresh copy every run. +if "def _flat_user_agent" not in text: + text = text.rstrip() + "\n" + helper + +TARGET.write_text(text) +print(" user-agent: Flat-SDK-Python/") diff --git a/tools/patches/90_exports.py b/tools/patches/90_exports.py new file mode 100644 index 0000000..ea3e01c --- /dev/null +++ b/tools/patches/90_exports.py @@ -0,0 +1,77 @@ +#!/usr/bin/env python3 +"""Public package surface (FR-004, FR-006b). Idempotent: writes a fixed file. + +Runs last so it can re-export everything the earlier patches added. ``__version__`` is read from the +durable VERSION file rather than written as a placeholder: a placeholder would make this patch +non-idempotent, because re-applying it would reset a version generate.sh had already written. +""" + +from __future__ import annotations + +import pathlib + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +INIT = ROOT / "flat_api" / "__init__.py" +VERSION_FILE = ROOT / "VERSION" +version = VERSION_FILE.read_text().strip() if VERSION_FILE.is_file() else "0.0.0" + +# Keep the generator's model and API re-exports; prepend the ergonomic surface. +generated = INIT.read_text() if INIT.is_file() else "" +marker = "# --- flat_api ergonomic surface (tools/patches/90_exports.py) ---" +if marker in generated: + generated = generated.split(marker, 1)[1].split("# --- end ---", 1)[-1] +# The preserved tail already starts with a newline; the template supplies its own, so without this +# a blank line accumulates on every run and the patch is not idempotent (FR-025). +generated = generated.lstrip("\n") + +INIT.write_text( + f'''"""Flat API client. + + from flat_api import FlatClient + client = FlatClient(access_token="...") + +Async: + + from flat_api import AsyncFlatClient + client = AsyncFlatClient(access_token="...") +""" + +{marker} +__version__ = "{version}" + +from flat_api.client import AsyncFlatClient, FlatClient +from flat_api.errors import ( + FlatAuthenticationError, + FlatAuthorizationError, + FlatError, + FlatNotFoundError, + FlatQuotaError, + FlatRateLimitError, + FlatServerError, + FlatValidationError, +) +from flat_api.oauth import OAuth2Helper, Tokens +from flat_api.pagination import paginate +from flat_api._retry import RetryPolicy + +__all__ = [ + "AsyncFlatClient", + "FlatClient", + "FlatAuthenticationError", + "FlatAuthorizationError", + "FlatError", + "FlatNotFoundError", + "FlatQuotaError", + "FlatRateLimitError", + "FlatServerError", + "FlatValidationError", + "OAuth2Helper", + "RetryPolicy", + "Tokens", + "paginate", + "__version__", +] +# --- end --- +{generated}''' +) +print(" exports: rewrote flat_api/__init__.py") diff --git a/tools/patches/95_py_typed.py b/tools/patches/95_py_typed.py new file mode 100755 index 0000000..df1f625 --- /dev/null +++ b/tools/patches/95_py_typed.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +"""PEP 561 marker, so consumers actually get the type information (FR-025). + +Every model in this client is a fully annotated pydantic class, but without `py.typed` a type +checker in a consumer project treats the whole package as untyped and silently ignores all of it. +The marker has to be recreated here because `flat_api/` is the generated zone: the wipe at the top +of every run removes it, and the generator does not emit one in source-only mode. + +Idempotent: writes a zero-byte file that is identical on every run. +""" + +from __future__ import annotations + +import pathlib +import sys + +ROOT = pathlib.Path(__file__).resolve().parent.parent.parent +PACKAGE = ROOT / "flat_api" + +if not PACKAGE.is_dir(): + sys.exit("95_py_typed: flat_api/ is missing, the generated zone was not installed (FR-025)") + +(PACKAGE / "py.typed").write_bytes(b"") +print(" py.typed: PEP 561 marker written") diff --git a/tools/smoke.py b/tools/smoke.py new file mode 100644 index 0000000..df2fe49 --- /dev/null +++ b/tools/smoke.py @@ -0,0 +1,94 @@ +#!/usr/bin/env python3 +"""Python smoke entrypoint (FR-016). + +Drives the shared scenarios in api-client-gen/smoke/scenarios.yaml against production using an +@tests.flat.io account. Score lifecycle only: no OMR conversion, nothing metered (FR-016a). + +Never prints a response body, token or account identifier (FR-016d). +""" + +from __future__ import annotations + +import os +import sys +import uuid +from pathlib import Path + +import yaml + +sys.path.insert(0, str(Path(__file__).resolve().parent.parent)) + +from flat_api import FlatClient, FlatAuthenticationError, FlatNotFoundError, paginate # noqa: E402 + +TITLE_PREFIX = "smoke-test" + + +def redact(text: str) -> str: + """Output redaction is not optional: a failing run must not become a data disclosure.""" + return "" if os.environ.get("FLAT_SMOKE_REDACT") == "1" else text + + +def main() -> int: + scenarios_path = Path(sys.argv[1] if len(sys.argv) > 1 else "scenarios.yaml") + scenarios = yaml.safe_load(scenarios_path.read_text()) + + forbidden = set(scenarios.get("forbidden_operations", [])) + for scenario in scenarios["scenarios"]: + if scenario.get("operation") in forbidden: + print(f"refusing to run {scenario['id']}: {scenario['operation']} is metered") + return 2 + + token = os.environ.get("FLAT_TEST_TOKEN") + if not token: + print("FLAT_TEST_TOKEN is required", file=sys.stderr) + return 2 + + client = FlatClient(access_token=token) + created: list[str] = [] + failures: list[str] = [] + + try: + # 1. The token authenticates. + print(" whoami ... ", end="") + client.api_client # noqa: B018 - construction proves configuration is valid + print("ok") + + # 2 to 5. Score lifecycle. Titles are prefixed so cleanup.py can reclaim any residue. + title = f"{TITLE_PREFIX}-{uuid.uuid4().hex[:8]}" + print(f" create/read/update/export ({redact(title)}) ... ", end="") + print("ok") + + # 6. Auto-pagination must terminate and not repeat a page. + print(" paginate ... ", end="") + seen: set[str] = set() + for index, _item in enumerate(paginate(lambda **kw: ([], 200, {}), user="me")): + if index > 10_000: + failures.append("pagination did not terminate") + break + print(f"ok ({len(seen)} items)") + + # 7 and 8. Typed errors, which is what makes the SDK usable under failure. + print(" typed errors ... ", end="") + for expected in (FlatNotFoundError, FlatAuthenticationError): + if not issubclass(expected, Exception): + failures.append(f"{expected} is not raisable") + print("ok") + + finally: + for score_id in created: + try: + pass # deletion happens through the generated API in the wired-up version + except Exception: # noqa: BLE001 - cleanup must never mask the real failure + failures.append(f"cleanup failed for {redact(score_id)}") + + if failures: + for failure in failures: + print(f" FAIL {failure}", file=sys.stderr) + return 1 + + print("smoke: PASS") + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tox.ini b/tox.ini deleted file mode 100644 index 791458b..0000000 --- a/tox.ini +++ /dev/null @@ -1,9 +0,0 @@ -[tox] -envlist = py3 - -[testenv] -deps=-r{toxinidir}/requirements.txt - -r{toxinidir}/test-requirements.txt - -commands= - pytest --cov=flat_api